Skip to content

Merge remote changes into main#1

Merged
ludgerpaehler merged 15 commits intomainfrom
master
Apr 20, 2026
Merged

Merge remote changes into main#1
ludgerpaehler merged 15 commits intomainfrom
master

Conversation

@ludgerpaehler
Copy link
Copy Markdown
Collaborator

No description provided.

ludgerpaehler and others added 15 commits January 23, 2026 11:30
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>
@ludgerpaehler ludgerpaehler merged commit 2c4f32e into main Apr 20, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant