From b2639c31615e86f498d568e45fddc152a95cdab0 Mon Sep 17 00:00:00 2001 From: Matthew Huebert Date: Fri, 8 Nov 2024 16:09:10 +0100 Subject: [PATCH 1/4] use genstudio v2024.11.006 --- .../probcomp-localization-tutorial.py | 16 ++++++++-------- poetry.lock | 17 +++++++++++------ pyproject.toml | 2 +- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/genjax-localization-tutorial/probcomp-localization-tutorial.py b/genjax-localization-tutorial/probcomp-localization-tutorial.py index 3b31812..4d8ea2e 100644 --- a/genjax-localization-tutorial/probcomp-localization-tutorial.py +++ b/genjax-localization-tutorial/probcomp-localization-tutorial.py @@ -797,7 +797,7 @@ def animate_path_with_confidence(path: Pose, motion_settings: dict): + Plot.color_map({"some pose": "green", "with heading modified": "red"}) + Plot.title("Modifying a heading") ) - | html("span.tc", f"score ratio: {rotated_trace_weight_diff}") + | html(["span.tc", f"score ratio: {rotated_trace_weight_diff}"]) ) # %% [markdown] @@ -824,7 +824,7 @@ def animate_path_with_confidence(path: Pose, motion_settings: dict): for pose in path_from_trace(trace) ] + Plot.color_map({"some path": "green", "with heading modified": "red"}) -) | html("span.tc", f"score ratio: {rotated_first_step_weight_diff}") +) | html(["span.tc", f"score ratio: {rotated_first_step_weight_diff}"]) # %% [markdown] # ### Ideal sensors @@ -1161,13 +1161,13 @@ def plt(readings): sample, log_weight = model_importance( sub_key, constraints_low_deviation, (motion_settings_low_deviation,) ) -animate_full_trace(sample) | html("span.tc", f"log_weight: {log_weight}") +animate_full_trace(sample) | html(["span.tc", f"log_weight: {log_weight}"]) # %% key, sub_key = jax.random.split(key) sample, log_weight = model_importance( sub_key, constraints_high_deviation, (motion_settings_high_deviation,) ) -animate_full_trace(sample) | html("span.tc", f"log_weight: {log_weight}") +animate_full_trace(sample) | html(["span.tc", f"log_weight: {log_weight}"]) # %% [markdown] # A trace resulting from a call to `importance` is structurally indistinguishable from one drawn from `simulate`. But there is a key situational difference: while `get_score` always returns the frequency with which `simulate` stochastically produces the trace, this value is **no longer equal to** the frequency with which the trace is stochastically produced by `importance`. This is both true in an obvious and less relevant sense, as well as true in a more subtle and extremely germane sense. # @@ -1248,9 +1248,9 @@ def constraint_from_path(path): Plot.Row( *[ ( - html("div.f3.b.tc", title) + html(["div.f3.b.tc", title]) | animate_full_trace(trace, frame_key="frame") - | html("span.tc", f"score: {score:,.2f}") + | html(["span.tc", f"score: {score:,.2f}"]) ) for (title, trace, motion_settings, score) in [ [ @@ -1267,7 +1267,7 @@ def constraint_from_path(path): ], ] ] -) | Plot.Slider("frame", 0, T, fps=2) +) | Plot.Slider("frame", 0, T-1, fps=2) # %% [markdown] # ...more closely resembles the density of these data back-fitted onto any other typical (random) paths of the model... @@ -1748,7 +1748,7 @@ def path_comparison_plot(*plots): motion_settings_high_deviation, frame_key="frame", ), -) | Plot.Slider("frame", 0, T - 1, fps=2) +) | Plot.Slider("frame", 0, T, fps=2) # %% diff --git a/poetry.lock b/poetry.lock index cfcb83f..0f14072 100644 --- a/poetry.lock +++ b/poetry.lock @@ -546,6 +546,13 @@ files = [ {file = "dm_tree-0.1.8-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fa42a605d099ee7d41ba2b5fb75e21423951fd26e5d50583a00471238fb3021d"}, {file = "dm_tree-0.1.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:83b7764de0d855338abefc6e3ee9fe40d301668310aa3baea3f778ff051f4393"}, {file = "dm_tree-0.1.8-cp311-cp311-win_amd64.whl", hash = "sha256:a5d819c38c03f0bb5b3b3703c60e4b170355a0fc6b5819325bf3d4ceb3ae7e80"}, + {file = "dm_tree-0.1.8-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:ea9e59e0451e7d29aece402d9f908f2e2a80922bcde2ebfd5dcb07750fcbfee8"}, + {file = "dm_tree-0.1.8-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:94d3f0826311f45ee19b75f5b48c99466e4218a0489e81c0f0167bda50cacf22"}, + {file = "dm_tree-0.1.8-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:435227cf3c5dc63f4de054cf3d00183790bd9ead4c3623138c74dde7f67f521b"}, + {file = "dm_tree-0.1.8-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:09964470f76a5201aff2e8f9b26842976de7889300676f927930f6285e256760"}, + {file = "dm_tree-0.1.8-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:75c5d528bb992981c20793b6b453e91560784215dffb8a5440ba999753c14ceb"}, + {file = "dm_tree-0.1.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c0a94aba18a35457a1b5cd716fd7b46c5dafdc4cf7869b4bae665b91c4682a8e"}, + {file = "dm_tree-0.1.8-cp312-cp312-win_amd64.whl", hash = "sha256:96a548a406a6fb15fe58f6a30a57ff2f2aafbf25f05afab00c8f5e5977b6c715"}, {file = "dm_tree-0.1.8-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8c60a7eadab64c2278861f56bca320b2720f163dca9d7558103c3b77f2416571"}, {file = "dm_tree-0.1.8-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:af4b3d372f2477dcd89a6e717e4a575ca35ccc20cc4454a8a4b6f8838a00672d"}, {file = "dm_tree-0.1.8-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:de287fabc464b8734be251e46e06aa9aa1001f34198da2b6ce07bd197172b9cb"}, @@ -711,13 +718,13 @@ reference = "gcp" [[package]] name = "genstudio" -version = "2024.10.1" +version = "2024.11.6" description = "" optional = false python-versions = ">=3.10,<3.13" files = [ - {file = "genstudio-2024.10.1-py3-none-any.whl", hash = "sha256:c95cffb1e3d9ca8d9424a535ba227c3e8ecbdc95673e907f9da78e89d6c77b3c"}, - {file = "genstudio-2024.10.1.tar.gz", hash = "sha256:279d461dbec2c6d58f27c99216d9199f40f233a7add506f1c909cf48e9aff8e7"}, + {file = "genstudio-2024.11.6-py3-none-any.whl", hash = "sha256:4b0157660022e69aadc408d6b5207ef37bd08cce7668b3092253071b7d8139a9"}, + {file = "genstudio-2024.11.6.tar.gz", hash = "sha256:b21dbdc2a4ba0fd7629fff10eac4f84c50b42f6bb74b599703d8b07335ef6456"}, ] [package.dependencies] @@ -1507,7 +1514,6 @@ files = [ {file = "orjson-3.10.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dbf3c20c6a7db69df58672a0d5815647ecf78c8e62a4d9bd284e8621c1fe5ccb"}, {file = "orjson-3.10.10-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:75c38f5647e02d423807d252ce4528bf6a95bd776af999cb1fb48867ed01d1f6"}, {file = "orjson-3.10.10-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:23458d31fa50ec18e0ec4b0b4343730928296b11111df5f547c75913714116b2"}, - {file = "orjson-3.10.10-cp311-none-win32.whl", hash = "sha256:2787cd9dedc591c989f3facd7e3e86508eafdc9536a26ec277699c0aa63c685b"}, {file = "orjson-3.10.10-cp311-none-win_amd64.whl", hash = "sha256:6514449d2c202a75183f807bc755167713297c69f1db57a89a1ef4a0170ee269"}, {file = "orjson-3.10.10-cp312-cp312-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:8564f48f3620861f5ef1e080ce7cd122ee89d7d6dacf25fcae675ff63b4d6e05"}, {file = "orjson-3.10.10-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c5bf161a32b479034098c5b81f2608f09167ad2fa1c06abd4e527ea6bf4837a9"}, @@ -1544,7 +1550,6 @@ files = [ {file = "orjson-3.10.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a12f2003695b10817f0fa8b8fca982ed7f5761dcb0d93cff4f2f9f6709903fd7"}, {file = "orjson-3.10.10-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:672f9874a8a8fb9bb1b771331d31ba27f57702c8106cdbadad8bda5d10bc1019"}, {file = "orjson-3.10.10-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:1dcbb0ca5fafb2b378b2c74419480ab2486326974826bbf6588f4dc62137570a"}, - {file = "orjson-3.10.10-cp39-none-win32.whl", hash = "sha256:d9bbd3a4b92256875cb058c3381b782649b9a3c68a4aa9a2fff020c2f9cfc1be"}, {file = "orjson-3.10.10-cp39-none-win_amd64.whl", hash = "sha256:766f21487a53aee8524b97ca9582d5c6541b03ab6210fbaf10142ae2f3ced2aa"}, {file = "orjson-3.10.10.tar.gz", hash = "sha256:37949383c4df7b4337ce82ee35b6d7471e55195efa7dcb45ab8226ceadb0fe3b"}, ] @@ -2665,4 +2670,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = ">=3.11,<3.13" -content-hash = "42925b13162b17dff6f9ac5a701991d53a8de8a7f653847c1b18ae6d3a480d1b" +content-hash = "479f69b6629a460a005289181202b72c2bbecef3b2dce37a765c9c1f62be05f4" diff --git a/pyproject.toml b/pyproject.toml index d53ba76..da72b31 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ package-mode = false python = ">=3.11,<3.13" jupytext = "^1.16.1" genjax = {version = "0.7.0.post4.dev0+eacb241e" , source = "gcp" } -genstudio = {version = "2024.10.1", source = "gcp"} +genstudio = {version = "2024.11.006", source = "gcp"} ipykernel = "^6.29.3" matplotlib = "^3.8.3" anywidget = "^0.9.7" From 52a5067c6e8b1182120bce86ae486f2a48e233b7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 8 Nov 2024 15:13:22 +0000 Subject: [PATCH 2/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- genjax-localization-tutorial/probcomp-localization-tutorial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/genjax-localization-tutorial/probcomp-localization-tutorial.py b/genjax-localization-tutorial/probcomp-localization-tutorial.py index 4d8ea2e..3ee4d3b 100644 --- a/genjax-localization-tutorial/probcomp-localization-tutorial.py +++ b/genjax-localization-tutorial/probcomp-localization-tutorial.py @@ -1267,7 +1267,7 @@ def constraint_from_path(path): ], ] ] -) | Plot.Slider("frame", 0, T-1, fps=2) +) | Plot.Slider("frame", 0, T - 1, fps=2) # %% [markdown] # ...more closely resembles the density of these data back-fitted onto any other typical (random) paths of the model... From fab298da989e606b3c27f7e162a65cd0131e8033 Mon Sep 17 00:00:00 2001 From: Matthew Huebert Date: Tue, 12 Nov 2024 17:59:19 +0100 Subject: [PATCH 3/4] use genstudio v2024.11.012 --- .../probcomp-localization-tutorial.py | 2 +- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/genjax-localization-tutorial/probcomp-localization-tutorial.py b/genjax-localization-tutorial/probcomp-localization-tutorial.py index 3ee4d3b..d688100 100644 --- a/genjax-localization-tutorial/probcomp-localization-tutorial.py +++ b/genjax-localization-tutorial/probcomp-localization-tutorial.py @@ -1267,7 +1267,7 @@ def constraint_from_path(path): ], ] ] -) | Plot.Slider("frame", 0, T - 1, fps=2) +) | Plot.Slider("frame", 0, T, fps=2) # %% [markdown] # ...more closely resembles the density of these data back-fitted onto any other typical (random) paths of the model... diff --git a/poetry.lock b/poetry.lock index 0f14072..2afa41e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -718,13 +718,13 @@ reference = "gcp" [[package]] name = "genstudio" -version = "2024.11.6" +version = "2024.11.12" description = "" optional = false python-versions = ">=3.10,<3.13" files = [ - {file = "genstudio-2024.11.6-py3-none-any.whl", hash = "sha256:4b0157660022e69aadc408d6b5207ef37bd08cce7668b3092253071b7d8139a9"}, - {file = "genstudio-2024.11.6.tar.gz", hash = "sha256:b21dbdc2a4ba0fd7629fff10eac4f84c50b42f6bb74b599703d8b07335ef6456"}, + {file = "genstudio-2024.11.12-py3-none-any.whl", hash = "sha256:068ddddc29615b0919eeec5a6a0996875ed6e07ef3e653fecefa57ce34674874"}, + {file = "genstudio-2024.11.12.tar.gz", hash = "sha256:d750fa1b9f4c6ca42d12187472fc6eabffef4dd14f4f3215c4d499b65087a3f0"}, ] [package.dependencies] @@ -2670,4 +2670,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = ">=3.11,<3.13" -content-hash = "479f69b6629a460a005289181202b72c2bbecef3b2dce37a765c9c1f62be05f4" +content-hash = "a2b82d8c7045142b1654fbd425ea02e2a46fe75c32865143eeb26a1c889cfee4" diff --git a/pyproject.toml b/pyproject.toml index da72b31..abf81d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ package-mode = false python = ">=3.11,<3.13" jupytext = "^1.16.1" genjax = {version = "0.7.0.post4.dev0+eacb241e" , source = "gcp" } -genstudio = {version = "2024.11.006", source = "gcp"} +genstudio = {version = "2024.11.012", source = "gcp"} ipykernel = "^6.29.3" matplotlib = "^3.8.3" anywidget = "^0.9.7" From 69ea8661ad2827e646791c6521b62b6fca7c5975 Mon Sep 17 00:00:00 2001 From: Matthew Huebert Date: Tue, 19 Nov 2024 12:00:49 +0100 Subject: [PATCH 4/4] fix heading modified --- .../probcomp-localization-tutorial.py | 2 +- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/genjax-localization-tutorial/probcomp-localization-tutorial.py b/genjax-localization-tutorial/probcomp-localization-tutorial.py index d688100..19f8f56 100644 --- a/genjax-localization-tutorial/probcomp-localization-tutorial.py +++ b/genjax-localization-tutorial/probcomp-localization-tutorial.py @@ -809,7 +809,7 @@ def animate_path_with_confidence(path: Pose, motion_settings: dict): key, sub_key = jax.random.split(key) rotated_first_step, rotated_first_step_weight_diff, _, _ = trace.update( - sub_key, C[0, "steps", "pose", "hd"].set(jnp.pi / 2.0) + sub_key, C[0, "hd"].set(jnp.pi / 2.0) ) # %% diff --git a/poetry.lock b/poetry.lock index 2afa41e..69e4cde 100644 --- a/poetry.lock +++ b/poetry.lock @@ -718,13 +718,13 @@ reference = "gcp" [[package]] name = "genstudio" -version = "2024.11.12" +version = "2024.11.13" description = "" optional = false python-versions = ">=3.10,<3.13" files = [ - {file = "genstudio-2024.11.12-py3-none-any.whl", hash = "sha256:068ddddc29615b0919eeec5a6a0996875ed6e07ef3e653fecefa57ce34674874"}, - {file = "genstudio-2024.11.12.tar.gz", hash = "sha256:d750fa1b9f4c6ca42d12187472fc6eabffef4dd14f4f3215c4d499b65087a3f0"}, + {file = "genstudio-2024.11.13-py3-none-any.whl", hash = "sha256:a69a3c2c2a5120d23bd886f9aaec4043bf3233f876cea3e09b60c49f9292c7ca"}, + {file = "genstudio-2024.11.13.tar.gz", hash = "sha256:61886af685f1c58cc08007fd71fe540e043216c69987f3754ab0cf79f6463d0e"}, ] [package.dependencies] @@ -2670,4 +2670,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = ">=3.11,<3.13" -content-hash = "a2b82d8c7045142b1654fbd425ea02e2a46fe75c32865143eeb26a1c889cfee4" +content-hash = "cd6dead5b8982be73a6500b56424dc543d5640c30270489469aeaab04eb8aef4" diff --git a/pyproject.toml b/pyproject.toml index abf81d3..95175fd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ package-mode = false python = ">=3.11,<3.13" jupytext = "^1.16.1" genjax = {version = "0.7.0.post4.dev0+eacb241e" , source = "gcp" } -genstudio = {version = "2024.11.012", source = "gcp"} +genstudio = {version = "2024.11.013", source = "gcp"} ipykernel = "^6.29.3" matplotlib = "^3.8.3" anywidget = "^0.9.7"