Last active
September 18, 2018 09:29
-
-
Save araffin/20f959ef8c314c0682261fc94c6a5cdb to your computer and use it in GitHub Desktop.
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
| from stable_baselines.common.policies import FeedForwardPolicy | |
| from stable_baselines import A2C | |
| # Custom MLP policy of three layers of size 128 each | |
| class CustomPolicy(FeedForwardPolicy): | |
| def __init__(self, *args, **kwargs): | |
| super(CustomPolicy, self).__init__(*args, **kwargs, | |
| layers=[128, 128, 128], | |
| feature_extraction="mlp") | |
| model = A2C(CustomPolicy, 'LunarLander-v2', verbose=1) | |
| # Train the agent | |
| model.learn(total_timesteps=100000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment