-
Notifications
You must be signed in to change notification settings - Fork 526
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow python script for hyperparameter configuration (#318)
* Allow loading configuration from python package in addition to yaml files. * Add an example python configuration file. * Add a test for training with the example python config file. * Formatting fixes. * Flake8 6 doesn't support inline comments * Allow python scripts * Remove debug print * Add python config file usage example to README.md * Update CHANGELOG.md * Fix paths in python config example and add variant where we specify the python file instead of package. * Update README Co-authored-by: Antonin Raffin <antonin.raffin@dlr.de> Co-authored-by: Antonin Raffin <antonin.raffin@ensta.org>
- Loading branch information
1 parent
168c34e
commit 1f9cfcf
Showing
9 changed files
with
119 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"""This file just serves as an example on how to configure the zoo | ||
using python scripts instead of yaml files.""" | ||
import torch | ||
|
||
hyperparams = { | ||
"MountainCarContinuous-v0": dict( | ||
env_wrapper=[{"gym.wrappers.TimeLimit": {"max_episode_steps": 100}}], | ||
normalize=True, | ||
n_envs=1, | ||
n_timesteps=20000.0, | ||
policy="MlpPolicy", | ||
batch_size=8, | ||
n_steps=8, | ||
gamma=0.9999, | ||
learning_rate=7.77e-05, | ||
ent_coef=0.00429, | ||
clip_range=0.1, | ||
n_epochs=2, | ||
gae_lambda=0.9, | ||
max_grad_norm=5, | ||
vf_coef=0.19, | ||
use_sde=True, | ||
policy_kwargs=dict( | ||
log_std_init=-3.29, | ||
ortho_init=False, | ||
activation_fn=torch.nn.ReLU, | ||
), | ||
) | ||
} |
This file contains 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 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 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 |
---|---|---|
@@ -1 +1 @@ | ||
1.7.0a2 | ||
1.7.0a3 |
This file contains 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 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