1657 lines
119 KiB
Plaintext
1657 lines
119 KiB
Plaintext
|
{
|
|||
|
"nbformat": 4,
|
|||
|
"nbformat_minor": 0,
|
|||
|
"metadata": {
|
|||
|
"accelerator": "GPU",
|
|||
|
"colab": {
|
|||
|
"name": "Varying_loss_optimizer.ipynb",
|
|||
|
"provenance": [],
|
|||
|
"include_colab_link": true
|
|||
|
},
|
|||
|
"hide_input": false,
|
|||
|
"kernelspec": {
|
|||
|
"display_name": "Python 3",
|
|||
|
"language": "python",
|
|||
|
"name": "python3"
|
|||
|
},
|
|||
|
"language_info": {
|
|||
|
"codemirror_mode": {
|
|||
|
"name": "ipython",
|
|||
|
"version": 3
|
|||
|
},
|
|||
|
"file_extension": ".py",
|
|||
|
"mimetype": "text/x-python",
|
|||
|
"name": "python",
|
|||
|
"nbconvert_exporter": "python",
|
|||
|
"pygments_lexer": "ipython3",
|
|||
|
"version": "3.7.4"
|
|||
|
},
|
|||
|
"widgets": {
|
|||
|
"application/vnd.jupyter.widget-state+json": {
|
|||
|
"555f8075b30344ffad1a09752ac88ea1": {
|
|||
|
"model_module": "@jupyter-widgets/controls",
|
|||
|
"model_name": "HBoxModel",
|
|||
|
"state": {
|
|||
|
"_dom_classes": [],
|
|||
|
"_model_module": "@jupyter-widgets/controls",
|
|||
|
"_model_module_version": "1.5.0",
|
|||
|
"_model_name": "HBoxModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/controls",
|
|||
|
"_view_module_version": "1.5.0",
|
|||
|
"_view_name": "HBoxView",
|
|||
|
"box_style": "",
|
|||
|
"children": [
|
|||
|
"IPY_MODEL_e11f28d88a22465b97f31a8611583a76",
|
|||
|
"IPY_MODEL_8cef7279ec104ee5a45602603537ba92"
|
|||
|
],
|
|||
|
"layout": "IPY_MODEL_40a4dc115817415fb0f956ab8343921c"
|
|||
|
}
|
|||
|
},
|
|||
|
"40a4dc115817415fb0f956ab8343921c": {
|
|||
|
"model_module": "@jupyter-widgets/base",
|
|||
|
"model_name": "LayoutModel",
|
|||
|
"state": {
|
|||
|
"_model_module": "@jupyter-widgets/base",
|
|||
|
"_model_module_version": "1.2.0",
|
|||
|
"_model_name": "LayoutModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/base",
|
|||
|
"_view_module_version": "1.2.0",
|
|||
|
"_view_name": "LayoutView",
|
|||
|
"align_content": null,
|
|||
|
"align_items": null,
|
|||
|
"align_self": null,
|
|||
|
"border": null,
|
|||
|
"bottom": null,
|
|||
|
"display": null,
|
|||
|
"flex": null,
|
|||
|
"flex_flow": null,
|
|||
|
"grid_area": null,
|
|||
|
"grid_auto_columns": null,
|
|||
|
"grid_auto_flow": null,
|
|||
|
"grid_auto_rows": null,
|
|||
|
"grid_column": null,
|
|||
|
"grid_gap": null,
|
|||
|
"grid_row": null,
|
|||
|
"grid_template_areas": null,
|
|||
|
"grid_template_columns": null,
|
|||
|
"grid_template_rows": null,
|
|||
|
"height": null,
|
|||
|
"justify_content": null,
|
|||
|
"justify_items": null,
|
|||
|
"left": null,
|
|||
|
"margin": null,
|
|||
|
"max_height": null,
|
|||
|
"max_width": null,
|
|||
|
"min_height": null,
|
|||
|
"min_width": null,
|
|||
|
"object_fit": null,
|
|||
|
"object_position": null,
|
|||
|
"order": null,
|
|||
|
"overflow": null,
|
|||
|
"overflow_x": null,
|
|||
|
"overflow_y": null,
|
|||
|
"padding": null,
|
|||
|
"right": null,
|
|||
|
"top": null,
|
|||
|
"visibility": null,
|
|||
|
"width": null
|
|||
|
}
|
|||
|
},
|
|||
|
"e11f28d88a22465b97f31a8611583a76": {
|
|||
|
"model_module": "@jupyter-widgets/controls",
|
|||
|
"model_name": "FloatProgressModel",
|
|||
|
"state": {
|
|||
|
"_dom_classes": [],
|
|||
|
"_model_module": "@jupyter-widgets/controls",
|
|||
|
"_model_module_version": "1.5.0",
|
|||
|
"_model_name": "FloatProgressModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/controls",
|
|||
|
"_view_module_version": "1.5.0",
|
|||
|
"_view_name": "ProgressView",
|
|||
|
"bar_style": "info",
|
|||
|
"description": "",
|
|||
|
"description_tooltip": null,
|
|||
|
"layout": "IPY_MODEL_ec6aa5ffe76947d99d74fdc48f3bda87",
|
|||
|
"max": 1,
|
|||
|
"min": 0,
|
|||
|
"orientation": "horizontal",
|
|||
|
"style": "IPY_MODEL_a8251570eabf4c87a5f54837ccb2a0a0",
|
|||
|
"value": 1
|
|||
|
}
|
|||
|
},
|
|||
|
"8cef7279ec104ee5a45602603537ba92": {
|
|||
|
"model_module": "@jupyter-widgets/controls",
|
|||
|
"model_name": "HTMLModel",
|
|||
|
"state": {
|
|||
|
"_dom_classes": [],
|
|||
|
"_model_module": "@jupyter-widgets/controls",
|
|||
|
"_model_module_version": "1.5.0",
|
|||
|
"_model_name": "HTMLModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/controls",
|
|||
|
"_view_module_version": "1.5.0",
|
|||
|
"_view_name": "HTMLView",
|
|||
|
"description": "",
|
|||
|
"description_tooltip": null,
|
|||
|
"layout": "IPY_MODEL_4ebe7feaf19b463ea64c7ceb939392ae",
|
|||
|
"placeholder": "",
|
|||
|
"style": "IPY_MODEL_db11ed571583409992509c9177265bab",
|
|||
|
"value": " 26427392/? [00:20<00:00, 83478868.91it/s]"
|
|||
|
}
|
|||
|
},
|
|||
|
"a8251570eabf4c87a5f54837ccb2a0a0": {
|
|||
|
"model_module": "@jupyter-widgets/controls",
|
|||
|
"model_name": "ProgressStyleModel",
|
|||
|
"state": {
|
|||
|
"_model_module": "@jupyter-widgets/controls",
|
|||
|
"_model_module_version": "1.5.0",
|
|||
|
"_model_name": "ProgressStyleModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/base",
|
|||
|
"_view_module_version": "1.2.0",
|
|||
|
"_view_name": "StyleView",
|
|||
|
"bar_color": null,
|
|||
|
"description_width": "initial"
|
|||
|
}
|
|||
|
},
|
|||
|
"ec6aa5ffe76947d99d74fdc48f3bda87": {
|
|||
|
"model_module": "@jupyter-widgets/base",
|
|||
|
"model_name": "LayoutModel",
|
|||
|
"state": {
|
|||
|
"_model_module": "@jupyter-widgets/base",
|
|||
|
"_model_module_version": "1.2.0",
|
|||
|
"_model_name": "LayoutModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/base",
|
|||
|
"_view_module_version": "1.2.0",
|
|||
|
"_view_name": "LayoutView",
|
|||
|
"align_content": null,
|
|||
|
"align_items": null,
|
|||
|
"align_self": null,
|
|||
|
"border": null,
|
|||
|
"bottom": null,
|
|||
|
"display": null,
|
|||
|
"flex": null,
|
|||
|
"flex_flow": null,
|
|||
|
"grid_area": null,
|
|||
|
"grid_auto_columns": null,
|
|||
|
"grid_auto_flow": null,
|
|||
|
"grid_auto_rows": null,
|
|||
|
"grid_column": null,
|
|||
|
"grid_gap": null,
|
|||
|
"grid_row": null,
|
|||
|
"grid_template_areas": null,
|
|||
|
"grid_template_columns": null,
|
|||
|
"grid_template_rows": null,
|
|||
|
"height": null,
|
|||
|
"justify_content": null,
|
|||
|
"justify_items": null,
|
|||
|
"left": null,
|
|||
|
"margin": null,
|
|||
|
"max_height": null,
|
|||
|
"max_width": null,
|
|||
|
"min_height": null,
|
|||
|
"min_width": null,
|
|||
|
"object_fit": null,
|
|||
|
"object_position": null,
|
|||
|
"order": null,
|
|||
|
"overflow": null,
|
|||
|
"overflow_x": null,
|
|||
|
"overflow_y": null,
|
|||
|
"padding": null,
|
|||
|
"right": null,
|
|||
|
"top": null,
|
|||
|
"visibility": null,
|
|||
|
"width": null
|
|||
|
}
|
|||
|
},
|
|||
|
"db11ed571583409992509c9177265bab": {
|
|||
|
"model_module": "@jupyter-widgets/controls",
|
|||
|
"model_name": "DescriptionStyleModel",
|
|||
|
"state": {
|
|||
|
"_model_module": "@jupyter-widgets/controls",
|
|||
|
"_model_module_version": "1.5.0",
|
|||
|
"_model_name": "DescriptionStyleModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/base",
|
|||
|
"_view_module_version": "1.2.0",
|
|||
|
"_view_name": "StyleView",
|
|||
|
"description_width": ""
|
|||
|
}
|
|||
|
},
|
|||
|
"4ebe7feaf19b463ea64c7ceb939392ae": {
|
|||
|
"model_module": "@jupyter-widgets/base",
|
|||
|
"model_name": "LayoutModel",
|
|||
|
"state": {
|
|||
|
"_model_module": "@jupyter-widgets/base",
|
|||
|
"_model_module_version": "1.2.0",
|
|||
|
"_model_name": "LayoutModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/base",
|
|||
|
"_view_module_version": "1.2.0",
|
|||
|
"_view_name": "LayoutView",
|
|||
|
"align_content": null,
|
|||
|
"align_items": null,
|
|||
|
"align_self": null,
|
|||
|
"border": null,
|
|||
|
"bottom": null,
|
|||
|
"display": null,
|
|||
|
"flex": null,
|
|||
|
"flex_flow": null,
|
|||
|
"grid_area": null,
|
|||
|
"grid_auto_columns": null,
|
|||
|
"grid_auto_flow": null,
|
|||
|
"grid_auto_rows": null,
|
|||
|
"grid_column": null,
|
|||
|
"grid_gap": null,
|
|||
|
"grid_row": null,
|
|||
|
"grid_template_areas": null,
|
|||
|
"grid_template_columns": null,
|
|||
|
"grid_template_rows": null,
|
|||
|
"height": null,
|
|||
|
"justify_content": null,
|
|||
|
"justify_items": null,
|
|||
|
"left": null,
|
|||
|
"margin": null,
|
|||
|
"max_height": null,
|
|||
|
"max_width": null,
|
|||
|
"min_height": null,
|
|||
|
"min_width": null,
|
|||
|
"object_fit": null,
|
|||
|
"object_position": null,
|
|||
|
"order": null,
|
|||
|
"overflow": null,
|
|||
|
"overflow_x": null,
|
|||
|
"overflow_y": null,
|
|||
|
"padding": null,
|
|||
|
"right": null,
|
|||
|
"top": null,
|
|||
|
"visibility": null,
|
|||
|
"width": null
|
|||
|
}
|
|||
|
},
|
|||
|
"0afd0f24f0b84d01a1ac805461780038": {
|
|||
|
"model_module": "@jupyter-widgets/controls",
|
|||
|
"model_name": "HBoxModel",
|
|||
|
"state": {
|
|||
|
"_dom_classes": [],
|
|||
|
"_model_module": "@jupyter-widgets/controls",
|
|||
|
"_model_module_version": "1.5.0",
|
|||
|
"_model_name": "HBoxModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/controls",
|
|||
|
"_view_module_version": "1.5.0",
|
|||
|
"_view_name": "HBoxView",
|
|||
|
"box_style": "",
|
|||
|
"children": [
|
|||
|
"IPY_MODEL_8bfb0bf136954e508e49691710baea94",
|
|||
|
"IPY_MODEL_57ff7b0b5c5747498c7c251acfadba63"
|
|||
|
],
|
|||
|
"layout": "IPY_MODEL_9149b38ce9e24652a226bbb78c57158e"
|
|||
|
}
|
|||
|
},
|
|||
|
"9149b38ce9e24652a226bbb78c57158e": {
|
|||
|
"model_module": "@jupyter-widgets/base",
|
|||
|
"model_name": "LayoutModel",
|
|||
|
"state": {
|
|||
|
"_model_module": "@jupyter-widgets/base",
|
|||
|
"_model_module_version": "1.2.0",
|
|||
|
"_model_name": "LayoutModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/base",
|
|||
|
"_view_module_version": "1.2.0",
|
|||
|
"_view_name": "LayoutView",
|
|||
|
"align_content": null,
|
|||
|
"align_items": null,
|
|||
|
"align_self": null,
|
|||
|
"border": null,
|
|||
|
"bottom": null,
|
|||
|
"display": null,
|
|||
|
"flex": null,
|
|||
|
"flex_flow": null,
|
|||
|
"grid_area": null,
|
|||
|
"grid_auto_columns": null,
|
|||
|
"grid_auto_flow": null,
|
|||
|
"grid_auto_rows": null,
|
|||
|
"grid_column": null,
|
|||
|
"grid_gap": null,
|
|||
|
"grid_row": null,
|
|||
|
"grid_template_areas": null,
|
|||
|
"grid_template_columns": null,
|
|||
|
"grid_template_rows": null,
|
|||
|
"height": null,
|
|||
|
"justify_content": null,
|
|||
|
"justify_items": null,
|
|||
|
"left": null,
|
|||
|
"margin": null,
|
|||
|
"max_height": null,
|
|||
|
"max_width": null,
|
|||
|
"min_height": null,
|
|||
|
"min_width": null,
|
|||
|
"object_fit": null,
|
|||
|
"object_position": null,
|
|||
|
"order": null,
|
|||
|
"overflow": null,
|
|||
|
"overflow_x": null,
|
|||
|
"overflow_y": null,
|
|||
|
"padding": null,
|
|||
|
"right": null,
|
|||
|
"top": null,
|
|||
|
"visibility": null,
|
|||
|
"width": null
|
|||
|
}
|
|||
|
},
|
|||
|
"8bfb0bf136954e508e49691710baea94": {
|
|||
|
"model_module": "@jupyter-widgets/controls",
|
|||
|
"model_name": "FloatProgressModel",
|
|||
|
"state": {
|
|||
|
"_dom_classes": [],
|
|||
|
"_model_module": "@jupyter-widgets/controls",
|
|||
|
"_model_module_version": "1.5.0",
|
|||
|
"_model_name": "FloatProgressModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/controls",
|
|||
|
"_view_module_version": "1.5.0",
|
|||
|
"_view_name": "ProgressView",
|
|||
|
"bar_style": "success",
|
|||
|
"description": "",
|
|||
|
"description_tooltip": null,
|
|||
|
"layout": "IPY_MODEL_d2d7908b02104b53819195b4b38dc35b",
|
|||
|
"max": 1,
|
|||
|
"min": 0,
|
|||
|
"orientation": "horizontal",
|
|||
|
"style": "IPY_MODEL_4996fd9c0f29441285827db538683121",
|
|||
|
"value": 1
|
|||
|
}
|
|||
|
},
|
|||
|
"57ff7b0b5c5747498c7c251acfadba63": {
|
|||
|
"model_module": "@jupyter-widgets/controls",
|
|||
|
"model_name": "HTMLModel",
|
|||
|
"state": {
|
|||
|
"_dom_classes": [],
|
|||
|
"_model_module": "@jupyter-widgets/controls",
|
|||
|
"_model_module_version": "1.5.0",
|
|||
|
"_model_name": "HTMLModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/controls",
|
|||
|
"_view_module_version": "1.5.0",
|
|||
|
"_view_name": "HTMLView",
|
|||
|
"description": "",
|
|||
|
"description_tooltip": null,
|
|||
|
"layout": "IPY_MODEL_a0273ce565bb403eb1f180bb1c65782c",
|
|||
|
"placeholder": "",
|
|||
|
"style": "IPY_MODEL_7a36dd0db81146289a0014156aadc02f",
|
|||
|
"value": " 32768/? [00:00<00:00, 89204.95it/s]"
|
|||
|
}
|
|||
|
},
|
|||
|
"4996fd9c0f29441285827db538683121": {
|
|||
|
"model_module": "@jupyter-widgets/controls",
|
|||
|
"model_name": "ProgressStyleModel",
|
|||
|
"state": {
|
|||
|
"_model_module": "@jupyter-widgets/controls",
|
|||
|
"_model_module_version": "1.5.0",
|
|||
|
"_model_name": "ProgressStyleModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/base",
|
|||
|
"_view_module_version": "1.2.0",
|
|||
|
"_view_name": "StyleView",
|
|||
|
"bar_color": null,
|
|||
|
"description_width": "initial"
|
|||
|
}
|
|||
|
},
|
|||
|
"d2d7908b02104b53819195b4b38dc35b": {
|
|||
|
"model_module": "@jupyter-widgets/base",
|
|||
|
"model_name": "LayoutModel",
|
|||
|
"state": {
|
|||
|
"_model_module": "@jupyter-widgets/base",
|
|||
|
"_model_module_version": "1.2.0",
|
|||
|
"_model_name": "LayoutModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/base",
|
|||
|
"_view_module_version": "1.2.0",
|
|||
|
"_view_name": "LayoutView",
|
|||
|
"align_content": null,
|
|||
|
"align_items": null,
|
|||
|
"align_self": null,
|
|||
|
"border": null,
|
|||
|
"bottom": null,
|
|||
|
"display": null,
|
|||
|
"flex": null,
|
|||
|
"flex_flow": null,
|
|||
|
"grid_area": null,
|
|||
|
"grid_auto_columns": null,
|
|||
|
"grid_auto_flow": null,
|
|||
|
"grid_auto_rows": null,
|
|||
|
"grid_column": null,
|
|||
|
"grid_gap": null,
|
|||
|
"grid_row": null,
|
|||
|
"grid_template_areas": null,
|
|||
|
"grid_template_columns": null,
|
|||
|
"grid_template_rows": null,
|
|||
|
"height": null,
|
|||
|
"justify_content": null,
|
|||
|
"justify_items": null,
|
|||
|
"left": null,
|
|||
|
"margin": null,
|
|||
|
"max_height": null,
|
|||
|
"max_width": null,
|
|||
|
"min_height": null,
|
|||
|
"min_width": null,
|
|||
|
"object_fit": null,
|
|||
|
"object_position": null,
|
|||
|
"order": null,
|
|||
|
"overflow": null,
|
|||
|
"overflow_x": null,
|
|||
|
"overflow_y": null,
|
|||
|
"padding": null,
|
|||
|
"right": null,
|
|||
|
"top": null,
|
|||
|
"visibility": null,
|
|||
|
"width": null
|
|||
|
}
|
|||
|
},
|
|||
|
"7a36dd0db81146289a0014156aadc02f": {
|
|||
|
"model_module": "@jupyter-widgets/controls",
|
|||
|
"model_name": "DescriptionStyleModel",
|
|||
|
"state": {
|
|||
|
"_model_module": "@jupyter-widgets/controls",
|
|||
|
"_model_module_version": "1.5.0",
|
|||
|
"_model_name": "DescriptionStyleModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/base",
|
|||
|
"_view_module_version": "1.2.0",
|
|||
|
"_view_name": "StyleView",
|
|||
|
"description_width": ""
|
|||
|
}
|
|||
|
},
|
|||
|
"a0273ce565bb403eb1f180bb1c65782c": {
|
|||
|
"model_module": "@jupyter-widgets/base",
|
|||
|
"model_name": "LayoutModel",
|
|||
|
"state": {
|
|||
|
"_model_module": "@jupyter-widgets/base",
|
|||
|
"_model_module_version": "1.2.0",
|
|||
|
"_model_name": "LayoutModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/base",
|
|||
|
"_view_module_version": "1.2.0",
|
|||
|
"_view_name": "LayoutView",
|
|||
|
"align_content": null,
|
|||
|
"align_items": null,
|
|||
|
"align_self": null,
|
|||
|
"border": null,
|
|||
|
"bottom": null,
|
|||
|
"display": null,
|
|||
|
"flex": null,
|
|||
|
"flex_flow": null,
|
|||
|
"grid_area": null,
|
|||
|
"grid_auto_columns": null,
|
|||
|
"grid_auto_flow": null,
|
|||
|
"grid_auto_rows": null,
|
|||
|
"grid_column": null,
|
|||
|
"grid_gap": null,
|
|||
|
"grid_row": null,
|
|||
|
"grid_template_areas": null,
|
|||
|
"grid_template_columns": null,
|
|||
|
"grid_template_rows": null,
|
|||
|
"height": null,
|
|||
|
"justify_content": null,
|
|||
|
"justify_items": null,
|
|||
|
"left": null,
|
|||
|
"margin": null,
|
|||
|
"max_height": null,
|
|||
|
"max_width": null,
|
|||
|
"min_height": null,
|
|||
|
"min_width": null,
|
|||
|
"object_fit": null,
|
|||
|
"object_position": null,
|
|||
|
"order": null,
|
|||
|
"overflow": null,
|
|||
|
"overflow_x": null,
|
|||
|
"overflow_y": null,
|
|||
|
"padding": null,
|
|||
|
"right": null,
|
|||
|
"top": null,
|
|||
|
"visibility": null,
|
|||
|
"width": null
|
|||
|
}
|
|||
|
},
|
|||
|
"708bd6ef4ee14f8a81c3e0eea17dbb3b": {
|
|||
|
"model_module": "@jupyter-widgets/controls",
|
|||
|
"model_name": "HBoxModel",
|
|||
|
"state": {
|
|||
|
"_dom_classes": [],
|
|||
|
"_model_module": "@jupyter-widgets/controls",
|
|||
|
"_model_module_version": "1.5.0",
|
|||
|
"_model_name": "HBoxModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/controls",
|
|||
|
"_view_module_version": "1.5.0",
|
|||
|
"_view_name": "HBoxView",
|
|||
|
"box_style": "",
|
|||
|
"children": [
|
|||
|
"IPY_MODEL_10c602e87fa844deb169ce5400ac9992",
|
|||
|
"IPY_MODEL_09d4af85a8474de2a21402b585fcd0ea"
|
|||
|
],
|
|||
|
"layout": "IPY_MODEL_ebbc2338d4f44948adc9636383cab302"
|
|||
|
}
|
|||
|
},
|
|||
|
"ebbc2338d4f44948adc9636383cab302": {
|
|||
|
"model_module": "@jupyter-widgets/base",
|
|||
|
"model_name": "LayoutModel",
|
|||
|
"state": {
|
|||
|
"_model_module": "@jupyter-widgets/base",
|
|||
|
"_model_module_version": "1.2.0",
|
|||
|
"_model_name": "LayoutModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/base",
|
|||
|
"_view_module_version": "1.2.0",
|
|||
|
"_view_name": "LayoutView",
|
|||
|
"align_content": null,
|
|||
|
"align_items": null,
|
|||
|
"align_self": null,
|
|||
|
"border": null,
|
|||
|
"bottom": null,
|
|||
|
"display": null,
|
|||
|
"flex": null,
|
|||
|
"flex_flow": null,
|
|||
|
"grid_area": null,
|
|||
|
"grid_auto_columns": null,
|
|||
|
"grid_auto_flow": null,
|
|||
|
"grid_auto_rows": null,
|
|||
|
"grid_column": null,
|
|||
|
"grid_gap": null,
|
|||
|
"grid_row": null,
|
|||
|
"grid_template_areas": null,
|
|||
|
"grid_template_columns": null,
|
|||
|
"grid_template_rows": null,
|
|||
|
"height": null,
|
|||
|
"justify_content": null,
|
|||
|
"justify_items": null,
|
|||
|
"left": null,
|
|||
|
"margin": null,
|
|||
|
"max_height": null,
|
|||
|
"max_width": null,
|
|||
|
"min_height": null,
|
|||
|
"min_width": null,
|
|||
|
"object_fit": null,
|
|||
|
"object_position": null,
|
|||
|
"order": null,
|
|||
|
"overflow": null,
|
|||
|
"overflow_x": null,
|
|||
|
"overflow_y": null,
|
|||
|
"padding": null,
|
|||
|
"right": null,
|
|||
|
"top": null,
|
|||
|
"visibility": null,
|
|||
|
"width": null
|
|||
|
}
|
|||
|
},
|
|||
|
"10c602e87fa844deb169ce5400ac9992": {
|
|||
|
"model_module": "@jupyter-widgets/controls",
|
|||
|
"model_name": "FloatProgressModel",
|
|||
|
"state": {
|
|||
|
"_dom_classes": [],
|
|||
|
"_model_module": "@jupyter-widgets/controls",
|
|||
|
"_model_module_version": "1.5.0",
|
|||
|
"_model_name": "FloatProgressModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/controls",
|
|||
|
"_view_module_version": "1.5.0",
|
|||
|
"_view_name": "ProgressView",
|
|||
|
"bar_style": "success",
|
|||
|
"description": "",
|
|||
|
"description_tooltip": null,
|
|||
|
"layout": "IPY_MODEL_53beddf25c0d4373ba8335491af85fa5",
|
|||
|
"max": 1,
|
|||
|
"min": 0,
|
|||
|
"orientation": "horizontal",
|
|||
|
"style": "IPY_MODEL_fc3f7edb493b49db9eda12f9c45ff30a",
|
|||
|
"value": 1
|
|||
|
}
|
|||
|
},
|
|||
|
"09d4af85a8474de2a21402b585fcd0ea": {
|
|||
|
"model_module": "@jupyter-widgets/controls",
|
|||
|
"model_name": "HTMLModel",
|
|||
|
"state": {
|
|||
|
"_dom_classes": [],
|
|||
|
"_model_module": "@jupyter-widgets/controls",
|
|||
|
"_model_module_version": "1.5.0",
|
|||
|
"_model_name": "HTMLModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/controls",
|
|||
|
"_view_module_version": "1.5.0",
|
|||
|
"_view_name": "HTMLView",
|
|||
|
"description": "",
|
|||
|
"description_tooltip": null,
|
|||
|
"layout": "IPY_MODEL_ed4d32cfa18849f3b421fe4b9c433a96",
|
|||
|
"placeholder": "",
|
|||
|
"style": "IPY_MODEL_f23dccb7ae8d4e6bbde1b96394a044da",
|
|||
|
"value": " 4423680/? [00:00<00:00, 17006263.58it/s]"
|
|||
|
}
|
|||
|
},
|
|||
|
"fc3f7edb493b49db9eda12f9c45ff30a": {
|
|||
|
"model_module": "@jupyter-widgets/controls",
|
|||
|
"model_name": "ProgressStyleModel",
|
|||
|
"state": {
|
|||
|
"_model_module": "@jupyter-widgets/controls",
|
|||
|
"_model_module_version": "1.5.0",
|
|||
|
"_model_name": "ProgressStyleModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/base",
|
|||
|
"_view_module_version": "1.2.0",
|
|||
|
"_view_name": "StyleView",
|
|||
|
"bar_color": null,
|
|||
|
"description_width": "initial"
|
|||
|
}
|
|||
|
},
|
|||
|
"53beddf25c0d4373ba8335491af85fa5": {
|
|||
|
"model_module": "@jupyter-widgets/base",
|
|||
|
"model_name": "LayoutModel",
|
|||
|
"state": {
|
|||
|
"_model_module": "@jupyter-widgets/base",
|
|||
|
"_model_module_version": "1.2.0",
|
|||
|
"_model_name": "LayoutModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/base",
|
|||
|
"_view_module_version": "1.2.0",
|
|||
|
"_view_name": "LayoutView",
|
|||
|
"align_content": null,
|
|||
|
"align_items": null,
|
|||
|
"align_self": null,
|
|||
|
"border": null,
|
|||
|
"bottom": null,
|
|||
|
"display": null,
|
|||
|
"flex": null,
|
|||
|
"flex_flow": null,
|
|||
|
"grid_area": null,
|
|||
|
"grid_auto_columns": null,
|
|||
|
"grid_auto_flow": null,
|
|||
|
"grid_auto_rows": null,
|
|||
|
"grid_column": null,
|
|||
|
"grid_gap": null,
|
|||
|
"grid_row": null,
|
|||
|
"grid_template_areas": null,
|
|||
|
"grid_template_columns": null,
|
|||
|
"grid_template_rows": null,
|
|||
|
"height": null,
|
|||
|
"justify_content": null,
|
|||
|
"justify_items": null,
|
|||
|
"left": null,
|
|||
|
"margin": null,
|
|||
|
"max_height": null,
|
|||
|
"max_width": null,
|
|||
|
"min_height": null,
|
|||
|
"min_width": null,
|
|||
|
"object_fit": null,
|
|||
|
"object_position": null,
|
|||
|
"order": null,
|
|||
|
"overflow": null,
|
|||
|
"overflow_x": null,
|
|||
|
"overflow_y": null,
|
|||
|
"padding": null,
|
|||
|
"right": null,
|
|||
|
"top": null,
|
|||
|
"visibility": null,
|
|||
|
"width": null
|
|||
|
}
|
|||
|
},
|
|||
|
"f23dccb7ae8d4e6bbde1b96394a044da": {
|
|||
|
"model_module": "@jupyter-widgets/controls",
|
|||
|
"model_name": "DescriptionStyleModel",
|
|||
|
"state": {
|
|||
|
"_model_module": "@jupyter-widgets/controls",
|
|||
|
"_model_module_version": "1.5.0",
|
|||
|
"_model_name": "DescriptionStyleModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/base",
|
|||
|
"_view_module_version": "1.2.0",
|
|||
|
"_view_name": "StyleView",
|
|||
|
"description_width": ""
|
|||
|
}
|
|||
|
},
|
|||
|
"ed4d32cfa18849f3b421fe4b9c433a96": {
|
|||
|
"model_module": "@jupyter-widgets/base",
|
|||
|
"model_name": "LayoutModel",
|
|||
|
"state": {
|
|||
|
"_model_module": "@jupyter-widgets/base",
|
|||
|
"_model_module_version": "1.2.0",
|
|||
|
"_model_name": "LayoutModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/base",
|
|||
|
"_view_module_version": "1.2.0",
|
|||
|
"_view_name": "LayoutView",
|
|||
|
"align_content": null,
|
|||
|
"align_items": null,
|
|||
|
"align_self": null,
|
|||
|
"border": null,
|
|||
|
"bottom": null,
|
|||
|
"display": null,
|
|||
|
"flex": null,
|
|||
|
"flex_flow": null,
|
|||
|
"grid_area": null,
|
|||
|
"grid_auto_columns": null,
|
|||
|
"grid_auto_flow": null,
|
|||
|
"grid_auto_rows": null,
|
|||
|
"grid_column": null,
|
|||
|
"grid_gap": null,
|
|||
|
"grid_row": null,
|
|||
|
"grid_template_areas": null,
|
|||
|
"grid_template_columns": null,
|
|||
|
"grid_template_rows": null,
|
|||
|
"height": null,
|
|||
|
"justify_content": null,
|
|||
|
"justify_items": null,
|
|||
|
"left": null,
|
|||
|
"margin": null,
|
|||
|
"max_height": null,
|
|||
|
"max_width": null,
|
|||
|
"min_height": null,
|
|||
|
"min_width": null,
|
|||
|
"object_fit": null,
|
|||
|
"object_position": null,
|
|||
|
"order": null,
|
|||
|
"overflow": null,
|
|||
|
"overflow_x": null,
|
|||
|
"overflow_y": null,
|
|||
|
"padding": null,
|
|||
|
"right": null,
|
|||
|
"top": null,
|
|||
|
"visibility": null,
|
|||
|
"width": null
|
|||
|
}
|
|||
|
},
|
|||
|
"e7e20d5f7ded4155b5de7a59a5ddf43e": {
|
|||
|
"model_module": "@jupyter-widgets/controls",
|
|||
|
"model_name": "HBoxModel",
|
|||
|
"state": {
|
|||
|
"_dom_classes": [],
|
|||
|
"_model_module": "@jupyter-widgets/controls",
|
|||
|
"_model_module_version": "1.5.0",
|
|||
|
"_model_name": "HBoxModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/controls",
|
|||
|
"_view_module_version": "1.5.0",
|
|||
|
"_view_name": "HBoxView",
|
|||
|
"box_style": "",
|
|||
|
"children": [
|
|||
|
"IPY_MODEL_736b7a750d094ff487db2249615fa82a",
|
|||
|
"IPY_MODEL_378f2fb19c37421195f2b0c19ea1cf7f"
|
|||
|
],
|
|||
|
"layout": "IPY_MODEL_7aeec9531faa44d7bd95ff72fd63bb8b"
|
|||
|
}
|
|||
|
},
|
|||
|
"7aeec9531faa44d7bd95ff72fd63bb8b": {
|
|||
|
"model_module": "@jupyter-widgets/base",
|
|||
|
"model_name": "LayoutModel",
|
|||
|
"state": {
|
|||
|
"_model_module": "@jupyter-widgets/base",
|
|||
|
"_model_module_version": "1.2.0",
|
|||
|
"_model_name": "LayoutModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/base",
|
|||
|
"_view_module_version": "1.2.0",
|
|||
|
"_view_name": "LayoutView",
|
|||
|
"align_content": null,
|
|||
|
"align_items": null,
|
|||
|
"align_self": null,
|
|||
|
"border": null,
|
|||
|
"bottom": null,
|
|||
|
"display": null,
|
|||
|
"flex": null,
|
|||
|
"flex_flow": null,
|
|||
|
"grid_area": null,
|
|||
|
"grid_auto_columns": null,
|
|||
|
"grid_auto_flow": null,
|
|||
|
"grid_auto_rows": null,
|
|||
|
"grid_column": null,
|
|||
|
"grid_gap": null,
|
|||
|
"grid_row": null,
|
|||
|
"grid_template_areas": null,
|
|||
|
"grid_template_columns": null,
|
|||
|
"grid_template_rows": null,
|
|||
|
"height": null,
|
|||
|
"justify_content": null,
|
|||
|
"justify_items": null,
|
|||
|
"left": null,
|
|||
|
"margin": null,
|
|||
|
"max_height": null,
|
|||
|
"max_width": null,
|
|||
|
"min_height": null,
|
|||
|
"min_width": null,
|
|||
|
"object_fit": null,
|
|||
|
"object_position": null,
|
|||
|
"order": null,
|
|||
|
"overflow": null,
|
|||
|
"overflow_x": null,
|
|||
|
"overflow_y": null,
|
|||
|
"padding": null,
|
|||
|
"right": null,
|
|||
|
"top": null,
|
|||
|
"visibility": null,
|
|||
|
"width": null
|
|||
|
}
|
|||
|
},
|
|||
|
"736b7a750d094ff487db2249615fa82a": {
|
|||
|
"model_module": "@jupyter-widgets/controls",
|
|||
|
"model_name": "FloatProgressModel",
|
|||
|
"state": {
|
|||
|
"_dom_classes": [],
|
|||
|
"_model_module": "@jupyter-widgets/controls",
|
|||
|
"_model_module_version": "1.5.0",
|
|||
|
"_model_name": "FloatProgressModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/controls",
|
|||
|
"_view_module_version": "1.5.0",
|
|||
|
"_view_name": "ProgressView",
|
|||
|
"bar_style": "success",
|
|||
|
"description": "",
|
|||
|
"description_tooltip": null,
|
|||
|
"layout": "IPY_MODEL_ac086a6bcf274e91b8d506ea39490592",
|
|||
|
"max": 1,
|
|||
|
"min": 0,
|
|||
|
"orientation": "horizontal",
|
|||
|
"style": "IPY_MODEL_c6cf46d85249463caaf07823604e0ce3",
|
|||
|
"value": 1
|
|||
|
}
|
|||
|
},
|
|||
|
"378f2fb19c37421195f2b0c19ea1cf7f": {
|
|||
|
"model_module": "@jupyter-widgets/controls",
|
|||
|
"model_name": "HTMLModel",
|
|||
|
"state": {
|
|||
|
"_dom_classes": [],
|
|||
|
"_model_module": "@jupyter-widgets/controls",
|
|||
|
"_model_module_version": "1.5.0",
|
|||
|
"_model_name": "HTMLModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/controls",
|
|||
|
"_view_module_version": "1.5.0",
|
|||
|
"_view_name": "HTMLView",
|
|||
|
"description": "",
|
|||
|
"description_tooltip": null,
|
|||
|
"layout": "IPY_MODEL_abe78c8e154f4fe48ae2753e0f5fc9e7",
|
|||
|
"placeholder": "",
|
|||
|
"style": "IPY_MODEL_4e6caf9db2f345e9aa3a83d47d9d635c",
|
|||
|
"value": " 8192/? [00:00<00:00, 25459.14it/s]"
|
|||
|
}
|
|||
|
},
|
|||
|
"c6cf46d85249463caaf07823604e0ce3": {
|
|||
|
"model_module": "@jupyter-widgets/controls",
|
|||
|
"model_name": "ProgressStyleModel",
|
|||
|
"state": {
|
|||
|
"_model_module": "@jupyter-widgets/controls",
|
|||
|
"_model_module_version": "1.5.0",
|
|||
|
"_model_name": "ProgressStyleModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/base",
|
|||
|
"_view_module_version": "1.2.0",
|
|||
|
"_view_name": "StyleView",
|
|||
|
"bar_color": null,
|
|||
|
"description_width": "initial"
|
|||
|
}
|
|||
|
},
|
|||
|
"ac086a6bcf274e91b8d506ea39490592": {
|
|||
|
"model_module": "@jupyter-widgets/base",
|
|||
|
"model_name": "LayoutModel",
|
|||
|
"state": {
|
|||
|
"_model_module": "@jupyter-widgets/base",
|
|||
|
"_model_module_version": "1.2.0",
|
|||
|
"_model_name": "LayoutModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/base",
|
|||
|
"_view_module_version": "1.2.0",
|
|||
|
"_view_name": "LayoutView",
|
|||
|
"align_content": null,
|
|||
|
"align_items": null,
|
|||
|
"align_self": null,
|
|||
|
"border": null,
|
|||
|
"bottom": null,
|
|||
|
"display": null,
|
|||
|
"flex": null,
|
|||
|
"flex_flow": null,
|
|||
|
"grid_area": null,
|
|||
|
"grid_auto_columns": null,
|
|||
|
"grid_auto_flow": null,
|
|||
|
"grid_auto_rows": null,
|
|||
|
"grid_column": null,
|
|||
|
"grid_gap": null,
|
|||
|
"grid_row": null,
|
|||
|
"grid_template_areas": null,
|
|||
|
"grid_template_columns": null,
|
|||
|
"grid_template_rows": null,
|
|||
|
"height": null,
|
|||
|
"justify_content": null,
|
|||
|
"justify_items": null,
|
|||
|
"left": null,
|
|||
|
"margin": null,
|
|||
|
"max_height": null,
|
|||
|
"max_width": null,
|
|||
|
"min_height": null,
|
|||
|
"min_width": null,
|
|||
|
"object_fit": null,
|
|||
|
"object_position": null,
|
|||
|
"order": null,
|
|||
|
"overflow": null,
|
|||
|
"overflow_x": null,
|
|||
|
"overflow_y": null,
|
|||
|
"padding": null,
|
|||
|
"right": null,
|
|||
|
"top": null,
|
|||
|
"visibility": null,
|
|||
|
"width": null
|
|||
|
}
|
|||
|
},
|
|||
|
"4e6caf9db2f345e9aa3a83d47d9d635c": {
|
|||
|
"model_module": "@jupyter-widgets/controls",
|
|||
|
"model_name": "DescriptionStyleModel",
|
|||
|
"state": {
|
|||
|
"_model_module": "@jupyter-widgets/controls",
|
|||
|
"_model_module_version": "1.5.0",
|
|||
|
"_model_name": "DescriptionStyleModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/base",
|
|||
|
"_view_module_version": "1.2.0",
|
|||
|
"_view_name": "StyleView",
|
|||
|
"description_width": ""
|
|||
|
}
|
|||
|
},
|
|||
|
"abe78c8e154f4fe48ae2753e0f5fc9e7": {
|
|||
|
"model_module": "@jupyter-widgets/base",
|
|||
|
"model_name": "LayoutModel",
|
|||
|
"state": {
|
|||
|
"_model_module": "@jupyter-widgets/base",
|
|||
|
"_model_module_version": "1.2.0",
|
|||
|
"_model_name": "LayoutModel",
|
|||
|
"_view_count": null,
|
|||
|
"_view_module": "@jupyter-widgets/base",
|
|||
|
"_view_module_version": "1.2.0",
|
|||
|
"_view_name": "LayoutView",
|
|||
|
"align_content": null,
|
|||
|
"align_items": null,
|
|||
|
"align_self": null,
|
|||
|
"border": null,
|
|||
|
"bottom": null,
|
|||
|
"display": null,
|
|||
|
"flex": null,
|
|||
|
"flex_flow": null,
|
|||
|
"grid_area": null,
|
|||
|
"grid_auto_columns": null,
|
|||
|
"grid_auto_flow": null,
|
|||
|
"grid_auto_rows": null,
|
|||
|
"grid_column": null,
|
|||
|
"grid_gap": null,
|
|||
|
"grid_row": null,
|
|||
|
"grid_template_areas": null,
|
|||
|
"grid_template_columns": null,
|
|||
|
"grid_template_rows": null,
|
|||
|
"height": null,
|
|||
|
"justify_content": null,
|
|||
|
"justify_items": null,
|
|||
|
"left": null,
|
|||
|
"margin": null,
|
|||
|
"max_height": null,
|
|||
|
"max_width": null,
|
|||
|
"min_height": null,
|
|||
|
"min_width": null,
|
|||
|
"object_fit": null,
|
|||
|
"object_position": null,
|
|||
|
"order": null,
|
|||
|
"overflow": null,
|
|||
|
"overflow_x": null,
|
|||
|
"overflow_y": null,
|
|||
|
"padding": null,
|
|||
|
"right": null,
|
|||
|
"top": null,
|
|||
|
"visibility": null,
|
|||
|
"width": null
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
},
|
|||
|
"cells": [
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"metadata": {
|
|||
|
"id": "view-in-github",
|
|||
|
"colab_type": "text"
|
|||
|
},
|
|||
|
"source": [
|
|||
|
"<a href=\"https://colab.research.google.com/github/PacktPublishing/Hands-On-Computer-Vision-with-PyTorch/blob/master/Chapter03/Varying_loss_optimizer.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"metadata": {
|
|||
|
"id": "-CiYe82L4gom",
|
|||
|
"outputId": "7238ae25-5422-41bf-9101-8c42777ebb3e",
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/",
|
|||
|
"height": 437,
|
|||
|
"referenced_widgets": [
|
|||
|
"555f8075b30344ffad1a09752ac88ea1",
|
|||
|
"40a4dc115817415fb0f956ab8343921c",
|
|||
|
"e11f28d88a22465b97f31a8611583a76",
|
|||
|
"8cef7279ec104ee5a45602603537ba92",
|
|||
|
"a8251570eabf4c87a5f54837ccb2a0a0",
|
|||
|
"ec6aa5ffe76947d99d74fdc48f3bda87",
|
|||
|
"db11ed571583409992509c9177265bab",
|
|||
|
"4ebe7feaf19b463ea64c7ceb939392ae",
|
|||
|
"0afd0f24f0b84d01a1ac805461780038",
|
|||
|
"9149b38ce9e24652a226bbb78c57158e",
|
|||
|
"8bfb0bf136954e508e49691710baea94",
|
|||
|
"57ff7b0b5c5747498c7c251acfadba63",
|
|||
|
"4996fd9c0f29441285827db538683121",
|
|||
|
"d2d7908b02104b53819195b4b38dc35b",
|
|||
|
"7a36dd0db81146289a0014156aadc02f",
|
|||
|
"a0273ce565bb403eb1f180bb1c65782c",
|
|||
|
"708bd6ef4ee14f8a81c3e0eea17dbb3b",
|
|||
|
"ebbc2338d4f44948adc9636383cab302",
|
|||
|
"10c602e87fa844deb169ce5400ac9992",
|
|||
|
"09d4af85a8474de2a21402b585fcd0ea",
|
|||
|
"fc3f7edb493b49db9eda12f9c45ff30a",
|
|||
|
"53beddf25c0d4373ba8335491af85fa5",
|
|||
|
"f23dccb7ae8d4e6bbde1b96394a044da",
|
|||
|
"ed4d32cfa18849f3b421fe4b9c433a96",
|
|||
|
"e7e20d5f7ded4155b5de7a59a5ddf43e",
|
|||
|
"7aeec9531faa44d7bd95ff72fd63bb8b",
|
|||
|
"736b7a750d094ff487db2249615fa82a",
|
|||
|
"378f2fb19c37421195f2b0c19ea1cf7f",
|
|||
|
"c6cf46d85249463caaf07823604e0ce3",
|
|||
|
"ac086a6bcf274e91b8d506ea39490592",
|
|||
|
"4e6caf9db2f345e9aa3a83d47d9d635c",
|
|||
|
"abe78c8e154f4fe48ae2753e0f5fc9e7"
|
|||
|
]
|
|||
|
}
|
|||
|
},
|
|||
|
"source": [
|
|||
|
"from torchvision import datasets\n",
|
|||
|
"import torch\n",
|
|||
|
"data_folder = '~/data/FMNIST' # This can be any directory you want to \n",
|
|||
|
"# download FMNIST to\n",
|
|||
|
"fmnist = datasets.FashionMNIST(data_folder, download=True, train=True)\n",
|
|||
|
"tr_images = fmnist.data\n",
|
|||
|
"tr_targets = fmnist.targets"
|
|||
|
],
|
|||
|
"execution_count": null,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Downloading http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/train-images-idx3-ubyte.gz to /root/data/FMNIST/FashionMNIST/raw/train-images-idx3-ubyte.gz\n"
|
|||
|
],
|
|||
|
"name": "stdout"
|
|||
|
},
|
|||
|
{
|
|||
|
"output_type": "display_data",
|
|||
|
"data": {
|
|||
|
"application/vnd.jupyter.widget-view+json": {
|
|||
|
"model_id": "555f8075b30344ffad1a09752ac88ea1",
|
|||
|
"version_major": 2,
|
|||
|
"version_minor": 0
|
|||
|
},
|
|||
|
"text/plain": [
|
|||
|
"HBox(children=(FloatProgress(value=1.0, bar_style='info', max=1.0), HTML(value='')))"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {
|
|||
|
"tags": []
|
|||
|
}
|
|||
|
},
|
|||
|
{
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Extracting /root/data/FMNIST/FashionMNIST/raw/train-images-idx3-ubyte.gz to /root/data/FMNIST/FashionMNIST/raw\n",
|
|||
|
"Downloading http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/train-labels-idx1-ubyte.gz to /root/data/FMNIST/FashionMNIST/raw/train-labels-idx1-ubyte.gz\n"
|
|||
|
],
|
|||
|
"name": "stdout"
|
|||
|
},
|
|||
|
{
|
|||
|
"output_type": "display_data",
|
|||
|
"data": {
|
|||
|
"application/vnd.jupyter.widget-view+json": {
|
|||
|
"model_id": "0afd0f24f0b84d01a1ac805461780038",
|
|||
|
"version_major": 2,
|
|||
|
"version_minor": 0
|
|||
|
},
|
|||
|
"text/plain": [
|
|||
|
"HBox(children=(FloatProgress(value=1.0, bar_style='info', max=1.0), HTML(value='')))"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {
|
|||
|
"tags": []
|
|||
|
}
|
|||
|
},
|
|||
|
{
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Extracting /root/data/FMNIST/FashionMNIST/raw/train-labels-idx1-ubyte.gz to /root/data/FMNIST/FashionMNIST/raw\n",
|
|||
|
"Downloading http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/t10k-images-idx3-ubyte.gz to /root/data/FMNIST/FashionMNIST/raw/t10k-images-idx3-ubyte.gz\n"
|
|||
|
],
|
|||
|
"name": "stdout"
|
|||
|
},
|
|||
|
{
|
|||
|
"output_type": "display_data",
|
|||
|
"data": {
|
|||
|
"application/vnd.jupyter.widget-view+json": {
|
|||
|
"model_id": "708bd6ef4ee14f8a81c3e0eea17dbb3b",
|
|||
|
"version_major": 2,
|
|||
|
"version_minor": 0
|
|||
|
},
|
|||
|
"text/plain": [
|
|||
|
"HBox(children=(FloatProgress(value=1.0, bar_style='info', max=1.0), HTML(value='')))"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {
|
|||
|
"tags": []
|
|||
|
}
|
|||
|
},
|
|||
|
{
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Extracting /root/data/FMNIST/FashionMNIST/raw/t10k-images-idx3-ubyte.gz to /root/data/FMNIST/FashionMNIST/raw\n",
|
|||
|
"Downloading http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/t10k-labels-idx1-ubyte.gz to /root/data/FMNIST/FashionMNIST/raw/t10k-labels-idx1-ubyte.gz\n",
|
|||
|
"\n",
|
|||
|
"\n"
|
|||
|
],
|
|||
|
"name": "stdout"
|
|||
|
},
|
|||
|
{
|
|||
|
"output_type": "display_data",
|
|||
|
"data": {
|
|||
|
"application/vnd.jupyter.widget-view+json": {
|
|||
|
"model_id": "e7e20d5f7ded4155b5de7a59a5ddf43e",
|
|||
|
"version_major": 2,
|
|||
|
"version_minor": 0
|
|||
|
},
|
|||
|
"text/plain": [
|
|||
|
"HBox(children=(FloatProgress(value=1.0, bar_style='info', max=1.0), HTML(value='')))"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {
|
|||
|
"tags": []
|
|||
|
}
|
|||
|
},
|
|||
|
{
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Extracting /root/data/FMNIST/FashionMNIST/raw/t10k-labels-idx1-ubyte.gz to /root/data/FMNIST/FashionMNIST/raw\n",
|
|||
|
"Processing...\n",
|
|||
|
"Done!\n",
|
|||
|
"\n"
|
|||
|
],
|
|||
|
"name": "stdout"
|
|||
|
},
|
|||
|
{
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"/usr/local/lib/python3.6/dist-packages/torchvision/datasets/mnist.py:469: UserWarning: The given NumPy array is not writeable, and PyTorch does not support non-writeable tensors. This means you can write to the underlying (supposedly non-writeable) NumPy array using the tensor. You may want to copy the array to protect its data or make it writeable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at /pytorch/torch/csrc/utils/tensor_numpy.cpp:141.)\n",
|
|||
|
" return torch.from_numpy(parsed.astype(m[2], copy=False)).view(*s)\n"
|
|||
|
],
|
|||
|
"name": "stderr"
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"metadata": {
|
|||
|
"id": "53UbSwV44pKN"
|
|||
|
},
|
|||
|
"source": [
|
|||
|
"val_fmnist = datasets.FashionMNIST(data_folder, download=True, train=False)\n",
|
|||
|
"val_images = val_fmnist.data\n",
|
|||
|
"val_targets = val_fmnist.targets"
|
|||
|
],
|
|||
|
"execution_count": null,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"metadata": {
|
|||
|
"id": "hLjiLWl24qjU"
|
|||
|
},
|
|||
|
"source": [
|
|||
|
"import matplotlib.pyplot as plt\n",
|
|||
|
"%matplotlib inline\n",
|
|||
|
"import numpy as np\n",
|
|||
|
"from torch.utils.data import Dataset, DataLoader\n",
|
|||
|
"import torch\n",
|
|||
|
"import torch.nn as nn\n",
|
|||
|
"device = 'cuda' if torch.cuda.is_available() else 'cpu'"
|
|||
|
],
|
|||
|
"execution_count": null,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"metadata": {
|
|||
|
"id": "r9CEfaWfxCAZ"
|
|||
|
},
|
|||
|
"source": [
|
|||
|
"### SGD optimizer"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"metadata": {
|
|||
|
"id": "5brrbtrf4rsb"
|
|||
|
},
|
|||
|
"source": [
|
|||
|
"class FMNISTDataset(Dataset):\n",
|
|||
|
" def __init__(self, x, y):\n",
|
|||
|
" x = x.float()/255\n",
|
|||
|
" x = x.view(-1,28*28)\n",
|
|||
|
" self.x, self.y = x, y \n",
|
|||
|
" def __getitem__(self, ix):\n",
|
|||
|
" x, y = self.x[ix], self.y[ix] \n",
|
|||
|
" return x.to(device), y.to(device)\n",
|
|||
|
" def __len__(self): \n",
|
|||
|
" return len(self.x)\n",
|
|||
|
"\n",
|
|||
|
"from torch.optim import SGD, Adam\n",
|
|||
|
"def get_model():\n",
|
|||
|
" model = nn.Sequential(\n",
|
|||
|
" nn.Linear(28 * 28, 1000),\n",
|
|||
|
" nn.ReLU(),\n",
|
|||
|
" nn.Linear(1000, 10)\n",
|
|||
|
" ).to(device)\n",
|
|||
|
"\n",
|
|||
|
" loss_fn = nn.CrossEntropyLoss()\n",
|
|||
|
" optimizer = SGD(model.parameters(), lr=1e-2)\n",
|
|||
|
" return model, loss_fn, optimizer\n",
|
|||
|
"\n",
|
|||
|
"def train_batch(x, y, model, opt, loss_fn):\n",
|
|||
|
" model.train()\n",
|
|||
|
" prediction = model(x)\n",
|
|||
|
" batch_loss = loss_fn(prediction, y)\n",
|
|||
|
" batch_loss.backward()\n",
|
|||
|
" optimizer.step()\n",
|
|||
|
" optimizer.zero_grad()\n",
|
|||
|
" return batch_loss.item()\n",
|
|||
|
"\n",
|
|||
|
"def accuracy(x, y, model):\n",
|
|||
|
" model.eval()\n",
|
|||
|
" # this is the same as @torch.no_grad \n",
|
|||
|
" # at the top of function, only difference\n",
|
|||
|
" # being, grad is not computed in the with scope\n",
|
|||
|
" with torch.no_grad():\n",
|
|||
|
" prediction = model(x)\n",
|
|||
|
" max_values, argmaxes = prediction.max(-1)\n",
|
|||
|
" is_correct = argmaxes == y\n",
|
|||
|
" return is_correct.cpu().numpy().tolist()"
|
|||
|
],
|
|||
|
"execution_count": null,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"metadata": {
|
|||
|
"id": "Ipn9JZfJ4yVl"
|
|||
|
},
|
|||
|
"source": [
|
|||
|
"def get_data(): \n",
|
|||
|
" train = FMNISTDataset(tr_images, tr_targets) \n",
|
|||
|
" trn_dl = DataLoader(train, batch_size=32, shuffle=True)\n",
|
|||
|
" val = FMNISTDataset(val_images, val_targets) \n",
|
|||
|
" val_dl = DataLoader(val, batch_size=len(val_images), shuffle=False)\n",
|
|||
|
" return trn_dl, val_dl"
|
|||
|
],
|
|||
|
"execution_count": null,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"metadata": {
|
|||
|
"id": "q44UDG_q41Up"
|
|||
|
},
|
|||
|
"source": [
|
|||
|
"@torch.no_grad()\n",
|
|||
|
"def val_loss(x, y, model):\n",
|
|||
|
" prediction = model(x)\n",
|
|||
|
" val_loss = loss_fn(prediction, y)\n",
|
|||
|
" return val_loss.item()"
|
|||
|
],
|
|||
|
"execution_count": null,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"metadata": {
|
|||
|
"id": "mK19mnET42it"
|
|||
|
},
|
|||
|
"source": [
|
|||
|
"trn_dl, val_dl = get_data()\n",
|
|||
|
"model, loss_fn, optimizer = get_model()"
|
|||
|
],
|
|||
|
"execution_count": null,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"metadata": {
|
|||
|
"id": "TVtikJsV43mD",
|
|||
|
"outputId": "f2c6ca32-5347-4062-a57f-ba50f7b74662",
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/",
|
|||
|
"height": 199
|
|||
|
}
|
|||
|
},
|
|||
|
"source": [
|
|||
|
"train_losses, train_accuracies = [], []\n",
|
|||
|
"val_losses, val_accuracies = [], []\n",
|
|||
|
"for epoch in range(10):\n",
|
|||
|
" print(epoch)\n",
|
|||
|
" train_epoch_losses, train_epoch_accuracies = [], []\n",
|
|||
|
" for ix, batch in enumerate(iter(trn_dl)):\n",
|
|||
|
" x, y = batch\n",
|
|||
|
" batch_loss = train_batch(x, y, model, optimizer, loss_fn)\n",
|
|||
|
" train_epoch_losses.append(batch_loss) \n",
|
|||
|
" train_epoch_loss = np.array(train_epoch_losses).mean()\n",
|
|||
|
"\n",
|
|||
|
" for ix, batch in enumerate(iter(trn_dl)):\n",
|
|||
|
" x, y = batch\n",
|
|||
|
" is_correct = accuracy(x, y, model)\n",
|
|||
|
" train_epoch_accuracies.extend(is_correct)\n",
|
|||
|
" train_epoch_accuracy = np.mean(train_epoch_accuracies)\n",
|
|||
|
" for ix, batch in enumerate(iter(val_dl)):\n",
|
|||
|
" x, y = batch\n",
|
|||
|
" val_is_correct = accuracy(x, y, model)\n",
|
|||
|
" validation_loss = val_loss(x, y, model)\n",
|
|||
|
" val_epoch_accuracy = np.mean(val_is_correct)\n",
|
|||
|
" train_losses.append(train_epoch_loss)\n",
|
|||
|
" train_accuracies.append(train_epoch_accuracy)\n",
|
|||
|
" val_losses.append(validation_loss)\n",
|
|||
|
" val_accuracies.append(val_epoch_accuracy)"
|
|||
|
],
|
|||
|
"execution_count": null,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"0\n",
|
|||
|
"1\n",
|
|||
|
"2\n",
|
|||
|
"3\n",
|
|||
|
"4\n",
|
|||
|
"5\n",
|
|||
|
"6\n",
|
|||
|
"7\n",
|
|||
|
"8\n",
|
|||
|
"9\n"
|
|||
|
],
|
|||
|
"name": "stdout"
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"metadata": {
|
|||
|
"id": "X8qZ13F3452Y",
|
|||
|
"outputId": "17ff2d4a-2679-49a8-f03f-0f6b0d02e702",
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/",
|
|||
|
"height": 337
|
|||
|
}
|
|||
|
},
|
|||
|
"source": [
|
|||
|
"epochs = np.arange(10)+1\n",
|
|||
|
"import matplotlib.ticker as mtick\n",
|
|||
|
"import matplotlib.pyplot as plt\n",
|
|||
|
"import matplotlib.ticker as mticker\n",
|
|||
|
"%matplotlib inline\n",
|
|||
|
"plt.subplot(211)\n",
|
|||
|
"plt.plot(epochs, train_losses, 'bo', label='Training loss')\n",
|
|||
|
"plt.plot(epochs, val_losses, 'r', label='Validation loss')\n",
|
|||
|
"plt.gca().xaxis.set_major_locator(mticker.MultipleLocator(1))\n",
|
|||
|
"plt.title('Training and validation loss with SGD optimizer')\n",
|
|||
|
"plt.xlabel('Epochs')\n",
|
|||
|
"plt.ylabel('Loss')\n",
|
|||
|
"plt.legend()\n",
|
|||
|
"plt.grid('off')\n",
|
|||
|
"plt.show()\n",
|
|||
|
"plt.subplot(212)\n",
|
|||
|
"plt.plot(epochs, train_accuracies, 'bo', label='Training accuracy')\n",
|
|||
|
"plt.plot(epochs, val_accuracies, 'r', label='Validation accuracy')\n",
|
|||
|
"plt.gca().xaxis.set_major_locator(mticker.MultipleLocator(1))\n",
|
|||
|
"plt.title('Training and validation accuracy with SGD optimizer')\n",
|
|||
|
"plt.xlabel('Epochs')\n",
|
|||
|
"plt.ylabel('Accuracy')\n",
|
|||
|
"plt.gca().set_yticklabels(['{:.0f}%'.format(x*100) for x in plt.gca().get_yticks()]) \n",
|
|||
|
"plt.legend()\n",
|
|||
|
"plt.grid('off')\n",
|
|||
|
"plt.show()"
|
|||
|
],
|
|||
|
"execution_count": null,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "display_data",
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAACgCAYAAAAB6WsAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO2deXhV1bn/Py9JJCSBKERRmQIKWJAhBEREEBSvWCmOVSlX5DpCnbV1KK1Qvdzqr9RrrdpbHNAqimgr1YLVKgS0qBUQUSYZDDGKMiiSGAIJvL8/1j5h5+Sc5GQ4Qzjv53n2c/aw9lrfPZz93WvYa4mqYhiGYSQvLeItwDAMw4gvZgSGYRhJjhmBYRhGkmNGYBiGkeSYERiGYSQ5ZgSGYRhJjhlBlBGR10Tk8qYOG09EpFBERkUhXhWR4735/xORX0UStgHpjBeRNxqqs5Z4R4hIcVPH2xhEpLOIlIpISi1hGnwumyveOenWwH1Xi8iIJpYUV8wIQuDdJIHpgIjs8S2Pr09cqnq2qj7d1GEPdVR1kqre29h4RCTXe9Cl+uKerar/0di4mwOqWqSqWaq6H0BECkTkqobGJyKHi8iTIvKViJSIyKcicqdvu4jI9SKySkTKvHAFInKpL0yBiJR7++8WkeUicqeItGzc0YbVXOOYvXOyuSHxqWpvVS1oEnEJghlBCLybJEtVs4Ai4Ee+dbMD4fwPF8NIEv4XyAJ+AGQDY4GNvu0PATcDtwHtgA7AL4HRQfFcr6qtgWO8sJcCC0REoqo+AUmI54iq2lTLBBQCo7z5EUAxcAfwFfAMcATwd2A78K0339G3fwFwlTc/EXgHmOGF/Qw4u4FhuwJLgBLgTeAR4NkwxxCJxnuBf3nxvQHk+LZfBmwBdgJT/OckKJ3B3nlJ8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"tags": [],
|
|||
|
"needs_background": "light"
|
|||
|
}
|
|||
|
},
|
|||
|
{
|
|||
|
"output_type": "display_data",
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAACgCAYAAAAWy/vJAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO2dd3yV1f3H31/CCAFkg7ISqAIVIZAwFKWA4LYIqAxRQevAVhF/raN1VsVqpa622roXihOcqGUpispQHCCoaMDIkJUFJGR8f3+c54aby73Jzbgj5Pt+vZ7XfcY55/k8457vc75niapiGIZhGIHUi7UAwzAMIz4xA2EYhmEExQyEYRiGERQzEIZhGEZQzEAYhmEYQTEDYRiGYQTFDEQ1EJF5IjK5psPGEhHJEJGREUhXReRwb/0/InJjOGGrcJ5JIvJeVXUa4SEiQ0RkXTnHU7znWD+aumKJiHQRkTwRSahi/DwR6VbTuqpDnTMQ3kPwLSUistdve1Jl0lLVU1T1qZoOe7CjqlNV9bbqphMsE1LVWap6YnXTNspHVZeoag/fdnU/LESkk4i8IiLbRSRbRL4WkSl+xxuKyE0isk5EdovIz95H14l+YTK8/3OuiGSJyFIRmSoiEcnnAq9ZVTeqalNVLa5Kel7cH2pOYfWpM9bdh6o29a2LSAZwkarODwwnIvVVtSia2gwjFHXgfXwG+AJIBgqA3sChfsdfBjoC5wOfe/uOB04D/EuMv1XV+SLSHBgK3A8MAi6IqPo4pEbeGVWtswuQAYz01ocBmcC1wBbcC9sSeBPYBuzy1jv5xV+MMzAAU4APgZle2B+BU6oYtivwAZALzAf+DTwb4hrC0Xgb8JGX3ntAG7/j5wEbgB3A9f73JOA8g7z7kuC3bwzwpbc+EPgYyAI2A/8CGvqFVeBwb/1J4Ha/Y1d7cTYBFwaEPQ2XIeQAPwG3+MXb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Gkpw7rp7RKSDV9o4xivt4RmEEpybI2jpwY/3gctxpSRwrpLLca67UE04txL6OVSIiNwlIkd5z6kZ7v35XlV3qOp7wCJciWKQ979oABxdTnqHiMjpON/9s6r6VWAYL+NdCvxNRBJFpA+uUcCzfsHSRWSsuKbU03H3/5OauObytAOv4dxTgYbtP8CfRaSXF7a5iJxd0xp8mIEon/twrUC2416Kd6J03km4it4dOL//C7gXMxhV1qiqq3EtHp7DfcnvwhWhy+N5nKthofel5+NPuMw7F3jE0xyOhnneNSzEtSJZGBDk98CtIpKLqzN50S/uHmAG8JFX5C6TYajqDuB03Nf/Dlyl7ekBusOlovt8HlCIK0X9gstMUFdJegGu0jobl/n6SjU3st/n/1fKlsiC8TSuBPczsIb9GZWPPwFf4VrH7ATuoux//Glc89FnKZ/3ccbIZyA+xBmkD0LGcL77G7znEKqivzyScJWxWbiK8WRglN/xMTjD/qwX5kfc/+Skssnwhveu/IRrlXcP5TdxnYgriW3yzn+zlm32/howHveMzgPGqmqhd6y61xyKNFxp9V7x67cFoKpzcM91tudm/BpXoo8I4lVsGHGMiLwArFXViJdgjIMXETkfuERVj4u1ltqAiNyCqzQ+t6KwBytWgohDRGSAiPzKc0mcjPM7z421LqP24rnvfg88HGstRu3BDER8cijO75uHa8N/map+Xm4MwwiBiJyEq6/ZSsVuLMMoxVxMhmEYRlCsBGEYhmEExQyEYRiGEZSDZjTXNm3aaEpKSpXi7t69myZNmtSsINNhOg5CHfGgwXTUrI6VK1duV9W2QQ/W1JgdsV7S09O1qixatKjKcWsS01EW01GWeNARDxpUTYePZ59VTU5WFSnR5GS3XVmAF
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 432x288 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {
|
|||
|
"tags": [],
|
|||
|
"needs_background": "light"
|
|||
|
}
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"metadata": {
|
|||
|
"id": "Bsv-ldC65IYQ"
|
|||
|
},
|
|||
|
"source": [
|
|||
|
""
|
|||
|
],
|
|||
|
"execution_count": null,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"metadata": {
|
|||
|
"id": "-kDtEW1q5cAn"
|
|||
|
},
|
|||
|
"source": [
|
|||
|
""
|
|||
|
],
|
|||
|
"execution_count": null,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"metadata": {
|
|||
|
"id": "sfeSNp305eB4"
|
|||
|
},
|
|||
|
"source": [
|
|||
|
"### Adam optimizer"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"metadata": {
|
|||
|
"id": "S1iUHZf15cDA"
|
|||
|
},
|
|||
|
"source": [
|
|||
|
"from torch.optim import SGD, Adam\n",
|
|||
|
"def get_model():\n",
|
|||
|
" model = nn.Sequential(\n",
|
|||
|
" nn.Linear(28 * 28, 1000),\n",
|
|||
|
" nn.ReLU(),\n",
|
|||
|
" nn.Linear(1000, 10)\n",
|
|||
|
" ).to(device)\n",
|
|||
|
"\n",
|
|||
|
" loss_fn = nn.CrossEntropyLoss()\n",
|
|||
|
" optimizer = Adam(model.parameters(), lr=1e-2)\n",
|
|||
|
" return model, loss_fn, optimizer"
|
|||
|
],
|
|||
|
"execution_count": null,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"metadata": {
|
|||
|
"id": "vy7zpicT5cGw"
|
|||
|
},
|
|||
|
"source": [
|
|||
|
"trn_dl, val_dl = get_data()\n",
|
|||
|
"model, loss_fn, optimizer = get_model()"
|
|||
|
],
|
|||
|
"execution_count": null,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"metadata": {
|
|||
|
"id": "s86zqzoO5k5s",
|
|||
|
"outputId": "22c0e4a3-43a8-4ed4-bc5d-8c9e166e4a30",
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/",
|
|||
|
"height": 199
|
|||
|
}
|
|||
|
},
|
|||
|
"source": [
|
|||
|
"train_losses, train_accuracies = [], []\n",
|
|||
|
"val_losses, val_accuracies = [], []\n",
|
|||
|
"for epoch in range(10):\n",
|
|||
|
" print(epoch)\n",
|
|||
|
" train_epoch_losses, train_epoch_accuracies = [], []\n",
|
|||
|
" for ix, batch in enumerate(iter(trn_dl)):\n",
|
|||
|
" x, y = batch\n",
|
|||
|
" batch_loss = train_batch(x, y, model, optimizer, loss_fn)\n",
|
|||
|
" train_epoch_losses.append(batch_loss) \n",
|
|||
|
" train_epoch_loss = np.array(train_epoch_losses).mean()\n",
|
|||
|
"\n",
|
|||
|
" for ix, batch in enumerate(iter(trn_dl)):\n",
|
|||
|
" x, y = batch\n",
|
|||
|
" is_correct = accuracy(x, y, model)\n",
|
|||
|
" train_epoch_accuracies.extend(is_correct)\n",
|
|||
|
" train_epoch_accuracy = np.mean(train_epoch_accuracies)\n",
|
|||
|
" for ix, batch in enumerate(iter(val_dl)):\n",
|
|||
|
" x, y = batch\n",
|
|||
|
" val_is_correct = accuracy(x, y, model)\n",
|
|||
|
" validation_loss = val_loss(x, y, model)\n",
|
|||
|
" val_epoch_accuracy = np.mean(val_is_correct)\n",
|
|||
|
" train_losses.append(train_epoch_loss)\n",
|
|||
|
" train_accuracies.append(train_epoch_accuracy)\n",
|
|||
|
" val_losses.append(validation_loss)\n",
|
|||
|
" val_accuracies.append(val_epoch_accuracy)"
|
|||
|
],
|
|||
|
"execution_count": null,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"0\n",
|
|||
|
"1\n",
|
|||
|
"2\n",
|
|||
|
"3\n",
|
|||
|
"4\n",
|
|||
|
"5\n",
|
|||
|
"6\n",
|
|||
|
"7\n",
|
|||
|
"8\n",
|
|||
|
"9\n"
|
|||
|
],
|
|||
|
"name": "stdout"
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"metadata": {
|
|||
|
"id": "7MBiwBMq5mop",
|
|||
|
"outputId": "91134f0f-dbcc-4212-de17-c6198f0b3ab9",
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/",
|
|||
|
"height": 337
|
|||
|
}
|
|||
|
},
|
|||
|
"source": [
|
|||
|
"epochs = np.arange(10)+1\n",
|
|||
|
"import matplotlib.ticker as mtick\n",
|
|||
|
"import matplotlib.pyplot as plt\n",
|
|||
|
"import matplotlib.ticker as mticker\n",
|
|||
|
"%matplotlib inline\n",
|
|||
|
"plt.subplot(211)\n",
|
|||
|
"plt.plot(epochs, train_losses, 'bo', label='Training loss')\n",
|
|||
|
"plt.plot(epochs, val_losses, 'r', label='Validation loss')\n",
|
|||
|
"plt.gca().xaxis.set_major_locator(mticker.MultipleLocator(1))\n",
|
|||
|
"plt.title('Training and validation loss with Adam optimizer')\n",
|
|||
|
"plt.xlabel('Epochs')\n",
|
|||
|
"plt.ylabel('Loss')\n",
|
|||
|
"plt.legend()\n",
|
|||
|
"plt.grid('off')\n",
|
|||
|
"plt.show()\n",
|
|||
|
"plt.subplot(212)\n",
|
|||
|
"plt.plot(epochs, train_accuracies, 'bo', label='Training accuracy')\n",
|
|||
|
"plt.plot(epochs, val_accuracies, 'r', label='Validation accuracy')\n",
|
|||
|
"plt.gca().xaxis.set_major_locator(mticker.MultipleLocator(1))\n",
|
|||
|
"plt.title('Training and validation accuracy with Adam optimizer')\n",
|
|||
|
"plt.xlabel('Epochs')\n",
|
|||
|
"plt.ylabel('Accuracy')\n",
|
|||
|
"plt.gca().set_yticklabels(['{:.0f}%'.format(x*100) for x in plt.gca().get_yticks()]) \n",
|
|||
|
"plt.legend()\n",
|
|||
|
"plt.grid('off')\n",
|
|||
|
"plt.show()"
|
|||
|
],
|
|||
|
"execution_count": null,
|
|||
|
"outputs":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xE67gDgfJy7ZyzwEu4PH4wia1TVlcAfcA/9zbgAbkEdn17EuTlmqep23/o7cA/vLNyb5EuF1DDTO4dZOPfLrIAk/wc8KCJZuJjJy7599wLjgI+9qvx5AXnvALrjalk7gLuA7gG6jxvvgX05ria1HRc8vVZV13hJBgIbPFfbMNz1BGgEfIhrGPAJ8ISqzg5xmIW465pbW1iFi0uEqj0A/APo47WamXicp3Ul7kXjeVXdkjvhYkTxuMYED+BqkN8B7wP/zd3Zq13+zTuvrbgYw8fHqSE/+uNiBz8CbwCjVfVD3/Y3cYHx3EYJvTwDDS5eca/3H7mjBDWl42rvj/hbMwGo6hu4Bi/TvP/BCtz/JerktoQxyggi8hKwRlXDXoMxjNKGuKbPZ6rqb6OtpTRgNYhSjoi0FpGGIlJBRLrgmsxNj7YuwzBKP9YDuPRzCvA6LmCcCdyoql9EV5JhGGUBczEZhmEYQTEXk2EYhhEUMxCGYRhGUMpMDKJ27dqakpJS5P1//fVXqlWrVnKCSqkG02E6Yl2D6ShZHUuWLNmuqicF3RiN8T3CMbVs2VKLwpQpqvXrq4oc1vr13XK0mD17dvQO7sN0HI3piC0NqqYjkOLoABZriOdqmalBFIWpU+GGG2DvXgBh40a3DDDguD4HZBiGUfYo1zGIe+7JNQ5H2LvXrTcMwyjvlGsDsWnT8a03DMMoT5RrF9Ppp8PGwAGevfVGdMjOziYzM5P9+/dTo0YNVq9eHW1JpiOEhoSEBJKTk6lYsWJUNRnho1wbiHHj/DEIR9Wqbr0RHTIzM0lKSiIlJYU9e/aQlJRU8E5hJisry3QEaFBVduzYQWZmJg0aNIiqJ
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 432x288 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {
|
|||
|
"tags": [],
|
|||
|
"needs_background": "light"
|
|||
|
}
|
|||
|
},
|
|||
|
{
|
|||
|
"output_type": "display_data",
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYg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5W58Pwe/iEgtjOG6EVNyaQokAs8DfZxzTsP8J2KdujP3PkXlMQZkL1BCRB4HKuRFixcWYko+w53ndAXm/zjZbZ8b3P5DTwG/qqrrCz3P98UfIlIb89/po6obPDa/DYySM5Xl54hI52Cd2xqIM7wKlMF8nf0KfBum8/bGVPTux/j9P8FkDN7Is0ZVXQPch8n0/8L4bXf4TWT8r+2Aeaq6z239g5jM+yjwjqM5EA0znWuYB2zi7FYV9wJPishRTJ3JFLe0J4BRwP+c4vSlHsfej8l0HsDcy+HAjR66AyWn+3w7xs+7DtiDqYNBVRdhKsFfwXzVfs+ZUs1jnPH5/5vsJTJvfIApwf0JrHV0uPMgsApTYXsAk8EW80jfBFOn5Y/vMZmuy0D8hDFIP/hMAc8CjzrPwVdFvy9uB1ao6ixV3eWaMI0LLhaRizAGqhzGZTUB02DAxXeY57EBc39SyYcLxR1VPYUxCNdjnv2bmEx5ndtuH2E+GA5gGgn83W3bE8D7zn3pEQxNDh0wLqNP3VoyrXG2vYYpdc9y/je/YhrFBAVxKjYsUYKIfAKsU9WQl2AshRcR6QPcraqXRVpLYUFEJmAqnR+NtJZwYUsQEUZELhHT5ryY0wy0MzA9p3QWiy8c9929wNhIa7EUbKyBiDx/w/h9j2GK2QNVdXlEFVkKLCJyLcY/v5uc3VgWi1+si8lisVgsXrElCIvFYrF4xRoIi8VisXil0ESNrFq1qtapUydPaY8fP07ZsmWDK8jqsDoKoY5o0
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 432x288 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {
|
|||
|
"tags": [],
|
|||
|
"needs_background": "light"
|
|||
|
}
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"metadata": {
|
|||
|
"id": "PeY_NGfF6Kzf"
|
|||
|
},
|
|||
|
"source": [
|
|||
|
""
|
|||
|
],
|
|||
|
"execution_count": null,
|
|||
|
"outputs": []
|
|||
|
}
|
|||
|
]
|
|||
|
}
|