Skip to content

feat(rl): improve training performance, logging, and run comparability - #193

Open
FelixReite wants to merge 36 commits into
base/RLfrom
feature/RL
Open

feat(rl): improve training performance, logging, and run comparability#193
FelixReite wants to merge 36 commits into
base/RLfrom
feature/RL

Conversation

@FelixReite

Copy link
Copy Markdown
Collaborator

No description provided.

Your Name and others added 30 commits June 7, 2026 12:19
…bot controller to APPRemoteControl only for rl_supervisor.
Introduced ready for training flag for increased initial training data size
Optimized GAE calculation to be O(n)
Placing Robot at random locations on the track
Updated hyperparameters for more robust training from scratch (Lowered Regularization, Increased starting experimentation std_dev)
Changed storage of weight only (h5 format), for compatibility
Reshape advantages from (batch,) to (batch, 1) to prevent
unintended broadcasting in the actor and critic loss calculations.
Also convert generated training arrays to float32.
Pass the agent's current standard deviation directly to the actor
gradient calculation. This keeps action sampling and probability
recalculation consistent and prevents incorrect PPO probability ratios.
Record the total reward only once per episode instead of once per
mini-batch. Average the actor and critic losses across all training
steps of an episode.
Calculate generalized advantage estimates in a single backward pass,
reducing the runtime from O(n²) to O(n).
Normalize advantages for actor updates while keeping raw advantages
for critic training.

Prevent the agent from collecting rewards on the ignored start line.
Initialize the actor output layer with zero weights so a fresh policy
starts with a neutral steering mean instead of a random turn.
End episodes after eight consecutive no-line samples and avoid repeated penalties during line-loss detection.
Cycle through straight and curved start poses in both directions.
Enable Webots performance options, remove an unused tensor conversion,
and update the trained actor and critic model weights.
Initialize the training log once per agent run and append only the latest
episode result during training to avoid rewriting the full history each time.
Remove the fixed optimalThreadCount setting because running the simulation
with multiple threads caused unreliable logging behavior.
Store training metrics and run configuration in timestamped run directories.
Update plotting scripts to select a run explicitly via --run.
Separate training update and episode counters in RL logs.
Add mean episode steps to training metrics for better run comparison.
Aggregate action diagnostics per episode before plotting scores by training update.
Add compare_runs.py to compare multiple logged training runs, including metric
plots and a run configuration diff for changed parameters.
Add parallel_runs.py to start isolated Webots RL runs with separate
ports, logs, models, process logs, and PlatformIO build directories.

Allow run configs to define per-run hyperparameters and pass them through the
supervisor into the agent. Extend comparison support for training_runs
experiments and document the parallel run workflow.
Filter all-zero line sensor frames after episode resets until the first
non-zero sensor sample starts the next episode.

This keeps reset-time sensor artifacts out of the training data and diagnostics.
Replace the training reward log value with the mean reward of completed
episodes in each training update.

This makes reward comparisons less dependent on the number of collected
transitions.
@FelixReite
FelixReite requested a review from hoeftjch July 13, 2026 08:36
@FelixReite FelixReite closed this Jul 13, 2026
@FelixReite FelixReite reopened this Jul 13, 2026
Update license headers and add the standard section structure to previously unstructured RL supervisor scripts.
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.

2 participants