{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "[Table of Contents](./table_of_contents.ipynb)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "test" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from __future__ import division, print_function\n", "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1]\n" ] } ], "source": [ "import numpy as np\n", "belief = np.array([1/10]*10)\n", "print(belief)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "hallway = np.array([1, 1, 0, 0, 0, 0, 0, 0, 1, 0])" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAOTElEQVR4nO3df6zdd13H8eeLdhU2BjP0YrAtbMTyoyHGzZs5XTKnA9NN00ZDTJsAQpD6B0MQohlqQOdfghFjMtGGoYiwWQZoQyoDZUhi3Nwd48e6UrmUQa8Fe4E5RKKj+vaP8x053J57z7fl3G/HZ89HctPzPefT8/7ctH3me7/3ntNUFZKk732PO9cbkCTNhkGXpEYYdElqhEGXpEYYdElqhEGXpEZMDXqStyc5meS+VR5Pkj9OspjkU0kum/02JUnT9DlD/wtg5xqPXwts7z72AW/97rclSTpTU4NeVR8DvrbGkt3AX9bIncBFSZ42qw1KkvrZOIPn2AIcHzte6u770sqFSfYxOovnggsu+NHnPOc5MxgvSY8d99xzz1eqam7SY7MIeibcN/H9BKpqP7AfYH5+vhYWFmYwXpIeO5J8YbXHZvFTLkvAt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j8NeEf3H6M8DjhQVYP/+OA58gPA+7v/CmAj8O6q+uCA818FvKs7eTkGvGyowd015BcAvzLUTICquivJbcDHGV3uuJdhX4r/3iRPAb4FvLKqHhxw9ml86b8kNaL1Sy6S9Jhh0CWpEQZdkhph0CWpEQZdkhph0CWpEQZdkhrx/1mHY7VWvDrWAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "import kf_book.book_plots as book_plots\n", "from kf_book.book_plots import figsize, set_figsize\n", "import matplotlib.pyplot as plt\n", "\n", "belief = np.array([1/3, 1/3, 0, 0, 0, 0, 0, 0, 1/3, 0])\n", "book_plots.bar_plot(belief)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[0.33333333 0.33333333 0. 0. 0. 0.\n", " 0. 0. 0.33333333 0. ]\n" ] } ], "source": [ "belief = hallway * (1/3)\n", "print(belief)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "belief = np.array([0., 1., 0., 0., 0., 0., 0., 0., 0., 0.])" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "belief: [0.3 0.3 0.1 0.1 0.1 0.1 0.1 0.1 0.3 0.1]\n", "sum = 1.6000000000000003\n" ] }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAOdUlEQVR4nO3df6zdd13H8eeLdhU2BjP0YrAtbMTyoyHGzps5XTKnA9NN00ZDTJswhQD1D4YgRDPUgM6/BCPGZKINQ3DCZhmgDakMlCGJcXN3jB/rSqWUQa8Fe4E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bwRVVdSmjdyd9VZIrB5q7ntHlvbdV1Xbgv4Chv2e0AdgJvHfAmd/P6KvuS4AfBC5I8pIhZlfVYUbvLPsR4EOMLumeGmL2SloPep+3LWhSkvMYxfzdVfX+s7GH7kv+jwE7Bhp5BbAzyYOMLq/9dJK/HGg2AFV1ovvvSeADjC77DWERWBz7auh2RoEf0jXAJ6rq3wac+ULgC1W1VFXfBt4P/MRQw6vq5qq6tKquZHR59XNDzZ6k9aD3eduC5nRvXXwzcLiq/nDg2XNJLupuP4nRX7jPDjG7qt5QVZur6mJGv9cfrapBztYAklyQ5MJHbgM/w+jL8jVXVV8Bjid5bnfX1cADQ8wes4cBL7d0vgRcnuT87s/91Yy+ZzSIJE/v/vtM4BcY/vP/Ln3ebfExq1Z424Kh5ie5FbgK2JhkEXhTVd08wOgrgOuAz3TXsgF+s6oODjD7GcC7un8Y5QnA/qoa/McHz5IfAD7Q/VMA64H3VNWHBpz/auDd3cnLMeBlQw3uriG/CPiVoWYCVNXdSW4HPsHocsd9DPtS/PcleRrwbeBVVfXQgLNP40v/JakRrV9ykaTHDYMuSY0w6JLUCIMuSY0w6JLUCIMuSY0w6JLUiP8H63eF0xEDHgUAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "def update_belief(hall, belief, z, correct_scale):\n", " for i, val in enumerate(hall):\n", " if val == z:\n", " belief[i] *= correct_scale\n", "\n", "belief = np.array([0.1] * 10)\n", "reading = 1 # 1 is 'door'\n", "update_belief(hallway, belief, z=reading, correct_scale=3.)\n", "print('belief:', belief)\n", "print('sum =', sum(belief))\n", "plt.figure()\n", "book_plots.bar_plot(belief)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([0.1875, 0.1875, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625,\n", " 0.1875, 0.0625])" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "belief / sum(belief)" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([ True, True, False, False, False, False, False, False, True,\n", " False])" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hallway == 1" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "sum = 1.0\n", "probability of door = 0.1875\n", "probability of wall = 0.06249999999999999\n" ] }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAARTElEQVR4nO3da4xdV3nG8f9TGwcIt0CmFdgxcYq5GFoRGAwtaloREkypbFqBcBA0VFQuLamgqKpCqYhqvnCpWr6kbSySClGICQGqEQqEcK2qKuBxEiBOMJmYkEwNjcEplEITHN5+ONvVYThmtuOZPWT5/5OOZl/WOu/aGs8ze9bZeztVhSSpXb+w0gOQJC0vg16SGmfQS1LjDHpJapxBL0mNM+glqXG9gj7JliT7k8wluXjC/tcl+UqSm5L8W5JNY/ve3PXbn+RFSzl4SdListh19ElWAV8DzgPmgT3ABVV1y1ibR1XV97rlrcCfVNWWLvCvBDYDTwA+BTy5qu5fjoORJP20Pmf0m4G5qjpQVfcBu4Ft4w2OhnznVODob49twO6qureqvg7Mde8nSRrI6h5t1gJ3ja3PA89d2CjJ64E3AWuAF4z1vX5B37UT+u4AdgCceuqpz37qU5/aZ+ySpM7evXu/XVVTk/b1CfpM2PZT8z1VdSlwaZJXAn8FXHgcfXcBuwCmp6drdna2x7AkSUcl+cax9vWZupkHzhhbXwcc/BntdwMvfYB9JUlLrE/Q7wE2JtmQZA2wHZgZb5Bk49jqS4DbuuUZYHuSU5JsADYC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ata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "from filterpy.discrete_bayes import normalize\n", "\n", "def scaled_update(hall, belief, z, z_prob): \n", " scale = z_prob / (1. - z_prob)\n", " belief[hall==z] *= scale\n", " normalize(belief)\n", "\n", "belief = np.array([0.1] * 10)\n", "scaled_update(hallway, belief, z=1, z_prob=.75)\n", "\n", "print('sum =', sum(belief))\n", "print('probability of door =', belief[0])\n", "print('probability of wall =', belief[2])\n", "book_plots.bar_plot(belief, ylim=(0, .3))" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [], "source": [ "def scaled_update(hall, belief, z, z_prob): \n", " scale = z_prob / (1. - z_prob)\n", " likelihood = np.ones(len(hall))\n", " likelihood[hall==z] *= scale\n", " return normalize(likelihood * belief)" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([0.1875, 0.1875, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625,\n", " 0.1875, 0.0625])" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from filterpy.discrete_bayes import update\n", "\n", "def lh_hallway(hall, z, z_prob):\n", " \"\"\" compute likelihood that a measurement matches\n", " positions in the hallway.\"\"\"\n", " \n", " try:\n", " scale = z_prob / (1. - z_prob)\n", " except ZeroDivisionError:\n", " scale = 1e8\n", "\n", " likelihood = np.ones(len(hall))\n", " likelihood[hall==z] *= scale\n", " return likelihood\n", "\n", "belief = np.array([0.1] * 10)\n", "likelihood = lh_hallway(hallway, z=1, z_prob=.75)\n", "update(likelihood, belief) " ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAEICAYAAABRSj9aAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXR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+K93RgRo54VSDpQ0sFD08CpFJeEo+3vQWCbpJemRSdTPPlZ1TlUvLRNtgJ/IumA9NmeTDE+XImkF6V/e4B3NLjviWxS5HWKbTi3m83rtI/sc7steT3Wu7nj/aIYw/o5xbcUPlox5usU42bPUPxPf37FuDdRXEL/FLg9vd5aIe5VwIYUdydwSRPv8yQqfjuBYjzyjvTaWPVzSbHHAetSX78NTKsYdwDwCHBIg+/rExSF4U7gKmDfBmJ/RHGw3gGcPN652MpXM3md4hrO7WbzOsWOKbcbyevUPvvcbkde+1cgmJllbrIP3ZiZ2Shc6M3MMudCb2aWORd6M7PMudCbmWXOhd7MLHMu9GZmmfv/SOKgDTa1rncAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "def perfect_predict(belief, move):\n", " \"\"\" move the position by `move` spaces, where positive is \n", " to the right, and negative is to the left\n", " \"\"\"\n", " n = len(belief)\n", " result = np.zeros(n)\n", " for i in range(n):\n", " result[i] = belief[(i-move) % n]\n", " return result\n", " \n", "belief = np.array([.35, .1, .2, .3, 0, 0, 0, 0, 0, .05])\n", "plt.subplot(121)\n", "book_plots.bar_plot(belief, title='Before prediction', ylim=(0, .4))\n", "\n", "belief = perfect_predict(belief, 1)\n", "plt.subplot(122)\n", "book_plots.bar_plot(belief, title='After prediction', ylim=(0, .4))" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "a34485ef90784fb9b372dc6e0982341f", "version_major": 2, "version_minor": 0 }, "text/plain": [ "interactive(children=(IntSlider(value=0, description='time_step', max=19), Output()), _dom_classes=('widget-in…" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from ipywidgets import interact, IntSlider\n", "\n", "belief = np.array([.35, .1, .2, .3, 0, 0, 0, 0, 0, .05])\n", "perfect_beliefs = []\n", "\n", "for _ in range(20):\n", " # Simon takes one step to the right\n", " belief = perfect_predict(belief, 1)\n", " perfect_beliefs.append(belief)\n", "\n", "def simulate(time_step):\n", " book_plots.bar_plot(perfect_beliefs[time_step], ylim=(0, .4))\n", " \n", "interact(simulate, time_step=IntSlider(value=0, max=len(perfect_beliefs)-1));" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## References\n", "\n", " * [1] D. Fox, W. Burgard, and S. Thrun. \"Monte carlo localization: Efficient position estimation for mobile robots.\" In *Journal of Artifical Intelligence Research*, 1999.\n", " \n", " http://www.cs.cmu.edu/afs/cs/project/jair/pub/volume11/fox99a-html/jair-localize.html\n", "\n", "\n", " * [2] Dieter Fox, et. al. \"Bayesian Filters for Location Estimation\". In *IEEE Pervasive Computing*, September 2003.\n", " \n", " http://swarmlab.unimaas.nl/wp-content/uploads/2012/07/fox2003bayesian.pdf\n", " \n", " \n", " * [3] Sebastian Thrun. \"Artificial Intelligence for Robotics\".\n", " \n", " https://www.udacity.com/course/cs373\n", " \n", " \n", " * [4] Khan Acadamy. \"Introduction to the Convolution\"\n", " \n", " https://www.khanacademy.org/math/differential-equations/laplace-transform/convolution-integral/v/introduction-to-the-convolution\n", " \n", " \n", "* [5] Wikipedia. \"Convolution\"\n", "\n", " http://en.wikipedia.org/wiki/Convolution\n", "\n", "* [6] Wikipedia. \"Law of total probability\"\n", "\n", " http://en.wikipedia.org/wiki/Law_of_total_probability\n", " \n", "* [7] Wikipedia. \"Time Evolution\"\n", "\n", " https://en.wikipedia.org/wiki/Time_evolution\n", " \n", "* [8] We need to rethink how we teach statistics from the ground up\n", " \n", " http://www.statslife.org.uk/opinion/2405-we-need-to-rethink-how-we-teach-statistics-from-the-ground-up" ] } ], "metadata": { "anaconda-cloud": {}, "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.6" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "state": { "1ea315f115ff43d8aedcd574bbeed410": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "IntSliderModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "IntSliderModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "IntSliderView", "continuous_update": true, "description": "step", "description_tooltip": null, "disabled": false, "layout": "IPY_MODEL_51963e73dba4487f95d2e6c2b9a9c71a", "max": 100, "min": 0, "orientation": "horizontal", "readout": true, "readout_format": "d", "step": 1, "style": "IPY_MODEL_bf7a2628623c422bbdc7983f76a57c75", "value": 1 } }, "24a3f8a7d3c44508a9d0ae15bb97df92": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "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 } }, "24f0f28eff1947719418be9532a5054c": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "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 } }, "376e66cbf1e74103a1a93d5ec7611004": { "model_module": "@jupyter-widgets/output", "model_module_version": "1.0.0", "model_name": "OutputModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/output", "_model_module_version": "1.0.0", "_model_name": "OutputModel", "_view_count": null, "_view_module": "@jupyter-widgets/output", "_view_module_version": "1.0.0", "_view_name": "OutputView", "layout": "IPY_MODEL_24f0f28eff1947719418be9532a5054c", "msg_id": "", "outputs": [] } }, "4825caa46e18450f9afcba67c27cbeba": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "IntSliderModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "IntSliderModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "IntSliderView", "continuous_update": true, "description": "time_step", "description_tooltip": null, "disabled": false, "layout": "IPY_MODEL_6409d65c66d5483ab1dff92c7199efb0", "max": 19, "min": 0, "orientation": "horizontal", "readout": true, "readout_format": "d", "step": 1, "style": "IPY_MODEL_c448c06a3e904b0d811dd099733429bc", "value": 0 } }, "48c69b49621547b9972c8eb7cddfa10e": { "model_module": "@jupyter-widgets/output", "model_module_version": "1.0.0", "model_name": "OutputModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/output", "_model_module_version": "1.0.0", "_model_name": "OutputModel", "_view_count": null, "_view_module": "@jupyter-widgets/output", "_view_module_version": "1.0.0", "_view_name": "OutputView", "layout": "IPY_MODEL_4fbf3d96470d4f168fdd3af62ae85189", "msg_id": "", "outputs": [] } }, "4fbf3d96470d4f168fdd3af62ae85189": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "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 } }, "51963e73dba4487f95d2e6c2b9a9c71a": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "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 } }, "557aede106aa460da09898120cf2c111": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "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 } }, "6127afe680be4cc5bd3e14626d4493f0": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "VBoxModel", "state": { "_dom_classes": [ "widget-interact" ], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "VBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "VBoxView", "box_style": "", "children": [ "IPY_MODEL_7f99b7560aa04802a5b1b03b5e4ad81e", "IPY_MODEL_48c69b49621547b9972c8eb7cddfa10e" ], "layout": "IPY_MODEL_557aede106aa460da09898120cf2c111" } }, "6409d65c66d5483ab1dff92c7199efb0": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "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 } }, "7e810cc52ae044aba08c2672377d716c": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "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 } }, "7f99b7560aa04802a5b1b03b5e4ad81e": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "IntSliderModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "IntSliderModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "IntSliderView", "continuous_update": true, "description": "step", "description_tooltip": null, "disabled": false, "layout": "IPY_MODEL_7e810cc52ae044aba08c2672377d716c", "max": 12, "min": 0, "orientation": "horizontal", "readout": true, "readout_format": "d", "step": 1, "style": "IPY_MODEL_d4f45abe59a24e19a6168202f72b914e", "value": 12 } }, "9260e86291ea4ceabb18583e1b480bd9": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "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 } }, "964107123dbf442593d2a43411c04268": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "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 } }, "b51e90e175e14117b4c0727749c1047d": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "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 } }, "bf7a2628623c422bbdc7983f76a57c75": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "SliderStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "SliderStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "", "handle_color": null } }, "c383bd000ae248f0adeec4825dc0923b": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "SliderStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "SliderStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "", "handle_color": null } }, "c448c06a3e904b0d811dd099733429bc": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "SliderStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "SliderStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "", "handle_color": null } }, "d13d51f518a64cbfb548a3ac5fe0412d": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "VBoxModel", "state": { "_dom_classes": [ "widget-interact" ], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "VBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "VBoxView", "box_style": "", "children": [ "IPY_MODEL_e99d98efa98146f7ae449672d8f4da71", "IPY_MODEL_e67fb12631604743a7b242a173e2250c" ], "layout": "IPY_MODEL_24a3f8a7d3c44508a9d0ae15bb97df92" } }, "d4f45abe59a24e19a6168202f72b914e": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "SliderStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "SliderStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "", "handle_color": null } }, "e67fb12631604743a7b242a173e2250c": { "model_module": "@jupyter-widgets/output", "model_module_version": "1.0.0", "model_name": "OutputModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/output", "_model_module_version": "1.0.0", "_model_name": "OutputModel", "_view_count": null, "_view_module": "@jupyter-widgets/output", "_view_module_version": "1.0.0", "_view_name": "OutputView", "layout": "IPY_MODEL_9260e86291ea4ceabb18583e1b480bd9", "msg_id": "", "outputs": [] } }, "e99d98efa98146f7ae449672d8f4da71": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "IntSliderModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "IntSliderModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "IntSliderView", "continuous_update": true, "description": "step", "description_tooltip": null, "disabled": false, "layout": "IPY_MODEL_fb2dce3f803243b3a6a4619bc0099cc2", "max": 100, "min": 0, "orientation": "horizontal", "readout": true, "readout_format": "d", "step": 1, "style": "IPY_MODEL_c383bd000ae248f0adeec4825dc0923b", "value": 1 } }, "ecba7b7412dc454d9c606867bb343235": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "VBoxModel", "state": { "_dom_classes": [ "widget-interact" ], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "VBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "VBoxView", "box_style": "", "children": [ "IPY_MODEL_4825caa46e18450f9afcba67c27cbeba", "IPY_MODEL_ecf2533746d74ee18336f04b86e21736" ], "layout": "IPY_MODEL_fa98c8f5d70f48af9968b14005fa2274" } }, "ecf2533746d74ee18336f04b86e21736": { "model_module": "@jupyter-widgets/output", "model_module_version": "1.0.0", "model_name": "OutputModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/output", "_model_module_version": "1.0.0", "_model_name": "OutputModel", "_view_count": null, "_view_module": "@jupyter-widgets/output", "_view_module_version": "1.0.0", "_view_name": "OutputView", "layout": "IPY_MODEL_964107123dbf442593d2a43411c04268", "msg_id": "", "outputs": [] } }, "fa98c8f5d70f48af9968b14005fa2274": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "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 } }, "fb2dce3f803243b3a6a4619bc0099cc2": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "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 } }, "fd3a9bcbc55f432dad319c4248e1f8ef": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "VBoxModel", "state": { "_dom_classes": [ "widget-interact" ], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "VBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "VBoxView", "box_style": "", "children": [ "IPY_MODEL_1ea315f115ff43d8aedcd574bbeed410", "IPY_MODEL_376e66cbf1e74103a1a93d5ec7611004" ], "layout": "IPY_MODEL_b51e90e175e14117b4c0727749c1047d" } } }, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 4 }