From ff66bade6b7ba5b07005a1dc82aef5eca2715dd5 Mon Sep 17 00:00:00 2001 From: Tim Mensinger Date: Tue, 10 Sep 2024 18:27:12 +0200 Subject: [PATCH] Update model processing (#85) --- .github/workflows/main.yml | 6 +- .pre-commit-config.yaml | 70 +- README.md | 2 +- codecov.yml | 1 - examples/long_running.py | 72 +- explanations/dispatchers.ipynb | 130 +- explanations/function_representation.ipynb | 176 +- pixi.lock | 11524 ++++++++-------- pyproject.toml | 40 +- scripts/check_nbqa_version_mismatch.py | 118 - src/lcm/__init__.py | 11 +- src/lcm/discrete_problem.py | 28 +- src/lcm/dispatchers.py | 15 +- src/lcm/entry_point.py | 49 +- src/lcm/exceptions.py | 18 + src/lcm/function_representation.py | 23 +- src/lcm/functools.py | 6 +- src/lcm/grid_helpers.py | 111 + src/lcm/grids.py | 252 +- src/lcm/input_processing/__init__.py | 3 + .../create_params_template.py | 104 +- src/lcm/input_processing/process_model.py | 241 + src/lcm/input_processing/util.py | 165 + src/lcm/interfaces.py | 122 +- src/lcm/mark.py | 5 +- src/lcm/model_functions.py | 13 +- src/lcm/next_state.py | 11 +- src/lcm/process_model.py | 439 - .../state_space_jax_versus_numba.ipynb | 38 +- src/lcm/simulate.py | 16 +- src/lcm/solve_brute.py | 4 +- src/lcm/state_space.py | 12 +- src/lcm/typing.py | 12 +- src/lcm/user_model.py | 122 + tests/input_processing/__init__.py | 0 .../test_create_params_template.py} | 81 +- .../test_process_model.py | 185 +- tests/test_analytical_solution.py | 4 +- tests/test_argmax.py | 3 +- tests/test_discrete_problem.py | 32 +- tests/test_dispatchers.py | 15 +- tests/test_entry_point.py | 44 +- tests/test_function_representation.py | 56 +- tests/test_functools.py | 11 +- tests/test_grid_helpers.py | 153 + tests/test_grids.py | 236 +- tests/test_model.py | 134 + tests/test_model_functions.py | 12 +- tests/test_models/deterministic.py | 121 +- tests/test_models/stochastic.py | 60 +- tests/test_next_state.py | 10 +- tests/test_random_choice.py | 1 + tests/test_regression_test.py | 4 +- tests/test_simulate.py | 24 +- tests/test_solution_on_toy_model.py | 76 +- tests/test_solve_brute.py | 5 +- tests/test_state_space.py | 14 +- tests/test_stochastic.py | 12 +- 58 files changed, 7690 insertions(+), 7562 deletions(-) delete mode 100644 scripts/check_nbqa_version_mismatch.py create mode 100644 src/lcm/exceptions.py create mode 100644 src/lcm/grid_helpers.py create mode 100644 src/lcm/input_processing/__init__.py rename src/lcm/{ => input_processing}/create_params_template.py (51%) create mode 100644 src/lcm/input_processing/process_model.py create mode 100644 src/lcm/input_processing/util.py delete mode 100644 src/lcm/process_model.py create mode 100644 src/lcm/user_model.py create mode 100644 tests/input_processing/__init__.py rename tests/{test_create_params.py => input_processing/test_create_params_template.py} (57%) rename tests/{ => input_processing}/test_process_model.py (55%) create mode 100644 tests/test_grid_helpers.py create mode 100644 tests/test_model.py diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 94a78581..f0420fe4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v4 - uses: prefix-dev/setup-pixi@v0.8.0 with: - pixi-version: v0.23.0 + pixi-version: v0.29.0 cache: true cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} environments: test-cpu @@ -48,7 +48,7 @@ jobs: - uses: actions/checkout@v4 - uses: prefix-dev/setup-pixi@v0.8.0 with: - pixi-version: v0.23.0 + pixi-version: v0.29.0 cache: true cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} environments: mypy @@ -62,7 +62,7 @@ jobs: - uses: actions/checkout@v4 - uses: prefix-dev/setup-pixi@v0.8.0 with: - pixi-version: v0.23.0 + pixi-version: v0.29.0 cache: true cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} environments: test-cpu diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 88b55200..4912e6d8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,19 +6,9 @@ repos: - id: check-useless-excludes # - id: identity # Prints all files passed to pre-commits. Debugging. - repo: https://github.com/lyz-code/yamlfix - rev: 1.16.0 + rev: 1.17.0 hooks: - id: yamlfix - - repo: local - hooks: - - id: check-nbqa-version-mismatch - name: Check for version mismatch between black, ruff, and nbQA - entry: python scripts/check_nbqa_version_mismatch.py - language: python - always_run: true - require_serial: true - additional_dependencies: - - pyyaml - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 hooks: @@ -55,30 +45,23 @@ repos: rev: v1.35.1 hooks: - id: yamllint - - repo: https://github.com/psf/black - rev: 24.4.2 - hooks: - - id: black - language_version: python3.12 - - repo: https://github.com/asottile/blacken-docs - rev: 1.18.0 - hooks: - - id: blacken-docs - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.0 + rev: v0.6.4 hooks: + # Run the linter. - id: ruff - # args: - # - --verbose - - repo: https://github.com/nbQA-dev/nbQA - rev: 1.8.5 - hooks: - - id: nbqa-black - additional_dependencies: - - black==24.4.2 - - id: nbqa-ruff - additional_dependencies: - - ruff==v0.5.0 + types_or: + - python + - pyi + - jupyter + args: + - --fix + # Run the formatter. + - id: ruff-format + types_or: + - python + - pyi + - jupyter - repo: https://github.com/executablebooks/mdformat rev: 0.7.17 hooks: @@ -86,10 +69,31 @@ repos: additional_dependencies: - mdformat-gfm - mdformat-gfm-alerts - - mdformat-black + - mdformat-ruff args: - --wrap - '88' files: (README\.md) + - repo: https://github.com/kynan/nbstripout + rev: 0.7.1 + hooks: + - id: nbstripout + args: + - --drop-empty-cells + - --keep-output + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.11.2 + hooks: + - id: mypy + files: src|tests + additional_dependencies: + - jax>=0.4.20 + - numpy + - packaging + - pandas-stubs + args: + - --config=pyproject.toml ci: autoupdate_schedule: monthly + skip: + - mypy # installing jax is not possible on pre-commit.ci due to size limits. diff --git a/README.md b/README.md index 2b81b33a..258f79f6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Life Cycle Models -[![image](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) +[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/OpenSourceEconomics/lcm/main.svg)](https://results.pre-commit.ci/latest/github/OpenSourceEconomics/lcm/main) [![image](https://codecov.io/gh/OpenSourceEconomics/lcm/branch/main/graph/badge.svg)](https://codecov.io/gh/OpenSourceEconomics/lcm) diff --git a/codecov.yml b/codecov.yml index 740448d8..c01f5dab 100644 --- a/codecov.yml +++ b/codecov.yml @@ -14,5 +14,4 @@ coverage: default: target: 90% ignore: - - setup.py - tests/**/* diff --git a/examples/long_running.py b/examples/long_running.py index d1787e45..9c54a5f0 100644 --- a/examples/long_running.py +++ b/examples/long_running.py @@ -2,17 +2,7 @@ import jax.numpy as jnp -# ====================================================================================== -# Numerical parameters and constants -# ====================================================================================== -N_GRID_POINTS = { - "wealth": 100, - "health": 100, - "consumption": 100, - "exercise": 200, -} - -RETIREMENT_AGE = 65 +from lcm import DiscreteGrid, LinspaceGrid, Model # ====================================================================================== # Model functions @@ -62,9 +52,12 @@ def consumption_constraint(consumption, wealth, labor_income): # ====================================================================================== # Model specification and parameters # ====================================================================================== +RETIREMENT_AGE = 65 -MODEL_CONFIG = { - "functions": { + +MODEL_CONFIG = Model( + n_periods=RETIREMENT_AGE - 18, + functions={ "utility": utility, "next_wealth": next_wealth, "next_health": next_health, @@ -73,37 +66,32 @@ def consumption_constraint(consumption, wealth, labor_income): "wage": wage, "age": age, }, - "choices": { - "working": {"options": [0, 1]}, - "consumption": { - "grid_type": "linspace", - "start": 1, - "stop": 100, - "n_points": N_GRID_POINTS["consumption"], - }, - "exercise": { - "grid_type": "linspace", - "start": 0, - "stop": 1, - "n_points": N_GRID_POINTS["exercise"], - }, + choices={ + "working": DiscreteGrid([0, 1]), + "consumption": LinspaceGrid( + start=1, + stop=100, + n_points=100, + ), + "exercise": LinspaceGrid( + start=0, + stop=1, + n_points=200, + ), }, - "states": { - "wealth": { - "grid_type": "linspace", - "start": 1, - "stop": 100, - "n_points": N_GRID_POINTS["wealth"], - }, - "health": { - "grid_type": "linspace", - "start": 0, - "stop": 1, - "n_points": N_GRID_POINTS["health"], - }, + states={ + "wealth": LinspaceGrid( + start=1, + stop=100, + n_points=100, + ), + "health": LinspaceGrid( + start=0, + stop=1, + n_points=100, + ), }, - "n_periods": RETIREMENT_AGE - 18, -} +) PARAMS = { "beta": 0.95, diff --git a/explanations/dispatchers.ipynb b/explanations/dispatchers.ipynb index b6cea60f..81aae290 100644 --- a/explanations/dispatchers.ipynb +++ b/explanations/dispatchers.ipynb @@ -12,13 +12,14 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import jax.numpy as jnp\n", "import pytest\n", "from jax import vmap\n", + "\n", "from lcm.dispatchers import productmap, spacemap, vmap_1d" ] }, @@ -33,7 +34,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -43,7 +44,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -52,7 +53,7 @@ "Array([1. , 1.25, 1.5 , 1.75, 2. ], dtype=float32)" ] }, - "execution_count": 3, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -77,7 +78,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -86,7 +87,7 @@ "Array([1. , 1.25, 1.5 , 1.75, 2. ], dtype=float32)" ] }, - "execution_count": 4, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -97,7 +98,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -117,7 +118,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -126,7 +127,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -135,7 +136,7 @@ "Array([1. , 1.25, 1.5 , 1.75, 2. ], dtype=float32)" ] }, - "execution_count": 7, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -156,7 +157,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -166,7 +167,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -178,7 +179,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -187,7 +188,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -202,7 +203,7 @@ " [ 2, 3, 4, 5]]], dtype=int32)" ] }, - "execution_count": 11, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -214,7 +215,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -223,7 +224,7 @@ "(2, 3, 4)" ] }, - "execution_count": 12, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -269,10 +270,13 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ + "from lcm import DiscreteGrid, LinspaceGrid, Model\n", + "\n", + "\n", "def utility(consumption, retirement, lagged_retirement, wealth):\n", " working = 1 - retirement\n", " retirement_habit = lagged_retirement * wealth\n", @@ -283,48 +287,38 @@ " return jnp.logical_or(retirement == 1, lagged_retirement == 0)\n", "\n", "\n", - "MODEL_CONFIG = {\n", - " \"functions\": {\n", + "model = Model(\n", + " functions={\n", " \"utility\": utility,\n", " \"next_lagged_retirement\": lambda retirement: retirement,\n", " \"next_wealth\": lambda wealth, consumption: wealth - consumption,\n", " \"absorbing_retirement_filter\": absorbing_retirement_filter,\n", " },\n", - " \"choices\": {\n", - " \"retirement\": {\"options\": [0, 1]},\n", - " \"consumption\": {\n", - " \"grid_type\": \"linspace\",\n", - " \"start\": 1,\n", - " \"stop\": 2,\n", - " \"n_points\": 2,\n", - " },\n", + " n_periods=1,\n", + " choices={\n", + " \"retirement\": DiscreteGrid([0, 1]),\n", + " \"consumption\": LinspaceGrid(start=1, stop=2, n_points=2),\n", " },\n", - " \"states\": {\n", - " \"lagged_retirement\": {\"options\": [0, 1]},\n", - " \"wealth\": {\n", - " \"grid_type\": \"linspace\",\n", - " \"start\": 1,\n", - " \"stop\": 4,\n", - " \"n_points\": 4,\n", - " },\n", + " states={\n", + " \"lagged_retirement\": DiscreteGrid([0, 1]),\n", + " \"wealth\": LinspaceGrid(start=1, stop=4, n_points=4),\n", " },\n", - " \"n_periods\": 1,\n", - "}" + ")" ] }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ - "from lcm.process_model import process_model\n", + "from lcm.input_processing import process_model\n", "from lcm.state_space import create_state_choice_space\n", "\n", - "model = process_model(user_model=MODEL_CONFIG)\n", + "processed_model = process_model(model)\n", "\n", "sc_space, space_info, state_indexer, segments = create_state_choice_space(\n", - " model,\n", + " processed_model,\n", " period=2,\n", " is_last_period=False,\n", " jit_filter=False,\n", @@ -342,7 +336,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -351,7 +345,7 @@ "{'wealth': Array([1., 2., 3., 4.], dtype=float32)}" ] }, - "execution_count": 15, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -362,7 +356,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -372,7 +366,7 @@ " 'retirement': Array([0, 1, 1], dtype=int32)}" ] }, - "execution_count": 16, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -383,7 +377,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -438,7 +432,7 @@ "2 1 1" ] }, - "execution_count": 17, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -504,7 +498,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -513,7 +507,7 @@ "{'segment_ids': Array([0, 0, 1], dtype=int32), 'num_segments': 2}" ] }, - "execution_count": 18, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -546,7 +540,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -560,7 +554,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -569,7 +563,7 @@ "{'wealth': Array([1., 2., 3., 4.], dtype=float32)}" ] }, - "execution_count": 20, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -580,7 +574,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -590,7 +584,7 @@ " 'retirement': Array([0, 1, 1], dtype=int32)}" ] }, - "execution_count": 21, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -601,7 +595,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -612,7 +606,7 @@ " [ 1. , 2. , 3. , 4. ]], dtype=float32)" ] }, - "execution_count": 22, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -628,7 +622,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -637,7 +631,7 @@ "(3, 4)" ] }, - "execution_count": 23, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -655,7 +649,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -666,7 +660,7 @@ " [ 1. , 2. , 3. , 4. ]], dtype=float32)" ] }, - "execution_count": 24, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -682,10 +676,8 @@ " strict=False,\n", " ),\n", "):\n", - "\n", " # loop over product of dense variables\n", " for j, wealth in enumerate(sc_space.dense_vars[\"wealth\"]):\n", - "\n", " u = utility(\n", " wealth=wealth,\n", " retirement=retirement,\n", @@ -734,7 +726,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -743,7 +735,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -758,7 +750,7 @@ " [ 6.9914646, 7.9914646, 8.991465 , 9.991465 ]]], dtype=float32)" ] }, - "execution_count": 26, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -774,7 +766,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -783,7 +775,7 @@ "(2, 3, 4)" ] }, - "execution_count": 27, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -809,7 +801,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.0" + "version": "3.12.3" } }, "nbformat": 4, diff --git a/explanations/function_representation.ipynb b/explanations/function_representation.ipynb index 179e6bc3..0e89ddb5 100644 --- a/explanations/function_representation.ipynb +++ b/explanations/function_representation.ipynb @@ -72,12 +72,14 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import jax.numpy as jnp\n", "\n", + "from lcm import DiscreteGrid, LinspaceGrid, Model\n", + "\n", "\n", "def utility(consumption, working, disutility_of_work):\n", " return jnp.log(consumption) - disutility_of_work * working\n", @@ -107,12 +109,13 @@ " return consumption <= wealth\n", "\n", "\n", - "model = {\n", - " \"description\": (\n", + "model = Model(\n", + " description=(\n", " \"Starts from Iskhakov et al. (2017), removes filters and the lagged_retirement \"\n", " \"state, and adds a wage function that depends on age.\"\n", " ),\n", - " \"functions\": {\n", + " n_periods=2,\n", + " functions={\n", " \"utility\": utility,\n", " \"next_wealth\": next_wealth,\n", " \"consumption_constraint\": consumption_constraint,\n", @@ -121,25 +124,14 @@ " \"wage\": wage,\n", " \"age\": age,\n", " },\n", - " \"choices\": {\n", - " \"retirement\": {\"options\": [0, 1]},\n", - " \"consumption\": {\n", - " \"grid_type\": \"linspace\",\n", - " \"start\": 1,\n", - " \"stop\": 400,\n", - " \"n_points\": 20,\n", - " },\n", + " choices={\n", + " \"retirement\": DiscreteGrid([0, 1]),\n", + " \"consumption\": LinspaceGrid(start=1, stop=400, n_points=20),\n", " },\n", - " \"states\": {\n", - " \"wealth\": {\n", - " \"grid_type\": \"linspace\",\n", - " \"start\": 1,\n", - " \"stop\": 400,\n", - " \"n_points\": 10,\n", - " },\n", + " states={\n", + " \"wealth\": LinspaceGrid(start=1, stop=400, n_points=10),\n", " },\n", - " \"n_periods\": 2,\n", - "}\n", + ")\n", "\n", "\n", "params = {\n", @@ -161,7 +153,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -173,7 +165,7 @@ } ], "source": [ - "from lcm.process_model import process_model\n", + "from lcm.input_processing import process_model\n", "\n", "processed_model = process_model(model)" ] @@ -191,7 +183,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -200,7 +192,7 @@ "" ] }, - "execution_count": 3, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -224,7 +216,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -256,7 +248,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -265,7 +257,7 @@ "dict_keys(['retirement', 'wealth', 'consumption'])" ] }, - "execution_count": 5, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -276,7 +268,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -308,7 +300,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -317,7 +309,7 @@ "(10,)" ] }, - "execution_count": 7, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -329,7 +321,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -338,7 +330,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -368,9 +360,9 @@ { "data": { "text/html": [ - "