Repository navigation
Headless script: save everything at the end of a run, masks in the extension frame - #102
Conversation
…ub group of the run group Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN84WCxVCr25SiruMKcX
…orner of the field) The slices pasted from the extension were taken as centered and shifted by half the field, so the mask landed in a corner and the algorithms did not converge. The plots stay centered, their mask outline is shifted accordingly. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN84WCxVCr25SiruMKcX
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN84WCxVCr25SiruMKcX
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN84WCxVCr25SiruMKcX
|
CI failure was Generated by Claude Code |
|
The Generated by Claude Code |
…n sub group of the run, with their own savers The groups Fields000 and Metrics000 are enlarged along their own step axis, Final000 holds the fields saved once. They are saved by ModuleSaver children of the ShapingSaver, as the control modules are in the group of an extension. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN84WCxVCr25SiruMKcX
…ave of the extension ContinuousSaver is renamed RunSaver (it saves a whole run). The Input and Target fields of a run are saved with the settings of their loaders by the code of the field files (add_field_group), and the Final group by the one of AlgoApp.save (add_algorithm_group). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN84WCxVCr25SiruMKcX
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN84WCxVCr25SiruMKcX
|
The Generated by Claude Code |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN84WCxVCr25SiruMKcX
…p of the extension saves them All the settings of the loader app (from FieldLoaderApp.params) with the values the script used, plus the settings of the loader. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN84WCxVCr25SiruMKcX
…index); convergence plot script Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN84WCxVCr25SiruMKcX
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN84WCxVCr25SiruMKcX
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN84WCxVCr25SiruMKcX
What
Changes to the algorithm playground (
utilities/headless_algorithms.py,scripts/algorithm_playground.py) and to the layout of the saved files.1. Masks use the frame of the extension (the bug behind the wrong saved output).
The headless
set_masktook the slices as centered on the field and shifted them by half the field. Slices pasted from the extension (origin at the corner of the field) landed in a corner, the target region was driven to zero and the algorithm did not converge (noise output, infinite fitness). Masks are now in the frame of the extension, the same slices work in both. The plots stay centered on the field and the mask outline is shifted accordingly.default_maskreturns the extension frame too.The saving itself was checked: the saved arrays equal the live ones at each step.
2.
save_final(SAVE_FINALin the script): saves all the fields and the metrics of the last iteration once at the end of the run, as the Save action of the extension. It can be used alone or withsave_fieldsandsave_metrics.3. Layout of a run in the file. The group
ShapingXXXof a run (with the settings of the run) holds one sub group per kind of data:Fields: the fields saved at each iteration, enlarged along their ownstepnavigation axis (ownModuleSaverchild ofShapingSaver)Metrics: the metrics, sameFinal: the fields saved once at the end, no navigation axisInputandTarget: the fields as used by the algorithm, with the settings of their loaders, readable withload_field_from_h5Only the sub groups of the requested data are created. This also applies to the continuous saving of the AlgoApp (same saver).
4. Save of the extension and of the AlgoApp use the same layout. The main group is
Shaping(no index) with the settings,Final(algorithm results),SLM,InputandTarget.loadreads this layout and still reads the old one (/RawData/Algorithm,Input,Target,SLMunder/RawData).AlgoApp.savetakes anadd_to_groupcallback used by the extension to add the SLM, Input and Target groups.5. Shared code.
ContinuousSaveris renamedRunSaver(it saves a whole run).add_field_groupandadd_algorithm_groupare used by both the extension Save and the runs.6.
scripts/plot_convergence.py: matplotlib plot of the saved metrics against the iteration.Docs: user guide updated (saved file layout, convergence script).
Tests
tests/test_algorithm_playground.py,tests/test_custom_apps.py: tests ofsave_final, of the sub groups, of the Input and Target groups, of the mask frame and of theShapinglayout of the AlgoApp save; the existing ones adapted. The full test suite passes locally (178 tests). The extension's ownsave/loadare not instantiated by any test.🤖 Generated with Claude Code
https://claude.ai/code/session_01RKuN84WCxVCr25SiruMKcX