-
Notifications
You must be signed in to change notification settings - Fork 375
Integrating hydra with DQN #201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
b035c90
init
vmoens f0432f5
Added TrainConfig dataclass to replace args
c67ea95
Added dataclass RecorderConfig for recorder.py
6a29d09
Added ReplayArgsConfig
c784e3c
Added comments for ReplayArgsConfig, TrainerConfig, and RecorderConfig
00b11a0
Added OffPolicyCollectorConfig and OnPolicyCollectorConfig dataclasses
60a2ed2
Added EnvConfig
c5a174e
Added LossConfig and LossPPOConfig
eab1650
Added ContinuousModelConfig and DiscreteModelConfig
6d5d28f
Integrated hydra w/ ppo example
ac4ffc9
Able to override parameters w/ yaml file provided through command line
8b87b3a
PPO example working w/ hydra
23a4d66
Fixed styling issues
062ade0
Added hydra dependencies to setup.py
93d2869
Refactored args from argparser to cfg
eeb3c81
Fixed style issues
0fa9d4f
Fixing more style issues
05b650c
Refactor input config file to overriding_cfg
c78c495
Removed import of DictConfig, now using str type hinting for DictConfig
9bfacd4
Integrated hydra into SAC
5375822
Integrated hydra into DDPG
4488ca9
Integrated hydra into REDQ
c246b6a
Merge remote-tracking branch 'upstream/bugfix_noopsreset' into hydra_…
ecee59c
Integrated hydra into DQN
e23dd5e
Commented out config file merging
3e4a58a
Make hydra optional dependency in trainers.py
5da617b
change cfg comment
8094add
Removed hydra in trainers.py
f986e2d
Changing hydra-core version to >=1.1 version
71e96ec
Modified tests affected by hydra change
d51f6f0
Merge branch 'hydra_integration' into hydra_dev_ppo
BoboBananas 00cf44f
Fixing style issues in trainers.py
069a0cf
Added hydra dependency to environment.yml
f9156ad
Added generate_seeds import
3dfa976
Merging changes from ppo branch
29c5cd1
Fixing style issues
edb48bf
Removing ppo yaml from git
5209337
Merge branch 'hydra_integration' into hydra_dev_dqn
BoboBananas 8804ed1
Delete humanoid.yaml
BoboBananas 2e30435
Fixing style issues
8e43e49
Merge remote-tracking branch 'origin/hydra_integration' into hydra_de…
vmoens 03b8c78
Fixed dqn example, removed epsilon greedy
522f0bc
BugFix: generating random values from CompositeSpec (#218)
vmoens be2312a
Merged changes from main to fix dqn example
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ | |
import hydra | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure where do those changes in PPO come from in this PR |
||
import torch.cuda | ||
from hydra.core.config_store import ConfigStore | ||
from omegaconf import OmegaConf | ||
from torchrl.envs import ParallelEnv, EnvCreator | ||
from torchrl.envs.transforms import RewardScaling, TransformedEnv | ||
from torchrl.envs.utils import set_exploration_mode | ||
|
@@ -56,10 +55,6 @@ | |
def main(cfg: "DictConfig"): | ||
from torch.utils.tensorboard import SummaryWriter | ||
|
||
if cfg.config_file is not None: | ||
overriding_cfg = OmegaConf.load(cfg.config_file) | ||
cfg = OmegaConf.merge(cfg, overriding_cfg) | ||
|
||
cfg = correct_for_frame_skip(cfg) | ||
|
||
if not isinstance(cfg.reward_scaling, float): | ||
|
@@ -142,7 +137,7 @@ def main(cfg: "DictConfig"): | |
|
||
# remove video recorder from recorder to have matching state_dict keys | ||
if cfg.record_video: | ||
recorder_rm = TransformedEnv(recorder.env) | ||
recorder_rm = TransformedEnv(recorder.base_env) | ||
for transform in recorder.transform: | ||
if not isinstance(transform, VideoRecorder): | ||
recorder_rm.append_transform(transform) | ||
|
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's keep model_explore