@@ -797,7 +797,7 @@ def animate_path_with_confidence(path: Pose, motion_settings: dict):
797797 + Plot .color_map ({"some pose" : "green" , "with heading modified" : "red" })
798798 + Plot .title ("Modifying a heading" )
799799 )
800- | html ("span.tc" , f"score ratio: { rotated_trace_weight_diff } " )
800+ | html ([ "span.tc" , f"score ratio: { rotated_trace_weight_diff } " ] )
801801)
802802
803803# %% [markdown]
@@ -824,7 +824,7 @@ def animate_path_with_confidence(path: Pose, motion_settings: dict):
824824 for pose in path_from_trace (trace )
825825 ]
826826 + Plot .color_map ({"some path" : "green" , "with heading modified" : "red" })
827- ) | html ("span.tc" , f"score ratio: { rotated_first_step_weight_diff } " )
827+ ) | html ([ "span.tc" , f"score ratio: { rotated_first_step_weight_diff } " ] )
828828
829829# %% [markdown]
830830# ### Ideal sensors
@@ -1161,13 +1161,13 @@ def plt(readings):
11611161sample , log_weight = model_importance (
11621162 sub_key , constraints_low_deviation , (motion_settings_low_deviation ,)
11631163)
1164- animate_full_trace (sample ) | html ("span.tc" , f"log_weight: { log_weight } " )
1164+ animate_full_trace (sample ) | html ([ "span.tc" , f"log_weight: { log_weight } " ] )
11651165# %%
11661166key , sub_key = jax .random .split (key )
11671167sample , log_weight = model_importance (
11681168 sub_key , constraints_high_deviation , (motion_settings_high_deviation ,)
11691169)
1170- animate_full_trace (sample ) | html ("span.tc" , f"log_weight: { log_weight } " )
1170+ animate_full_trace (sample ) | html ([ "span.tc" , f"log_weight: { log_weight } " ] )
11711171# %% [markdown]
11721172# 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.
11731173#
@@ -1248,9 +1248,9 @@ def constraint_from_path(path):
12481248Plot .Row (
12491249 * [
12501250 (
1251- html ("div.f3.b.tc" , title )
1251+ html ([ "div.f3.b.tc" , title ] )
12521252 | animate_full_trace (trace , frame_key = "frame" )
1253- | html ("span.tc" , f"score: { score :,.2f} " )
1253+ | html ([ "span.tc" , f"score: { score :,.2f} " ] )
12541254 )
12551255 for (title , trace , motion_settings , score ) in [
12561256 [
@@ -1267,7 +1267,7 @@ def constraint_from_path(path):
12671267 ],
12681268 ]
12691269 ]
1270- ) | Plot .Slider ("frame" , 0 , T , fps = 2 )
1270+ ) | Plot .Slider ("frame" , 0 , T - 1 , fps = 2 )
12711271
12721272# %% [markdown]
12731273# ...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):
17481748 motion_settings_high_deviation ,
17491749 frame_key = "frame" ,
17501750 ),
1751- ) | Plot .Slider ("frame" , 0 , T - 1 , fps = 2 )
1751+ ) | Plot .Slider ("frame" , 0 , T , fps = 2 )
17521752
17531753
17541754# %%
0 commit comments