Merge remote changes into main#1
Merged
ludgerpaehler merged 15 commits intomainfrom Apr 20, 2026
Merged
Conversation
Lp/rewrite take2
Refactor the source code to be more cohesive
Phase 0: Fix broken package imports across all movies/ modules.
- __init__.py, algo_policies.py, default_policies.py, generator.py all
referenced 'movies' or 'scripts.movies' instead of
'koopmanrl_utils.movies'; corrected throughout.
Phase 1: Rewrite generate_trajectories.py with tap-based CLI, config
auto-discovery from configurations/<algo>_<env_slug>_hparams.json,
a policy factory supporting zero/random/lqr/skvi/sakc, and optional
.dat export for TikZ ingestion. LinearSystem excluded from supported
plotting targets. CLI values take precedence over config file values.
Phase 2: Implement generate_trajectory_figure.py — static PNG generator
with full trajectory plot (controlled + optional uncontrolled overlay),
optional vector field quiver, coordinate frame with transparent pane
faces and LaTeX axis labels, and .dat export of all plotted data.
DoubleWell's stochastic dynamics are detected and the vector field is
skipped with a warning.
Phase 3: Fix generate_gifs.py — corrects data_folder type annotation
(bool → str), makes ma_window_size properly Optional[int] with env-
specific fallbacks, adds emit_dat flag, and guards the cost GIF render
against division by zero when baseline costs contain zeros.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
generator.py: check_loop_condition() returned step_num < N (wrong sense) so the while-loop never executed when num_steps_per_trajectory was set, producing only the initial state. Changed to step_num >= N to match the None-branch convention (return True = stop). generate_trajectory_figure.py: _compute_vector_field passed grid points as column vectors to env.f(), but FluidFlow.f() feeds state directly to solve_ivp(y0=state) which requires a 1D array. Switched to passing the flat point and a 1D zero action. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tions. Introduces --config_file flag to both soft_actor_koopman_critic.py and soft_koopman_value_iteration.py, enabling hyperparameter loading from the configurations/<algo>_<env_slug>_hparams.json files. CLI flags take precedence over config values; fallback defaults apply when neither is specified. Tested across all 8 best-found configurations (4 envs × 2 algos) with CLI override precedence verified. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a "Using Optimized Hyperparameter Configurations" section that explains the configurations/ directory layout, the --config_file flag, and CLI override precedence for SAKC and SKVI. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move the duplicated load_and_apply_config function from soft_actor_koopman_critic.py and soft_koopman_value_iteration.py into the shared koopmanrl/utils.py, parameterised by key_map and fallbacks so each algorithm retains its own mapping. Bump pre-commit hook versions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Merge in miscellaneous improvements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.