mirror of
https://github.com/saymrwulf/stable-baselines3.git
synced 2026-09-17 22:30:59 +00:00
parent
78e8d405d7
commit
42f432c79c
2 changed files with 6 additions and 2 deletions
|
|
@ -45,6 +45,7 @@ Documentation:
|
||||||
- Added most documentation (adapted from Stable-Baselines)
|
- Added most documentation (adapted from Stable-Baselines)
|
||||||
- Added link to CONTRIBUTING.md in the README (@kinalmehta)
|
- Added link to CONTRIBUTING.md in the README (@kinalmehta)
|
||||||
- Added gSDE project and update docstrings accordingly
|
- Added gSDE project and update docstrings accordingly
|
||||||
|
- Fix ``TD3`` example code block
|
||||||
|
|
||||||
|
|
||||||
Pre-Release 0.5.0 (2020-05-05)
|
Pre-Release 0.5.0 (2020-05-05)
|
||||||
|
|
@ -230,4 +231,4 @@ And all the contributors:
|
||||||
@XMaster96 @kantneel @Pastafarianist @GerardMaggiolino @PatrickWalter214 @yutingsz @sc420 @Aaahh @billtubbs
|
@XMaster96 @kantneel @Pastafarianist @GerardMaggiolino @PatrickWalter214 @yutingsz @sc420 @Aaahh @billtubbs
|
||||||
@Miffyli @dwiel @miguelrass @qxcv @jaberkow @eavelardev @ruifeng96150 @pedrohbtp @srivatsankrishnan @evilsocket
|
@Miffyli @dwiel @miguelrass @qxcv @jaberkow @eavelardev @ruifeng96150 @pedrohbtp @srivatsankrishnan @evilsocket
|
||||||
@MarvineGothic @jdossgollin @SyllogismRXS @rusu24edward @jbulow @Antymon @seheevic @justinkterry @edbeeching
|
@MarvineGothic @jdossgollin @SyllogismRXS @rusu24edward @jbulow @Antymon @seheevic @justinkterry @edbeeching
|
||||||
@flodorner @KuKuXia @NeoExtended @PartiallyTyped @mmcenta @richardwu @kinalmehta @rolandgvc @tkelestemur
|
@flodorner @KuKuXia @NeoExtended @PartiallyTyped @mmcenta @richardwu @kinalmehta @rolandgvc @tkelestemur @mloo3
|
||||||
|
|
|
||||||
|
|
@ -62,17 +62,20 @@ Example
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
|
import gym
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
from stable_baselines3 import TD3
|
from stable_baselines3 import TD3
|
||||||
from stable_baselines3.td3.policies import MlpPolicy
|
from stable_baselines3.td3.policies import MlpPolicy
|
||||||
from stable_baselines3.common.noise import NormalActionNoise, OrnsteinUhlenbeckActionNoise
|
from stable_baselines3.common.noise import NormalActionNoise, OrnsteinUhlenbeckActionNoise
|
||||||
|
|
||||||
|
env = gym.make('Pendulum-v0')
|
||||||
|
|
||||||
# The noise objects for TD3
|
# The noise objects for TD3
|
||||||
n_actions = env.action_space.shape[-1]
|
n_actions = env.action_space.shape[-1]
|
||||||
action_noise = NormalActionNoise(mean=np.zeros(n_actions), sigma=0.1 * np.ones(n_actions))
|
action_noise = NormalActionNoise(mean=np.zeros(n_actions), sigma=0.1 * np.ones(n_actions))
|
||||||
|
|
||||||
model = TD3(MlpPolicy, 'Pendulum-v0', action_noise=action_noise, verbose=1)
|
model = TD3(MlpPolicy, env, action_noise=action_noise, verbose=1)
|
||||||
model.learn(total_timesteps=10000, log_interval=10)
|
model.learn(total_timesteps=10000, log_interval=10)
|
||||||
model.save("td3_pendulum")
|
model.save("td3_pendulum")
|
||||||
env = model.get_env()
|
env = model.get_env()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue