Skip to content

Reinforcement Learning Module, Part 2#98

Open
gabriel-trigo wants to merge 34 commits intogoogle:copybara_pushfrom
gabriel-trigo:PR_rl2-gabriel
Open

Reinforcement Learning Module, Part 2#98
gabriel-trigo wants to merge 34 commits intogoogle:copybara_pushfrom
gabriel-trigo:PR_rl2-gabriel

Conversation

@gabriel-trigo
Copy link
Contributor

@gabriel-trigo gabriel-trigo commented Jun 11, 2025

Updates the reinforcement learning module to include additional functionality.

Details:

@s2t2 s2t2 changed the title feat: reinforcement learning PR#2; several additions/improvements to rl pipeline Reinforcement Learning Module, Part 2 Jun 12, 2025
@s2t2 s2t2 mentioned this pull request Jun 12, 2025
1 task
Copy link
Collaborator

@s2t2 s2t2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @gabriel-trigo Thanks for the new PR. I have done a first pass review and made some comments. I will pull down the code and update some things to resolve my review comments, and let you know if I have any more comments or questions.

@@ -0,0 +1,268 @@
# -*- coding: utf-8 -*-

This comment was marked as resolved.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gabriel-trigo is the MultiEpisodeWrapper used anywhere?

Copy link
Collaborator

@s2t2 s2t2 Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's move the td3 network logic here, or delete the empty file.

@s2t2

This comment was marked as resolved.

s2t2 pushed a commit to s2t2/sbsim that referenced this pull request Jun 19, 2025
This commit introduces unit tests for parts of the reinforcement learning
code added in PR google#98.

Here's a summary of what I did:
1. I reviewed PR google#98, analyzing changes related to new RL scripts (eval, gin generation), TD3/DDPG agents, and visualization.
2. I fetched the code from PR google#98.
3. I attempted to run the RL scripts:
    - `generate_gin_config_files.py` ran successfully.
    - `train.py` failed with a `TypeError` in `tf_agents.policies.policy_saver.PolicySaver`, which prevented training and a full evaluation of `eval.py`. This indicates an issue with the TF-Agents setup or its usage in the PR.
4. I created unit tests for:
    - `smart_control/reinforcement_learning/scripts/generate_gin_config_files.py`: These tests cover reading the base configuration, substituting parameters, and generating output files.
    - `smart_control/reinforcement_learning/visualization/trajectory_plotter.py`: These tests cover the plotting methods for actions, rewards, and cumulative rewards, including how timestamps and empty data are handled.

The tests for these two modules pass. I didn't pursue further testing of agent-specific code or environment wrappers due to the blocking issue with `train.py` and the TF-Agents environment.
@s2t2 s2t2 force-pushed the PR_rl2-gabriel branch from 51a2d88 to 1d0363f Compare June 23, 2025 20:31
@s2t2 s2t2 force-pushed the PR_rl2-gabriel branch from 8956cfa to e7604b1 Compare July 10, 2025 18:37
@s2t2 s2t2 mentioned this pull request Jul 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants