Implement full DIAMOND Atari agent with pixel-space diffusion world model and RL in imagination#252
Open
ParamThakkar123 wants to merge 11 commits into
Open
Implement full DIAMOND Atari agent with pixel-space diffusion world model and RL in imagination#252ParamThakkar123 wants to merge 11 commits into
ParamThakkar123 wants to merge 11 commits into
Conversation
…rmination head; wire into Diamond wrapper
…ple inference/training wrappers
…raining into EDM loss, add training/inference helpers
…eward/termination training
…tests for preconditioners, samplers, loss and predict
…prove EDM conditioning
… with RL in imagination - Add DiamondAgent with diffusion world model, reward/term LSTM, and actor-critic trained via REINFORCE + lambda-return baseline - Add DiamondCostModel wrapping diffusion + reward LSTM for CategoricalCEMSolver integration (Costable protocol) - Add ActorCritic (shared CNN-LSTM backbone), RewardTermModel, ConvEncoder, DiscreteActionEncoder - Add EDM diffusion (Karras preconditioning, Euler/Heun sampling, U-Net with AdaptiveGroupNorm) - Add Atari 100k wrappers (NoopReset, FireReset, EpisodicLife, ClipReward) in envs/ale/ - Add end-to-end training script (diamond_full.py) with Hydra config: buffer collection, diffusion/reward/RL training phases, MPC eval - Add comprehensive tests: 5 EDM, 10 cost model, 12 agent tests - Remove legacy embedding-space Diamond class (diamond.py) - Fix: c_out preconditioner formula, LSTM warmup from zero state, action_encoder in optimizer, gradient flow through imagination rollout
- Merge 9 source files into two: module.py (models) and diamond.py (agent/logic) - Delete: unet.py, edm.py, edm_sampling.py, edm_train.py, diffusion.py, agent.py, examples.py, diamond_agent.py, cost_model.py - Update all imports in tests, scripts, configs, and wm/__init__.py - All 27 tests pass
Collaborator
|
hi! could you report some reward or success rate? |
Collaborator
|
Few comments:
Thank you very much for the PR! It's sick! |
Author
|
Thank you so much @lucas-maes , yes I am working on these parts and will report with the metrics and fixes in a few hours 🫡 |
Author
|
Hi @lucas-maes , I am trying to run a smoke test on a few epochs for this but I am out of GPU credits right now and my laptop GPU is going OOM for even the smoke test (RTX 3050 4GB VRAM), Would it be possible for you to run a smoke test on your end with this command? |
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.
Summary
Implements the complete DIAMOND algorithm (Alonso et al., NeurIPS 2024) — a pixel-space diffusion world model trained with REINFORCE + λ-return value baseline inside imagination, following the Atari 100k benchmark protocol.
Core components
Atari 100k protocol
Training pipeline
Cleanup
Known issues