-
Notifications
You must be signed in to change notification settings - Fork 803
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3e1d630
commit 55b7df1
Showing
2 changed files
with
41 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from rllab.algos.nop import NOP | ||
from rllab.baselines.zero_baseline import ZeroBaseline | ||
from rllab.envs.box2d.cartpole_env import CartpoleEnv | ||
from rllab.envs.normalized_env import normalize | ||
from rllab.policies.uniform_control_policy import UniformControlPolicy | ||
|
||
env = normalize(CartpoleEnv()) | ||
|
||
policy = UniformControlPolicy( | ||
env_spec=env.spec, | ||
# The neural network policy should have two hidden layers, each with 32 hidden units. | ||
) | ||
|
||
baseline = ZeroBaseline(env_spec=env.spec) | ||
|
||
algo = NOP( | ||
env=env, | ||
policy=policy, | ||
baseline=baseline, | ||
batch_size=4000, | ||
max_path_length=100, | ||
n_itr=40, | ||
discount=0.99, | ||
step_size=0.01, | ||
) | ||
algo.train() |
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