Skip to content

Instantly share code, notes, and snippets.

@colehaus
Created February 11, 2022 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colehaus/d3004e11f4953a636608d203bbb5024c to your computer and use it in GitHub Desktop.
Save colehaus/d3004e11f4953a636608d203bbb5024c to your computer and use it in GitHub Desktop.
plate-vs-not.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "plate-vs-not.ipynb",
"provenance": [],
"authorship_tag": "ABX9TyP1/a7dGMsgezKW/MrP0c6m",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"1409e98609264b6c9a59daecccd38698": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HBoxView",
"_dom_classes": [],
"_model_name": "HBoxModel",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.5.0",
"box_style": "",
"layout": "IPY_MODEL_92316ae8378c40f9877d5452743269e6",
"_model_module": "@jupyter-widgets/controls",
"children": [
"IPY_MODEL_82a80bc7929841c8a60e7168dcf12659",
"IPY_MODEL_612123fc11724f2484d34c6e44751bdc",
"IPY_MODEL_c7a372060aa64baeac7d868c608a6c29"
]
}
},
"92316ae8378c40f9877d5452743269e6": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"82a80bc7929841c8a60e7168dcf12659": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HTMLView",
"style": "IPY_MODEL_fb84197b452f41e9a6ca0f45308a6f1e",
"_dom_classes": [],
"description": "",
"_model_name": "HTMLModel",
"placeholder": "​",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": "Running chain 0: 100%",
"_view_count": null,
"_view_module_version": "1.5.0",
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_554418dc237942849c4ebc31e571cf1e"
}
},
"612123fc11724f2484d34c6e44751bdc": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "ProgressView",
"style": "IPY_MODEL_0a42788b47c24a28904147a90d053aa5",
"_dom_classes": [],
"description": "",
"_model_name": "FloatProgressModel",
"bar_style": "success",
"max": 2500,
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": 2500,
"_view_count": null,
"_view_module_version": "1.5.0",
"orientation": "horizontal",
"min": 0,
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_7fcf3f57ff97473695fb586a3172a2e2"
}
},
"c7a372060aa64baeac7d868c608a6c29": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HTMLView",
"style": "IPY_MODEL_8d216690db2142a5b6875f9cc9c90545",
"_dom_classes": [],
"description": "",
"_model_name": "HTMLModel",
"placeholder": "​",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": " 2500/2500 [00:10<00:00, 10659.70it/s]",
"_view_count": null,
"_view_module_version": "1.5.0",
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_8fab090069aa4669b5b7b46f9e98f584"
}
},
"fb84197b452f41e9a6ca0f45308a6f1e": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "DescriptionStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"_model_module": "@jupyter-widgets/controls"
}
},
"554418dc237942849c4ebc31e571cf1e": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"0a42788b47c24a28904147a90d053aa5": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "ProgressStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"bar_color": null,
"_model_module": "@jupyter-widgets/controls"
}
},
"7fcf3f57ff97473695fb586a3172a2e2": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"8d216690db2142a5b6875f9cc9c90545": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "DescriptionStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"_model_module": "@jupyter-widgets/controls"
}
},
"8fab090069aa4669b5b7b46f9e98f584": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"aab7fd9995804fc89ca06aa9db820ac2": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HBoxView",
"_dom_classes": [],
"_model_name": "HBoxModel",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.5.0",
"box_style": "",
"layout": "IPY_MODEL_dacc0fd63d86434390e09e8e83851450",
"_model_module": "@jupyter-widgets/controls",
"children": [
"IPY_MODEL_c8211a32fc8941118452b44a3efc51ab",
"IPY_MODEL_d10e5d7ab9e24e77af894c1ecc87396b",
"IPY_MODEL_557bdc068d354844abe9cb4b7a25e465"
]
}
},
"dacc0fd63d86434390e09e8e83851450": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"c8211a32fc8941118452b44a3efc51ab": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HTMLView",
"style": "IPY_MODEL_9c1401b984584160ae2d3551b4669c8e",
"_dom_classes": [],
"description": "",
"_model_name": "HTMLModel",
"placeholder": "​",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": "Running chain 1: 100%",
"_view_count": null,
"_view_module_version": "1.5.0",
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_bb9e77897ef9412cbb2e9473f7c09186"
}
},
"d10e5d7ab9e24e77af894c1ecc87396b": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "ProgressView",
"style": "IPY_MODEL_351701c85da94d31bb7b13b011ac4af0",
"_dom_classes": [],
"description": "",
"_model_name": "FloatProgressModel",
"bar_style": "success",
"max": 2500,
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": 2500,
"_view_count": null,
"_view_module_version": "1.5.0",
"orientation": "horizontal",
"min": 0,
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_50769ca63a3f4cd2bca6a165e92b5d1f"
}
},
"557bdc068d354844abe9cb4b7a25e465": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HTMLView",
"style": "IPY_MODEL_bae1fbffcdf54d2195d998ced550d9ce",
"_dom_classes": [],
"description": "",
"_model_name": "HTMLModel",
"placeholder": "​",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": " 2500/2500 [00:10<00:00, 13064.80it/s]",
"_view_count": null,
"_view_module_version": "1.5.0",
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_a40409de01e34ac99592940270cd37b3"
}
},
"9c1401b984584160ae2d3551b4669c8e": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "DescriptionStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"_model_module": "@jupyter-widgets/controls"
}
},
"bb9e77897ef9412cbb2e9473f7c09186": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"351701c85da94d31bb7b13b011ac4af0": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "ProgressStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"bar_color": null,
"_model_module": "@jupyter-widgets/controls"
}
},
"50769ca63a3f4cd2bca6a165e92b5d1f": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"bae1fbffcdf54d2195d998ced550d9ce": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "DescriptionStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"_model_module": "@jupyter-widgets/controls"
}
},
"a40409de01e34ac99592940270cd37b3": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"468c6d0dbf0e4404af7323662d8c1ddf": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HBoxView",
"_dom_classes": [],
"_model_name": "HBoxModel",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.5.0",
"box_style": "",
"layout": "IPY_MODEL_f450ddf1f0d8440a9aebaf290ceb1ee7",
"_model_module": "@jupyter-widgets/controls",
"children": [
"IPY_MODEL_56791fc9ccc748ac87ea52e2f7ff614e",
"IPY_MODEL_6bb3e3db74f74bb4a21c11687a939e6a",
"IPY_MODEL_f845a89482404354b6a9fa4c15a090c7"
]
}
},
"f450ddf1f0d8440a9aebaf290ceb1ee7": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"56791fc9ccc748ac87ea52e2f7ff614e": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HTMLView",
"style": "IPY_MODEL_df96e862916b47bc98bc4a0da71f606a",
"_dom_classes": [],
"description": "",
"_model_name": "HTMLModel",
"placeholder": "​",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": "Running chain 0: 100%",
"_view_count": null,
"_view_module_version": "1.5.0",
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_f192f0d5cd5349bc946074900ee07978"
}
},
"6bb3e3db74f74bb4a21c11687a939e6a": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "ProgressView",
"style": "IPY_MODEL_2973fe2da2e242cea45c594bb217869e",
"_dom_classes": [],
"description": "",
"_model_name": "FloatProgressModel",
"bar_style": "success",
"max": 2500,
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": 2500,
"_view_count": null,
"_view_module_version": "1.5.0",
"orientation": "horizontal",
"min": 0,
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_78ab77e69bc84950832c8cc246645d14"
}
},
"f845a89482404354b6a9fa4c15a090c7": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HTMLView",
"style": "IPY_MODEL_b8cde7db51fa4e249745c91b93b71ae9",
"_dom_classes": [],
"description": "",
"_model_name": "HTMLModel",
"placeholder": "​",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": " 2500/2500 [00:11<00:00, 9757.70it/s]",
"_view_count": null,
"_view_module_version": "1.5.0",
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_bdd0192d79414fdc853f19812c194577"
}
},
"df96e862916b47bc98bc4a0da71f606a": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "DescriptionStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"_model_module": "@jupyter-widgets/controls"
}
},
"f192f0d5cd5349bc946074900ee07978": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"2973fe2da2e242cea45c594bb217869e": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "ProgressStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"bar_color": null,
"_model_module": "@jupyter-widgets/controls"
}
},
"78ab77e69bc84950832c8cc246645d14": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"b8cde7db51fa4e249745c91b93b71ae9": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "DescriptionStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"_model_module": "@jupyter-widgets/controls"
}
},
"bdd0192d79414fdc853f19812c194577": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"d7969ef77daf4b2583d9187d40af19ce": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HBoxView",
"_dom_classes": [],
"_model_name": "HBoxModel",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.5.0",
"box_style": "",
"layout": "IPY_MODEL_555ae60fd7f14658bcb1de10f5aab799",
"_model_module": "@jupyter-widgets/controls",
"children": [
"IPY_MODEL_6634443fc5304a80955278ec446f3cf5",
"IPY_MODEL_89ed6e30d8b94e818efb71f9157190bb",
"IPY_MODEL_e655095628874f9ba4616caed8407756"
]
}
},
"555ae60fd7f14658bcb1de10f5aab799": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"6634443fc5304a80955278ec446f3cf5": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HTMLView",
"style": "IPY_MODEL_d790933bd88d4600b237f36dd193d2bc",
"_dom_classes": [],
"description": "",
"_model_name": "HTMLModel",
"placeholder": "​",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": "Running chain 1: 100%",
"_view_count": null,
"_view_module_version": "1.5.0",
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_a05d73139892484583711a5f2493ac61"
}
},
"89ed6e30d8b94e818efb71f9157190bb": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "ProgressView",
"style": "IPY_MODEL_75960ef09a26487eb6f8abefd1f902cf",
"_dom_classes": [],
"description": "",
"_model_name": "FloatProgressModel",
"bar_style": "success",
"max": 2500,
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": 2500,
"_view_count": null,
"_view_module_version": "1.5.0",
"orientation": "horizontal",
"min": 0,
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_c98622c0214248659b3e70b629781f4c"
}
},
"e655095628874f9ba4616caed8407756": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HTMLView",
"style": "IPY_MODEL_e045a299c1794be5a559d2e901135c57",
"_dom_classes": [],
"description": "",
"_model_name": "HTMLModel",
"placeholder": "​",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": " 2500/2500 [00:11<00:00, 13061.87it/s]",
"_view_count": null,
"_view_module_version": "1.5.0",
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_0eebaadb9c594e3f981c92ea6ee8aacb"
}
},
"d790933bd88d4600b237f36dd193d2bc": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "DescriptionStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"_model_module": "@jupyter-widgets/controls"
}
},
"a05d73139892484583711a5f2493ac61": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"75960ef09a26487eb6f8abefd1f902cf": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "ProgressStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"bar_color": null,
"_model_module": "@jupyter-widgets/controls"
}
},
"c98622c0214248659b3e70b629781f4c": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"e045a299c1794be5a559d2e901135c57": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "DescriptionStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"_model_module": "@jupyter-widgets/controls"
}
},
"0eebaadb9c594e3f981c92ea6ee8aacb": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
}
}
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/colehaus/d3004e11f4953a636608d203bbb5024c/plate-vs-not.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 927,
"referenced_widgets": [
"1409e98609264b6c9a59daecccd38698",
"92316ae8378c40f9877d5452743269e6",
"82a80bc7929841c8a60e7168dcf12659",
"612123fc11724f2484d34c6e44751bdc",
"c7a372060aa64baeac7d868c608a6c29",
"fb84197b452f41e9a6ca0f45308a6f1e",
"554418dc237942849c4ebc31e571cf1e",
"0a42788b47c24a28904147a90d053aa5",
"7fcf3f57ff97473695fb586a3172a2e2",
"8d216690db2142a5b6875f9cc9c90545",
"8fab090069aa4669b5b7b46f9e98f584",
"aab7fd9995804fc89ca06aa9db820ac2",
"dacc0fd63d86434390e09e8e83851450",
"c8211a32fc8941118452b44a3efc51ab",
"d10e5d7ab9e24e77af894c1ecc87396b",
"557bdc068d354844abe9cb4b7a25e465",
"9c1401b984584160ae2d3551b4669c8e",
"bb9e77897ef9412cbb2e9473f7c09186",
"351701c85da94d31bb7b13b011ac4af0",
"50769ca63a3f4cd2bca6a165e92b5d1f",
"bae1fbffcdf54d2195d998ced550d9ce",
"a40409de01e34ac99592940270cd37b3",
"468c6d0dbf0e4404af7323662d8c1ddf",
"f450ddf1f0d8440a9aebaf290ceb1ee7",
"56791fc9ccc748ac87ea52e2f7ff614e",
"6bb3e3db74f74bb4a21c11687a939e6a",
"f845a89482404354b6a9fa4c15a090c7",
"df96e862916b47bc98bc4a0da71f606a",
"f192f0d5cd5349bc946074900ee07978",
"2973fe2da2e242cea45c594bb217869e",
"78ab77e69bc84950832c8cc246645d14",
"b8cde7db51fa4e249745c91b93b71ae9",
"bdd0192d79414fdc853f19812c194577",
"d7969ef77daf4b2583d9187d40af19ce",
"555ae60fd7f14658bcb1de10f5aab799",
"6634443fc5304a80955278ec446f3cf5",
"89ed6e30d8b94e818efb71f9157190bb",
"e655095628874f9ba4616caed8407756",
"d790933bd88d4600b237f36dd193d2bc",
"a05d73139892484583711a5f2493ac61",
"75960ef09a26487eb6f8abefd1f902cf",
"c98622c0214248659b3e70b629781f4c",
"e045a299c1794be5a559d2e901135c57",
"0eebaadb9c594e3f981c92ea6ee8aacb"
]
},
"id": "DVyN1BfWl0U4",
"outputId": "7632bbb0-5c1d-41a9-ec87-305ff8fc960d"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Collecting numpyro\n",
" Downloading numpyro-0.9.0-py3-none-any.whl (282 kB)\n",
"\u001b[?25l\r\u001b[K |█▏ | 10 kB 16.9 MB/s eta 0:00:01\r\u001b[K |██▎ | 20 kB 21.7 MB/s eta 0:00:01\r\u001b[K |███▌ | 30 kB 27.1 MB/s eta 0:00:01\r\u001b[K |████▋ | 40 kB 29.9 MB/s eta 0:00:01\r\u001b[K |█████▉ | 51 kB 33.0 MB/s eta 0:00:01\r\u001b[K |███████ | 61 kB 24.4 MB/s eta 0:00:01\r\u001b[K |████████▏ | 71 kB 20.7 MB/s eta 0:00:01\r\u001b[K |█████████▎ | 81 kB 21.2 MB/s eta 0:00:01\r\u001b[K |██████████▍ | 92 kB 21.7 MB/s eta 0:00:01\r\u001b[K |███████████▋ | 102 kB 23.3 MB/s eta 0:00:01\r\u001b[K |████████████▊ | 112 kB 23.3 MB/s eta 0:00:01\r\u001b[K |██████████████ | 122 kB 23.3 MB/s eta 0:00:01\r\u001b[K |███████████████ | 133 kB 23.3 MB/s eta 0:00:01\r\u001b[K |████████████████▎ | 143 kB 23.3 MB/s eta 0:00:01\r\u001b[K |█████████████████▍ | 153 kB 23.3 MB/s eta 0:00:01\r\u001b[K |██████████████████▌ | 163 kB 23.3 MB/s eta 0:00:01\r\u001b[K |███████████████████▊ | 174 kB 23.3 MB/s eta 0:00:01\r\u001b[K |████████████████████▉ | 184 kB 23.3 MB/s eta 0:00:01\r\u001b[K |██████████████████████ | 194 kB 23.3 MB/s eta 0:00:01\r\u001b[K |███████████████████████▏ | 204 kB 23.3 MB/s eta 0:00:01\r\u001b[K |████████████████████████▍ | 215 kB 23.3 MB/s eta 0:00:01\r\u001b[K |█████████████████████████▌ | 225 kB 23.3 MB/s eta 0:00:01\r\u001b[K |██████████████████████████▋ | 235 kB 23.3 MB/s eta 0:00:01\r\u001b[K |███████████████████████████▉ | 245 kB 23.3 MB/s eta 0:00:01\r\u001b[K |█████████████████████████████ | 256 kB 23.3 MB/s eta 0:00:01\r\u001b[K |██████████████████████████████▏ | 266 kB 23.3 MB/s eta 0:00:01\r\u001b[K |███████████████████████████████▎| 276 kB 23.3 MB/s eta 0:00:01\r\u001b[K |████████████████████████████████| 282 kB 23.3 MB/s \n",
"\u001b[?25hCollecting multipledispatch\n",
" Downloading multipledispatch-0.6.0-py3-none-any.whl (11 kB)\n",
"Requirement already satisfied: jax>=0.2.13 in /usr/local/lib/python3.7/dist-packages (from numpyro) (0.2.25)\n",
"Requirement already satisfied: jaxlib>=0.1.65 in /usr/local/lib/python3.7/dist-packages (from numpyro) (0.1.71+cuda111)\n",
"Requirement already satisfied: numpy in /usr/local/lib/python3.7/dist-packages (from numpyro) (1.19.5)\n",
"Requirement already satisfied: tqdm in /usr/local/lib/python3.7/dist-packages (from numpyro) (4.62.3)\n",
"Requirement already satisfied: opt-einsum in /usr/local/lib/python3.7/dist-packages (from jax>=0.2.13->numpyro) (3.3.0)\n",
"Requirement already satisfied: scipy>=1.2.1 in /usr/local/lib/python3.7/dist-packages (from jax>=0.2.13->numpyro) (1.4.1)\n",
"Requirement already satisfied: absl-py in /usr/local/lib/python3.7/dist-packages (from jax>=0.2.13->numpyro) (1.0.0)\n",
"Requirement already satisfied: typing-extensions in /usr/local/lib/python3.7/dist-packages (from jax>=0.2.13->numpyro) (3.10.0.2)\n",
"Requirement already satisfied: flatbuffers<3.0,>=1.12 in /usr/local/lib/python3.7/dist-packages (from jaxlib>=0.1.65->numpyro) (2.0)\n",
"Requirement already satisfied: six in /usr/local/lib/python3.7/dist-packages (from absl-py->jax>=0.2.13->numpyro) (1.15.0)\n",
"Installing collected packages: multipledispatch, numpyro\n",
"Successfully installed multipledispatch-0.6.0 numpyro-0.9.0\n",
"(2,)\n",
"(200, 2)\n",
"(200, 2)\n",
"(200, 2)\n"
]
},
{
"output_type": "display_data",
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "1409e98609264b6c9a59daecccd38698",
"version_minor": 0,
"version_major": 2
},
"text/plain": [
" 0%| | 0/2500 [00:00<?, ?it/s]"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "aab7fd9995804fc89ca06aa9db820ac2",
"version_minor": 0,
"version_major": 2
},
"text/plain": [
" 0%| | 0/2500 [00:00<?, ?it/s]"
]
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"(200, 2)\n",
"\n",
" mean std median 5.0% 95.0% n_eff r_hat\n",
" mus[0] 0.76 0.07 0.76 0.64 0.87 2093.63 1.00\n",
" mus[1] -0.22 0.07 -0.22 -0.35 -0.12 1900.43 1.00\n",
"scale_tril[0,0] 1.00 0.00 1.00 1.00 1.00 nan nan\n",
"scale_tril[0,1] 0.00 0.00 0.00 0.00 0.00 nan nan\n",
"scale_tril[1,0] 0.61 0.04 0.61 0.55 0.67 3006.51 1.00\n",
"scale_tril[1,1] 0.79 0.03 0.79 0.74 0.84 3061.30 1.00\n",
"\n",
"Number of divergences: 0\n",
"(200, 2)\n",
"(200, 2)\n"
]
},
{
"output_type": "display_data",
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "468c6d0dbf0e4404af7323662d8c1ddf",
"version_minor": 0,
"version_major": 2
},
"text/plain": [
" 0%| | 0/2500 [00:00<?, ?it/s]"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d7969ef77daf4b2583d9187d40af19ce",
"version_minor": 0,
"version_major": 2
},
"text/plain": [
" 0%| | 0/2500 [00:00<?, ?it/s]"
]
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"(200, 2)\n",
"\n",
" mean std median 5.0% 95.0% n_eff r_hat\n",
" mus[0] 0.76 0.07 0.76 0.64 0.87 2093.63 1.00\n",
" mus[1] -0.22 0.07 -0.22 -0.35 -0.12 1900.43 1.00\n",
"scale_tril[0,0] 1.00 0.00 1.00 1.00 1.00 nan nan\n",
"scale_tril[0,1] 0.00 0.00 0.00 0.00 0.00 nan nan\n",
"scale_tril[1,0] 0.61 0.04 0.61 0.55 0.67 3006.51 1.00\n",
"scale_tril[1,1] 0.79 0.03 0.79 0.74 0.84 3061.30 1.00\n",
"\n",
"Number of divergences: 0\n"
]
}
],
"source": [
"%pip install numpyro\n",
"\n",
"import jax\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import numpyro as ny\n",
"import numpyro.distributions as dist\n",
"from numpyro.infer import MCMC, NUTS, Predictive\n",
"from typing import Optional\n",
"\n",
"ny.util.set_host_device_count(2)\n",
"\n",
"\n",
"def model1(data: Optional[\"np.ndarray[float]\"] = None) -> None:\n",
" mus = ny.sample(\"mus\", dist.Normal(0, 1).expand((2,)))\n",
" scale_tril = ny.sample(\"scale_tril\", dist.LKJCholesky(2, concentration=1))\n",
" xs = ny.sample(\n",
" \"xs\", dist.MultivariateNormal(loc=mus, scale_tril=scale_tril), obs=data\n",
" )\n",
" print(xs.shape)\n",
"\n",
"def model2(data: \"np.ndarray[float]\") -> None:\n",
" mus = ny.sample(\"mus\", dist.Normal(0, 1).expand((2,)))\n",
" scale_tril = ny.sample(\"scale_tril\", dist.LKJCholesky(2, concentration=1))\n",
" with ny.plate(\"obs\", data.shape[0], dim=-1):\n",
" xs = ny.sample(\n",
" \"xs\", dist.MultivariateNormal(loc=mus, scale_tril=scale_tril), obs=data\n",
" )\n",
" print(xs.shape)\n",
"\n",
"xs = Predictive(\n",
" model1,\n",
" num_samples=200,\n",
" params={\"mus\": np.array([0.8, -0.2]), \"scale_tril\": np.array([[1, 0], [0.6, 0.8]])},\n",
")(jax.random.PRNGKey(2))[\"xs\"]\n",
"print(xs.shape)\n",
"\n",
"# plt.scatter(xs_missing[:,0], xs_missing[:,1], alpha=0.3)\n",
"\n",
"mcmc = MCMC(NUTS(model1), num_warmup=500, num_samples=2000, num_chains=2)\n",
"mcmc.run(jax.random.PRNGKey(0), data=xs)\n",
"mcmc.print_summary()\n",
"\n",
"mcmc = MCMC(NUTS(model2), num_warmup=500, num_samples=2000, num_chains=2)\n",
"mcmc.run(jax.random.PRNGKey(0), data=xs)\n",
"mcmc.print_summary()\n"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment