Skip to content

Instantly share code, notes, and snippets.

@araffin
Last active September 18, 2018 09:29
Show Gist options
  • Select an option

  • Save araffin/20f959ef8c314c0682261fc94c6a5cdb to your computer and use it in GitHub Desktop.

Select an option

Save araffin/20f959ef8c314c0682261fc94c6a5cdb to your computer and use it in GitHub Desktop.
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