-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replaced rllab.envs.Env with gym.Env #129
base: integration
Are you sure you want to change the base?
Changes from 11 commits
6d2028e
9822c61
f4d4448
616ae5f
b8210eb
d541a0b
57a9804
32bef7b
5189610
89514a7
80d1020
c88a639
42bb6b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
import gym | ||
|
||
from rllab.algos import TRPO | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why remove this file? |
||
from rllab.baselines import LinearFeatureBaseline | ||
from rllab.envs import GymEnv | ||
from rllab.envs import normalize | ||
from rllab.envs.util import horizon, spec | ||
from rllab.misc import run_experiment_lite | ||
from rllab.policies import CategoricalMLPPolicy | ||
|
||
|
||
def run_task(*_): | ||
env = normalize(GymEnv("CartPole-v0")) | ||
env = gym.make("CartPole-v0") | ||
|
||
policy = CategoricalMLPPolicy( | ||
env_spec=env.spec, | ||
env_spec=spec(env), | ||
hidden_sizes=(32, 32) | ||
) | ||
|
||
baseline = LinearFeatureBaseline(env_spec=env.spec) | ||
baseline = LinearFeatureBaseline(env_spec=spec(env)) | ||
|
||
algo = TRPO( | ||
env=env, | ||
policy=policy, | ||
baseline=baseline, | ||
batch_size=4000, | ||
max_path_length=env.horizon, | ||
max_path_length=horizon(env), | ||
n_itr=50, | ||
discount=0.99, | ||
step_size=0.01, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
import gym | ||
|
||
from rllab.algos import TRPO | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why remove this file? |
||
from rllab.baselines import LinearFeatureBaseline | ||
from rllab.envs import GymEnv | ||
from rllab.envs import normalize | ||
from rllab.envs.util import horizon, spec | ||
from rllab.misc import run_experiment_lite | ||
from rllab.policies import CategoricalMLPPolicy | ||
|
||
|
||
def run_task(*_): | ||
env = normalize(GymEnv("CartPole-v1")) | ||
env = gym.make("CartPole-v1") | ||
|
||
policy = CategoricalMLPPolicy( | ||
env_spec=env.spec, | ||
env_spec=spec(env), | ||
hidden_sizes=(32, 32) | ||
) | ||
|
||
baseline = LinearFeatureBaseline(env_spec=env.spec) | ||
baseline = LinearFeatureBaseline(env_spec=spec(env)) | ||
|
||
algo = TRPO( | ||
env=env, | ||
policy=policy, | ||
baseline=baseline, | ||
batch_size=4000, | ||
max_path_length=env.horizon, | ||
max_path_length=horizon(env), | ||
n_itr=50, | ||
discount=0.99, | ||
step_size=0.01, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,30 @@ | ||
# This doesn't work. After 150 iterations still didn't learn anything. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why remove this file? |
||
import gym | ||
|
||
from rllab.algos import TRPO | ||
from rllab.baselines import LinearFeatureBaseline | ||
from rllab.envs import GymEnv | ||
from rllab.envs import normalize | ||
from rllab.envs.util import horizon, spec | ||
from rllab.misc import run_experiment_lite | ||
from rllab.policies import CategoricalMLPPolicy | ||
|
||
|
||
def run_task(*_): | ||
env = normalize(GymEnv("MountainCar-v0")) | ||
env = gym.make("MountainCar-v0") | ||
|
||
policy = CategoricalMLPPolicy( | ||
env_spec=env.spec, | ||
env_spec=spec(env), | ||
hidden_sizes=(32, 32) | ||
) | ||
|
||
baseline = LinearFeatureBaseline(env_spec=env.spec) | ||
baseline = LinearFeatureBaseline(env_spec=spec(env)) | ||
|
||
algo = TRPO( | ||
env=env, | ||
policy=policy, | ||
baseline=baseline, | ||
batch_size=4000, | ||
max_path_length=env.horizon, | ||
max_path_length=horizon(env), | ||
n_itr=150, | ||
discount=0.99, | ||
step_size=0.1, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
import gym | ||
|
||
from rllab.algos import TRPO | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why remove this file? |
||
from rllab.baselines import LinearFeatureBaseline | ||
from rllab.envs import GymEnv | ||
from rllab.envs import normalize | ||
from rllab.envs.util import horizon, spec | ||
from rllab.misc import run_experiment_lite | ||
from rllab.policies import GaussianMLPPolicy | ||
|
||
|
||
def run_task(*_): | ||
env = normalize(GymEnv("Pendulum-v0")) | ||
env = gym.make("Pendulum-v0") | ||
|
||
policy = GaussianMLPPolicy( | ||
env_spec=env.spec, | ||
env_spec=spec(env), | ||
hidden_sizes=(32, 32) | ||
) | ||
|
||
baseline = LinearFeatureBaseline(env_spec=env.spec) | ||
baseline = LinearFeatureBaseline(env_spec=spec(env)) | ||
|
||
algo = TRPO( | ||
env=env, | ||
policy=policy, | ||
baseline=baseline, | ||
batch_size=4000, | ||
max_path_length=env.horizon, | ||
max_path_length=horizon(env), | ||
n_itr=50, | ||
discount=0.99, | ||
step_size=0.01, | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove this file?