import%20marimo%0A%0A__generated_with%20%3D%20%220.23.9%22%0Aapp%20%3D%20marimo.App(%0A%20%20%20%20width%3D%22medium%22%2C%0A%20%20%20%20app_title%3D%22Experiment%202.9.1%20redux%3A%20deleting%20red%2C%20now%20in%20JAX%22%2C%0A%20%20%20%20css_file%3D%22..%2F..%2Freport.css%22%2C%0A%20%20%20%20auto_download%3D%5B%22html%22%5D%2C%0A)%0A%0Awith%20app.setup(hide_code%3DTrue)%3A%0A%20%20%20%20import%20json%0A%20%20%20%20import%20tempfile%0A%20%20%20%20from%20pathlib%20import%20Path%0A%0A%20%20%20%20import%20marimo%20as%20mo%20%20%23%20noqa%3A%20F401%0A%20%20%20%20import%20matplotlib.pyplot%20as%20plt%0A%20%20%20%20import%20numpy%20as%20np%0A%0A%20%20%20%20from%20sca.colorcube%20import%20plot_latent_disc%0A%20%20%20%20from%20mini.reports%20import%20report_bundle%2C%20use_publisher%0A%20%20%20%20from%20mini.store%20import%20project_store%0A%20%20%20%20from%20mini.temporal%20import%20Dopesheet%2C%20ParamGroup%2C%20Timeline%2C%20plot_timeline%2C%20realize_timeline%0A%20%20%20%20from%20mini.vis%20import%20light_dark%2C%20themed%0A%0A%20%20%20%20use_publisher(report_bundle(__file__))%0A%0A%20%20%20%20%23%20Store%20refs%20published%20by%20experiment.py%20(kept%20in%20sync%20by%20hand).%0A%20%20%20%20METRICS_REF%20%3D%20%22reports%2Fex-2.9.1%2Fmetrics%22%0A%20%20%20%20BEST_EVAL_REF%20%3D%20%22reports%2Fex-2.9.1%2Fbest-eval%22%0A%20%20%20%20DOPESHEET%20%3D%20Path(__file__).parent%20%2F%20%22dopesheet.csv%22%0A%0A%20%20%20%20def%20load_results()%20-%3E%20tuple%5Blist%5Bdict%5D%2C%20dict%5Bstr%2C%20np.ndarray%5D%5D%20%7C%20None%3A%0A%20%20%20%20%20%20%20%20%22%22%22Resolve%20per-seed%20metrics%20and%20the%20best%20run's%20eval%20dump%20from%20the%20store%2C%20or%20None%20if%20unpublished.%22%22%22%0A%20%20%20%20%20%20%20%20store%20%3D%20project_store()%0A%20%20%20%20%20%20%20%20metrics_art%2C%20best_art%20%3D%20store.get_ref(METRICS_REF)%2C%20store.get_ref(BEST_EVAL_REF)%0A%20%20%20%20%20%20%20%20if%20metrics_art%20is%20None%20or%20best_art%20is%20None%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20None%0A%20%20%20%20%20%20%20%20with%20tempfile.TemporaryDirectory()%20as%20d%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20metrics%20%3D%20json.loads(store.get(metrics_art%2C%20Path(d)%20%2F%20%22metrics.json%22).read_text())%0A%20%20%20%20%20%20%20%20%20%20%20%20with%20np.load(store.get(best_art%2C%20Path(d)%20%2F%20%22best.npz%22))%20as%20z%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20best%20%3D%20dict(z)%0A%20%20%20%20%20%20%20%20return%20metrics%2C%20best%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%20Experiment%202.9.1%20redux%3A%20deleting%20*red*%2C%20now%20in%20JAX%0A%0A%20%20%20%20This%20is%20a%20port%20of%20%5Bex-preppy%5D(https%3A%2F%2Fgithub.com%2Fz0u%2Fex-preppy)%20experiment%0A%20%20%20%202.9.1%20(M1%2C%20autoencoders)%2C%20run%20as%20an%20end-to-end%20test%20of%20this%20repo's%0A%20%20%20%20infrastructure%20before%20the%20M2%20transformer%20experiments.%20It%20re-answers%20M1's%0A%20%20%20%20question%3A%20if%20Sparse%20Concept%20Anchoring%20pins%20*red*%20to%20one%20latent%20axis%20during%0A%20%20%20%20training%2C%20does%20zeroing%20that%20axis%20delete%20red%2C%20and%20only%20red%3F%0A%0A%20%20%20%20The%20model%20is%20a%20small%20autoencoder%3A%20it%20compresses%20each%20RGB%20color%20down%20to%20a%0A%20%20%20%205-dimensional%20vector%20(the%20bottleneck)%20and%20reconstructs%20the%20color%20from%20that%0A%20%20%20%20vector%20alone.%20Training%20adds%20four%20regularizers%5B%5Eregularizer%5D%20on%20the%0A%20%20%20%20bottleneck%2C%20which%20is%20unit-normalized%20so%20every%20latent%20vector%20lands%20on%20the%0A%20%20%20%20surface%20of%20a%20hypersphere%3A%20anchor%20pulls%20red-labeled%20samples%20toward%20one%20fixed%0A%20%20%20%20axis%20(e%E2%82%80)%2C%20anti-anchor%20pushes%20everything%20away%20from%20the%20opposite%20point%0A%20%20%20%20(%E2%88%92e%E2%82%80)%2C%20separate%20spreads%20samples%20within%20a%20batch%20apart%20from%20each%20other%2C%20and%0A%20%20%20%20anti-subspace%20pushes%20everything%20away%20from%20axis%200%20in%20general.%20The%20red%20label%0A%20%20%20%20itself%20is%20sparse%20and%20noisy%3A%20even%20a%20pure%20red%20sample%20only%20gets%20labeled%20%22red%22%0A%20%20%20%20with%20probability%200.08%20per%20draw.%0A%0A%20%20%20%20After%20training%2C%20we%20ablate%20(zero%20out)%20axis%200%20and%20reconstruct%20every%20color%2C%0A%20%20%20%20then%20score%20the%20run%20by%20how%20tightly%20each%20color's%20post-ablation%0A%20%20%20%20reconstruction%20error%20tracks%20its%20HSV%20similarity%20to%20red.%20The%20score%20is%20R%C2%B2%2C%0A%20%20%20%20which%20runs%20from%200%20(no%20relationship)%20to%201%20(a%20perfect%20linear%20fit)%3A%20a%20value%0A%20%20%20%20near%201%20means%20the%20deletion%20was%20clean%2C%20with%20error%20scaling%20with%20redness%20and%0A%20%20%20%20colors%20unlike%20red%20left%20untouched.%0A%0A%20%20%20%20This%20is%20a%20report%3A%20it%20reads%20results%20the%20experiment%20already%20produced.%20The%0A%20%20%20%20experiment%20itself%20is%20%5B%60experiment.py%60%5D(.%2Fexperiment.py)%2C%20a%20%60main(ctx)%60%20DAG%0A%20%20%20%20driven%20from%20the%20CLI%20%E2%80%94%2016%20seeded%20runs%20fanned%20out%20on%20Modal%20CPU%20containers%3A%0A%0A%20%20%20%20%60%60%60bash%0A%20%20%20%20bin%2Fmini%20run%20docs%2Fm1%2Fex-2.9.1%2Fexperiment.py%20--app%20modal%20--max-containers%208%0A%20%20%20%20%60%60%60%0A%0A%20%20%20%20The%20port%20is%20lighter%20than%20the%20original%3A%20the%20PyTorch%2FLightning%20machinery%0A%20%20%20%20becomes%20a%20pytree%20and%20one%20%60lax.scan%60%2C%2016%20seeds%20replace%2060%2C%20validation%0A%20%20%20%20happens%20only%20at%20the%20end%2C%20and%20we%20test%20ablation%20only%20(no%20pruning%20or%0A%20%20%20%20suppression%20conditions).%20The%20dopesheet%20is%20identical%20to%20the%20original%2C%20so%0A%20%20%20%20the%20same%20%60mini.temporal%60%20machinery%20interprets%20it%20unchanged.%0A%0A%20%20%20%20%5B%5Eregularizer%5D%3A%20An%20extra%20term%20added%20to%20the%20training%20loss%2C%20alongside%20the%0A%20%20%20%20main%20reconstruction%20objective%2C%20that%20shapes%20the%20geometry%20of%20the%20latent%0A%20%20%20%20space%20without%20changing%20what%20the%20model%20is%20fundamentally%20trying%20to%20do.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20loaded%20%3D%20load_results()%0A%20%20%20%20return%20(loaded%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(loaded)%3A%0A%20%20%20%20mo.stop(%0A%20%20%20%20%20%20%20%20loaded%20is%20None%2C%0A%20%20%20%20%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20%20%20%20%20%22No%20results%20yet%20%E2%80%94%20run%20the%20experiment%20(it%20publishes%20metrics%20to%20the%20store%20on%20completion)%3A%5Cn%5Cn%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%22%60%60%60bash%5Cnbin%2Fmini%20run%20docs%2Fm1%2Fex-2.9.1%2Fexperiment.py%20--app%20modal%20--max-containers%208%5Cn%60%60%60%22%0A%20%20%20%20%20%20%20%20)%2C%0A%20%20%20%20)%0A%20%20%20%20metrics%2C%20best_eval%20%3D%20loaded%0A%20%20%20%20best%20%3D%20max(metrics%2C%20key%3Dlambda%20m%3A%20m%5B%22score%22%5D)%0A%20%20%20%20scores%20%3D%20%5Bm%5B%22score%22%5D%20for%20m%20in%20metrics%5D%0A%20%20%20%20mo.md(f%22%22%22%0A%20%20%20%20%7Blen(metrics)%7D%20runs%20completed.%20Scores%20range%20%7Bmin(scores)%3A.2f%7D%E2%80%93%7Bmax(scores)%3A.2f%7D%0A%20%20%20%20(median%20%7Bnp.median(scores)%3A.2f%7D)%3A%20anchoring%20quality%20depends%20on%20the%20seed%2C%20as%20it%20did%20in%0A%20%20%20%20the%20original.%20The%20best%20run%20is%20seed%20%7Bbest%5B%22seed%22%5D%7D%20with%20score%20**%7Bbest%5B%22score%22%5D%3A.3f%7D**%2C%20in%0A%20%20%20%20line%20with%20the%20original's%20best%20of%200.985%20over%2060%20seeds.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%20best%2C%20best_eval%2C%20metrics%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20The%20schedule%0A%0A%20%20%20%20Training%20uses%20a%20%5Bdopesheet%5D(.%2Fdopesheet.csv)%3A%20a%20table%20of%20keyframes%20for%0A%20%20%20%20the%20regularizer%20weights%20and%20the%20learning%20rate%2C%20much%20like%20an%20animator's%0A%20%20%20%20keyframe%20track.%20%60mini.temporal%60%20interpolates%20between%20keyframes%20with%20a%0A%20%20%20%20minimum-jerk%20curve%2C%20which%20eases%20values%20in%20and%20out.%20Everything%20ramps%20to%0A%20%20%20%20zero%20by%20step%201425%2C%20leaving%20the%20last%2075%20steps%20as%20pure%20reconstruction%0A%20%20%20%20fine-tuning.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20_sheet%20%3D%20Dopesheet.from_csv(DOPESHEET)%0A%20%20%20%20_history%20%3D%20realize_timeline(Timeline(_sheet))%0A%0A%20%20%20%20%40themed(%0A%20%20%20%20%20%20%20%20name%3D%22schedule%22%2C%0A%20%20%20%20%20%20%20%20alt_text%3D%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20Two%20stacked%20line%20charts%20of%20hyperparameter%20values%20against%20training%20step.%20Top%3A%20the%20four%0A%20%20%20%20%20%20%20%20%20%20%20%20regularizer%20weights%20%E2%80%94%20anti-subspace%20starts%20high%20at%200.25%20and%20eases%20down%3B%20anchor%20and%0A%20%20%20%20%20%20%20%20%20%20%20%20anti-anchor%20ramp%20up%20over%20the%20first%20250%20steps%3B%20all%20four%20reach%20zero%20by%20step%201425.%20Bottom%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20the%20learning%20rate%20ramps%20from%20near%20zero%20to%200.1%20by%20step%20750%2C%20holds%2C%20then%20anneals%20to%200.05.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20)%0A%20%20%20%20def%20_plot()%20-%3E%20plt.Figure%3A%0A%20%20%20%20%20%20%20%20fig%2C%20_%20%3D%20plot_timeline(%0A%20%20%20%20%20%20%20%20%20%20%20%20_history%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20_sheet.as_df()%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20groups%3D%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ParamGroup(name%3D%22Regularizer%20weights%22%2C%20params%3D%5B%22separate%22%2C%20%22anchor%22%2C%20%22anti-anchor%22%2C%20%22anti-subspace%22%5D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ParamGroup(name%3D%22Learning%20rate%22%2C%20params%3D%5B%22lr%22%5D%2C%20height_ratio%3D0.6)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20title%3D%22Hyperparameter%20schedule%20(from%20the%20original%202.9.1%20dopesheet)%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20show_phase_labels%3DFalse%2C%20%20%23%20one%20phase%3B%20the%20label%20only%20collides%20with%20the%20title%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20fig.set_size_inches(9.5%2C%205)%0A%20%20%20%20%20%20%20%20return%20fig%0A%0A%20%20%20%20mo.Html(_plot())%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Scores%20across%20seeds%0A%0A%20%20%20%20Each%20run%20trains%20from%20the%20same%20schedule%20but%20a%20different%20seed%2C%20and%20outcomes%0A%20%20%20%20vary%20substantially%20with%20the%20starting%20point.%20That%20matches%20the%20original%2C%0A%20%20%20%20which%20handled%20the%20variance%20with%20a%2060-seed%20sweep%20and%20selection%20along%20a%0A%20%20%20%20Pareto%20frontier%20(the%20best%20trade-offs%20across%20several%20objectives).%20We%20keep%0A%20%20%20%20the%20same%20shape%20at%20smaller%20scale%3A%20sweep%20the%20seeds%2C%20then%20take%20the%20best%0A%20%20%20%20scorer.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(best%2C%20metrics)%3A%0A%20%20%20%20%40themed(%0A%20%20%20%20%20%20%20%20name%3D%22scores%22%2C%0A%20%20%20%20%20%20%20%20alt_text%3D%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20Dot%20plot%20of%20ablation%20score%20by%20seed%20for%2016%20runs.%20Most%20seeds%20score%20between%200.7%20and%201.0%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20a%20few%20fall%20lower%2C%20and%20the%20best%20seed%20is%20circled%20at%20the%20top%20of%20the%20range.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20)%0A%20%20%20%20def%20_plot()%20-%3E%20plt.Figure%3A%0A%20%20%20%20%20%20%20%20fig%2C%20ax%20%3D%20plt.subplots(figsize%3D(7%2C%203))%0A%20%20%20%20%20%20%20%20seeds%20%3D%20%5Bm%5B%22seed%22%5D%20for%20m%20in%20metrics%5D%0A%20%20%20%20%20%20%20%20scores%20%3D%20%5Bm%5B%22score%22%5D%20for%20m%20in%20metrics%5D%0A%20%20%20%20%20%20%20%20ax.scatter(seeds%2C%20scores%2C%20color%3D%22tab%3Ablue%22%2C%20s%3D30)%0A%20%20%20%20%20%20%20%20ax.scatter(%5Bbest%5B%22seed%22%5D%5D%2C%20%5Bbest%5B%22score%22%5D%5D%2C%20s%3D140%2C%20facecolors%3D%22none%22%2C%20edgecolors%3D%22tab%3Ared%22)%0A%20%20%20%20%20%20%20%20ax.annotate(%22best%22%2C%20(best%5B%22seed%22%5D%2C%20best%5B%22score%22%5D)%2C%20xytext%3D(0%2C%20-16)%2C%20textcoords%3D%22offset%20points%22%2C%20ha%3D%22center%22)%0A%20%20%20%20%20%20%20%20ax.set(xlabel%3D%22seed%22%2C%20ylabel%3D%22score%20(R%C2%B2%2C%20error%20vs.%20similarity)%22%2C%20ylim%3D(0%2C%201.05))%0A%20%20%20%20%20%20%20%20ax.set_xticks(seeds)%0A%20%20%20%20%20%20%20%20ax.grid(alpha%3D0.3)%0A%20%20%20%20%20%20%20%20return%20fig%0A%0A%20%20%20%20mo.Html(_plot())%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Was%20the%20deletion%20clean%3F%0A%0A%20%20%20%20For%20the%20best%20run%2C%20we%20ablate%20latent%20axis%200%20and%20reconstruct%20the%20full%208%C3%978%C3%978%0A%20%20%20%20RGB%20grid.%20If%20the%20anchored%20concept%20was%20fully%20contained%20in%20that%20axis%2C%20the%0A%20%20%20%20damage%20should%20be%20proportional%20to%20each%20color's%20similarity%20to%20red%2C%20and%20colors%0A%20%20%20%20unlike%20red%20should%20be%20untouched.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(best%2C%20best_eval)%3A%0A%20%20%20%20%40themed(%0A%20%20%20%20%20%20%20%20name%3D%22error-vs-similarity%22%2C%0A%20%20%20%20%20%20%20%20alt_text%3D%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20Scatter%20plot%20of%20post-ablation%20reconstruction%20error%20against%20cubed%20HSV%20similarity%20to%20red%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20one%20point%20per%20grid%20color%2C%20each%20drawn%20in%20its%20own%20color.%20Points%20fall%20close%20to%20a%20straight%0A%20%20%20%20%20%20%20%20%20%20%20%20line%20from%20the%20origin%3A%20gray%2C%20blue%2C%20and%20green%20points%20cluster%20at%20zero%20error%2C%20while%20red%20and%0A%20%20%20%20%20%20%20%20%20%20%20%20red-adjacent%20points%20climb%20to%20the%20highest%20errors.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20)%0A%20%20%20%20def%20_plot()%20-%3E%20plt.Figure%3A%0A%20%20%20%20%20%20%20%20fig%2C%20ax%20%3D%20plt.subplots(figsize%3D(7%2C%204))%0A%20%20%20%20%20%20%20%20edge%20%3D%20light_dark(%22%2300000033%22%2C%20%22%23ffffff55%22)%0A%20%20%20%20%20%20%20%20ax.scatter(best_eval%5B%22sim3%22%5D%2C%20best_eval%5B%22mse_abl%22%5D%2C%20c%3Dbest_eval%5B%22rgb%22%5D%2C%20s%3D26%2C%20edgecolors%3Dedge%2C%20lw%3D0.5)%0A%20%20%20%20%20%20%20%20r2%20%3D%20best%5B%22score%22%5D%0A%20%20%20%20%20%20%20%20ax.text(0.05%2C%200.92%2C%20f%22%24R%5E2%24%20%3D%20%7Br2%3A.3f%7D%22%2C%20transform%3Dax.transAxes)%0A%20%20%20%20%20%20%20%20ax.set(xlabel%3D%22similarity%20to%20red%20(angular%20HSV%2C%20cubed)%22%2C%20ylabel%3D%22reconstruction%20MSE%20after%20ablation%22)%0A%20%20%20%20%20%20%20%20ax.grid(alpha%3D0.3)%0A%20%20%20%20%20%20%20%20return%20fig%0A%0A%20%20%20%20mo.Html(_plot())%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(best_eval)%3A%0A%20%20%20%20_mse_base%2C%20_mse_abl%20%3D%20best_eval%5B%22mse_base%22%5D%2C%20best_eval%5B%22mse_abl%22%5D%0A%20%20%20%20_sim%20%3D%20best_eval%5B%22sim3%22%5D%0A%20%20%20%20_reds%2C%20_others%20%3D%20_sim%20%3E%200.5%2C%20_sim%20%3C%200.01%0A%20%20%20%20mo.md(f%22%22%22%0A%20%20%20%20Baseline%20reconstruction%20is%20near-perfect%20(mean%20MSE%20%7B_mse_base.mean()%3A.2e%7D).%20After%20ablation%2C%0A%20%20%20%20red-like%20colors%20(similarity%C2%B3%20%3E%200.5)%20have%20a%20mean%20error%20of%20%7B_mse_abl%5B_reds%5D.mean()%3A.3f%7D%2C%20while%0A%20%20%20%20colors%20unlike%20red%20(similarity%C2%B3%20%3C%200.01%2C%20%7Bint(_others.sum())%7D%20of%20%7Blen(_sim)%7D%20grid%20points)%20sit%0A%20%20%20%20at%20%7B_mse_abl%5B_others%5D.mean()%3A.2e%7D%3A%20deleting%20red%20barely%20affects%20them.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20The%20latent%20geometry%0A%0A%20%20%20%20The%20same%20result%20shows%20up%20in%20the%20bottleneck%20geometry.%20Before%0A%20%20%20%20ablation%2C%20position%20along%20axis%200%20tracks%20similarity%20to%20red%3A%20pure%20red%20sits%0A%20%20%20%20at%201%2C%20blues%2C%20greens%2C%20and%20grays%20sit%20near%200%20(pushed%20off%20the%20axis%20by%20the%0A%20%20%20%20anti-subspace%20term)%2C%20and%20warm%20colors%20fall%20in%20between.%20Ablation%20zeroes%0A%20%20%20%20axis%200%2C%20which%20collapses%20that%20one%20direction%20but%20leaves%20the%20arrangement%20of%0A%20%20%20%20the%20other%20dimensions%20intact.%20That's%20why%20the%20effect%20on%20reconstruction%20is%0A%20%20%20%20proportional%20to%20redness.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(best_eval)%3A%0A%20%20%20%20%40themed(%0A%20%20%20%20%20%20%20%20name%3D%22latents%22%2C%0A%20%20%20%20%20%20%20%20alt_text%3D%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20Two%20disc-shaped%20scatter%20plots%20of%20bottleneck%20latents%2C%20one%20point%20per%20grid%20color%2C%20each%20drawn%0A%20%20%20%20%20%20%20%20%20%20%20%20in%20its%20own%20color%2C%20inside%20a%20circle%20marking%20the%20unit%20hypersphere%20bound.%20The%20anchored%20axis%0A%20%20%20%20%20%20%20%20%20%20%20%20points%20up%2C%20labeled%20(1%2C%200%2C%200%2C%200%2C%200).%20Left%2C%20baseline%3A%20blues%2C%20greens%2C%20and%20grays%20hug%20the%0A%20%20%20%20%20%20%20%20%20%20%20%20horizontal%20diameter%2C%20warm%20colors%20spread%20upward%2C%20and%20pure%20reds%20reach%20the%20top%20of%20the%20circle.%0A%20%20%20%20%20%20%20%20%20%20%20%20Right%2C%20ablated%3A%20every%20point%20sits%20exactly%20on%20the%20horizontal%20diameter%2C%20the%20reds%20folded%20in%0A%20%20%20%20%20%20%20%20%20%20%20%20among%20the%20other%20colors.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20)%0A%20%20%20%20def%20_plot()%20-%3E%20plt.Figure%3A%0A%20%20%20%20%20%20%20%20fig%2C%20axes%20%3D%20plt.subplots(1%2C%202%2C%20figsize%3D(8.5%2C%204.6))%0A%20%20%20%20%20%20%20%20fg%20%3D%20light_dark(%22%23000%22%2C%20%22%23fff%22)%0A%20%20%20%20%20%20%20%20for%20ax%2C%20z%2C%20title%20in%20zip(axes%2C%20(best_eval%5B%22z_base%22%5D%2C%20best_eval%5B%22z_abl%22%5D)%2C%20(%22Baseline%22%2C%20%22Ablated%22)%2C%20strict%3DTrue)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20plot_latent_disc(ax%2C%20z%2C%20best_eval%5B%22rgb%22%5D%2C%20s%3D22)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.set_title(title%2C%20y%3D-0.12)%0A%20%20%20%20%20%20%20%20axes%5B0%5D.plot(%5B0%5D%2C%20%5B1.05%5D%2C%20marker%3D%22v%22%2C%20color%3Dfg%2C%20clip_on%3DFalse)%0A%20%20%20%20%20%20%20%20axes%5B0%5D.annotate(%0A%20%20%20%20%20%20%20%20%20%20%20%20%22(1%2C%200%2C%200%2C%200%2C%200)%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20xy%3D(0%2C%201.1)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20xytext%3D(0%2C%208)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20textcoords%3D%22offset%20points%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20ha%3D%22center%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20va%3D%22bottom%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20annotation_clip%3DFalse%2C%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20return%20fig%0A%0A%20%20%20%20mo.Html(_plot())%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Findings%0A%0A%20%20%20%20The%20result%20reproduces%20M1's%20finding%2C%20but%20the%20point%20of%20this%20run%20was%20the%0A%20%20%20%20plumbing%3A%20the%20same%20dopesheet%20driving%20a%20JAX%20training%20loop%20through%0A%20%20%20%20%60mini.temporal%60%3B%20a%2016-way%20%60ctx.map%60%20fan-out%20on%20Modal%20with%20memoized%2C%0A%20%20%20%20resumable%20records%3B%20artifacts%20and%20refs%20flowing%20through%20the%20store%20to%20this%0A%20%20%20%20report%3B%20and%20%60%40themed%60%20figures%20published%20via%20the%20report%20bundle.%20Training%20a%0A%20%20%20%20single%20seed%20takes%20about%20ten%20seconds%2C%20and%20the%20runs%20are%20bit-identical%0A%20%20%20%20between%20local%20CPU%20and%20Modal.%20So%2C%20the%20infrastructure%20seems%20to%20work.%0A%0A%20%20%20%20Next%3A%20the%20M2%20experiments%20proper%2C%20anchoring%20concepts%20in%20a%20small%20transformer's%0A%20%20%20%20residual%20stream%20on%20the%20color-mixing%20task%20(see%20the%20%5BREADME%5D(..%2F..%2FREADME.md)).%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
528ae5f9c85bcc51ef1a7e206360576d