Commit Graph

195 Commits

Author SHA1 Message Date
Michel Aractingi b29401e4e2 - Refactor observation encoder in modeling_sac.py
- added `torch.compile` to the actor and learner servers.
- organized imports in `train_sac.py`
- optimized the parameters push by not sending the frozen pre-trained encoder.

Co-authored-by: Adil Zouitine <adilzouitinegm@gmail.com>
2025-03-28 17:18:24 +00:00
Yoel faab32fe14 [Port HIL-SERL] Add HF vision encoder option in SAC (#651)
Added support with custom pretrained vision encoder to the modeling sac implementation. Great job @ChorntonYoel !
2025-03-28 17:18:24 +00:00
Michel Aractingi 2023289ce8 Added support for checkpointing the policy. We can save and load the policy state dict, optimizers state, optimization step and interaction step
Added functions for converting the replay buffer from and to LeRobotDataset. When we want to save the replay buffer, we convert it first to LeRobotDataset format and save it locally and vice-versa.

Co-authored-by: Adil Zouitine <adilzouitinegm@gmail.com>
2025-03-28 17:18:24 +00:00
Michel Aractingi 18207d995e - Added additional logging information in wandb around the timings of the policy loop and optimization loop.
- Optimized critic design that improves the performance of the learner loop by a factor of 2
- Cleaned the code and fixed style issues

- Completed the config with actor_learner_config field that contains host-ip and port elemnts that are necessary for the actor-learner servers.

Co-authored-by: Adil Zouitine <adilzouitinegm@gmail.com>
2025-03-28 17:18:24 +00:00
AdilZouitine 83dc00683c Stable version of rlpd + drq 2025-03-28 17:18:24 +00:00
AdilZouitine 5b92465e38 Add type annotations and restructure SACConfig class fields 2025-03-28 17:18:24 +00:00
Adil Zouitine 4b78ab2789 Change SAC policy implementation with configuration and modeling classes 2025-03-28 17:18:24 +00:00
Adil Zouitine bd8c768f62 SAC works 2025-03-28 17:18:24 +00:00
Adil Zouitine 1e9bafc852 [WIP] correct sac implementation 2025-03-28 17:18:24 +00:00
Adil Zouitine 921ed960fb Add rlpd tricks 2025-03-28 17:18:24 +00:00
Adil Zouitine 67b64e445b SAC works 2025-03-28 17:18:24 +00:00
Adil Zouitine 6c8023e702 remove breakpoint 2025-03-28 17:18:24 +00:00
Adil Zouitine b495b19a6a [WIP] correct sac implementation 2025-03-28 17:18:24 +00:00
Michel Aractingi 6139df553d Extend reward classifier for multiple camera views (#626) 2025-03-28 17:18:24 +00:00
Eugene Mironov b68730474a [Port HIL_SERL] Final fixes for the Reward Classifier (#598) 2025-03-28 17:18:24 +00:00
Michel Aractingi 764925e4a2 added temporary fix for missing task_index key in online environment 2025-03-28 17:18:24 +00:00
Michel Aractingi 7bb142b707 split encoder for critic and actor 2025-03-28 17:18:24 +00:00
Michel Aractingi 2c2ed084cc style fixes 2025-03-28 17:18:24 +00:00
KeWang1017 91fefdecfa Refactor SAC configuration and policy for improved action sampling and stability
- Updated SACConfig to replace standard deviation parameterization with log_std_min and log_std_max for better control over action distributions.
- Modified SACPolicy to streamline action selection and log probability calculations, enhancing stochastic behavior.
- Removed deprecated TanhMultivariateNormalDiag class to simplify the codebase and improve maintainability.

These changes aim to enhance the robustness and performance of the SAC implementation during training and inference.
2025-03-28 17:18:24 +00:00
KeWang1017 70e3b9248c Refine SAC configuration and policy for enhanced performance
- Updated standard deviation parameterization in SACConfig to 'softplus' with defined min and max values for improved stability.
- Modified action sampling in SACPolicy to use reparameterized sampling, ensuring better gradient flow and log probability calculations.
- Cleaned up log probability calculations in TanhMultivariateNormalDiag for clarity and efficiency.
- Increased evaluation frequency in YAML configuration to 50000 for more efficient training cycles.

These changes aim to enhance the robustness and performance of the SAC implementation during training and inference.
2025-03-28 17:18:24 +00:00
KeWang1017 0ecf40d396 Refactor SACPolicy for improved action sampling and standard deviation handling
- Updated action selection to use distribution sampling and log probabilities for better stochastic behavior.
- Enhanced standard deviation clamping to prevent extreme values, ensuring stability in policy outputs.
- Cleaned up code by removing unnecessary comments and improving readability.

These changes aim to refine the SAC implementation, enhancing its robustness and performance during training and inference.
2025-03-28 17:18:24 +00:00
KeWang1017 a113daa81e trying to get sac running 2025-03-28 17:18:24 +00:00
Michel Aractingi 80b86e9bc3 Added normalization schemes and style checks 2025-03-28 17:18:24 +00:00
Michel Aractingi 9dafad15e6 added optimizer and sac to factory.py 2025-03-28 17:18:24 +00:00
Eugene Mironov d96edbf5ac [HIL-SERL PORT] Fix linter issues (#588) 2025-03-28 17:18:24 +00:00
Eugene Mironov 6340d9d17c [Port Hil-SERL] Add unit tests for the reward classifier & fix imports & check script (#578) 2025-03-28 17:18:24 +00:00
Michel Aractingi 66268fcf85 added comments from kewang 2025-03-28 17:18:24 +00:00
KeWang1017 a5228a0dfe Enhance SAC configuration and policy with new parameters and subsampling logic
- Added `num_subsample_critics`, `critic_target_update_weight`, and `utd_ratio` to SACConfig.
- Implemented target entropy calculation in SACPolicy if not provided.
- Introduced subsampling of critics to prevent overfitting during updates.
- Updated temperature loss calculation to use the new target entropy.
- Added comments for future UTD update implementation.

These changes improve the flexibility and performance of the SAC implementation.
2025-03-28 17:18:24 +00:00
KeWang dbadaae28b Port SAC WIP (#581)
Co-authored-by: KeWang1017 <ke.wang@helloleap.ai>
2025-03-28 17:18:24 +00:00
Michel Aractingi 44536d1f0c completed losses 2025-03-28 17:18:24 +00:00
Michel Aractingi 69b6de46d7 nit in control_robot.py 2025-03-28 17:18:24 +00:00
Yoel 58cc445921 Reward classifier and training (#528)
Co-authored-by: Daniel Ritchie <daniel@brainwavecollective.ai>
Co-authored-by: resolver101757 <kelster101757@hotmail.com>
Co-authored-by: Jannik Grothusen <56967823+J4nn1K@users.noreply.github.com>
Co-authored-by: Remi <re.cadene@gmail.com>
Co-authored-by: Michel Aractingi <michel.aractingi@huggingface.co>
2025-03-28 17:18:24 +00:00
Steven Palma 78fd1a1e04 chore(docs): update docs (#911) 2025-03-27 09:55:06 +01:00
Qizhi Chen a774af2eab fix pi0 action padding name (#893)
Co-authored-by: Steven Palma <imstevenpmwork@ieee.org>
2025-03-25 11:24:46 +01:00
Pepijn e8159997c7 User/pepijn/2025 03 17 act different image shapes (#870) 2025-03-18 11:09:05 +01:00
Steven Palma 5e9473806c refactor(config): Move device & amp args to PreTrainedConfig (#812)
Co-authored-by: Simon Alibert <75076266+aliberts@users.noreply.github.com>
2025-03-06 17:59:28 +01:00
Steven Palma 5d24ce3160 chore(doc): add license header to all files (#818) 2025-03-05 17:56:51 +01:00
Yachen Kang b80e55ca44 change "actions_id_pad" to "actions_is_pad"(🐛 Bug) (#774)
Co-authored-by: Steven Palma <imstevenpmwork@ieee.org>
2025-03-05 01:31:56 +01:00
Simon Alibert a1809ad3de Add typos checks (#770) 2025-02-25 23:51:15 +01:00
Simon Alibert 3354d919fc LeRobotDataset v2.1 (#711)
Co-authored-by: Remi <remi.cadene@huggingface.co>
Co-authored-by: Remi Cadene <re.cadene@gmail.com>
2025-02-25 15:27:29 +01:00
Simon Alibert c4c2ce04e7 Update pre-commits (#733) 2025-02-15 15:51:17 +01:00
Simon Alibert e71095960f Fixes following #670 (#719) 2025-02-12 12:53:55 +01:00
Simon Alibert 90e099b39f Remove offline training, refactor train.py and logging/checkpointing (#670)
Co-authored-by: Remi <remi.cadene@huggingface.co>
2025-02-11 10:36:06 +01:00
Remi 638d411cd3 Add Pi0 (#681)
Co-authored-by: Simon Alibert <simon.alibert@huggingface.co>
Co-authored-by: Simon Alibert <75076266+aliberts@users.noreply.github.com>
Co-authored-by: Pablo <pablo.montalvo.leroux@gmail.com>
2025-02-04 18:01:04 +01:00
Simon Alibert 3c0a209f9f Simplify configs (#550)
Co-authored-by: Remi <remi.cadene@huggingface.co>
Co-authored-by: HUANG TZU-CHUN <137322177+tc-huang@users.noreply.github.com>
2025-01-31 13:57:37 +01:00
Hirokazu Ishida 538455a965 feat: enable to use multiple rgb encoders per camera in diffusion policy (#484)
Co-authored-by: Alexander Soare <alexander.soare159@gmail.com>
2024-10-30 11:00:05 +01:00
Alexander Soare a60d27b132 Raise ValueError if horizon is incompatible with downsampling (#422) 2024-09-09 17:22:46 +01:00
Joe Clinton f17d9a2ba1 Bug: Fix VQ-Bet not working when n_action_pred_token=1 (#420)
Co-authored-by: Alexander Soare <alexander.soare159@gmail.com>
2024-09-09 09:41:13 +01:00
Jack Vial b2896d38f5 fix(act): n_vae_encoder_layers config parameter wasn't being used (#400) 2024-09-02 18:29:27 +01:00
NielsRogge 86bbd16d43 Improve discoverability on the hub (#325)
Co-authored-by: Lucain <lucainp@gmail.com>
Co-authored-by: Simon Alibert <75076266+aliberts@users.noreply.github.com>
2024-08-19 15:16:46 +02:00