Skip to content
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

Moved sandbox.rocky.tf to rllab.tf #130

Open
wants to merge 2 commits into
base: integration
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions contrib/ros/envs/example_launchers/trpo_gazebo_sawyer_pnp.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
from rllab.envs.normalized_env import normalize
from rllab.misc.instrument import run_experiment_lite

from sandbox.rocky.tf.algos.trpo import TRPO
from sandbox.rocky.tf.policies.gaussian_mlp_policy import GaussianMLPPolicy
from sandbox.rocky.tf.envs.base import TfEnv
from rllab.tf.algos.trpo import TRPO
from rllab.tf.policies.gaussian_mlp_policy import GaussianMLPPolicy
from rllab.tf.envs.base import TfEnv

from contrib.ros.envs.example_launchers import model_dir
from contrib.ros.envs.sawyer.pick_and_place_env import PickAndPlaceEnv
Expand Down
8 changes: 4 additions & 4 deletions contrib/ros/envs/example_launchers/trpo_gazebo_sawyer_push.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
from rllab.envs.normalized_env import normalize
from rllab.misc.instrument import run_experiment_lite

from sandbox.rocky.tf.algos.trpo import TRPO
from sandbox.rocky.tf.policies.gaussian_mlp_policy import GaussianMLPPolicy
from sandbox.rocky.tf.envs.base import TfEnv
from rllab.tf.algos.trpo import TRPO
from rllab.tf.policies.gaussian_mlp_policy import GaussianMLPPolicy
from rllab.tf.envs.base import TfEnv

from contrib.ros.envs.example_launchers import model_dir
from contrib.ros.envs.sawyer.push_env import PushEnv
Expand Down Expand Up @@ -75,4 +75,4 @@ def run_task(*_):
run_task,
n_parallel=1,
plot=False,
)
)
6 changes: 3 additions & 3 deletions examples/cluster_gym_mujoco_demo.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from rllab.baselines import LinearFeatureBaseline
from rllab.envs import normalize
from sandbox.rocky.tf.envs import TfEnv
from sandbox.rocky.tf.policies import GaussianMLPPolicy
from sandbox.rocky.tf.algos import TRPO
from rllab.tf.envs import TfEnv
from rllab.tf.policies import GaussianMLPPolicy
from rllab.tf.algos import TRPO
from rllab.misc import run_experiment_lite
from rllab.envs import GymEnv
import sys
Expand Down
6 changes: 3 additions & 3 deletions examples/trpo_gym_tf_cartpole.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from rllab.envs import normalize
from rllab.misc import stub, run_experiment_lite

from sandbox.rocky.tf.envs import TfEnv
from sandbox.rocky.tf.policies import CategoricalMLPPolicy
from sandbox.rocky.tf.algos import TRPO
from rllab.tf.envs import TfEnv
from rllab.tf.policies import CategoricalMLPPolicy
from rllab.tf.algos import TRPO

stub(globals())

Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions rllab/tf/algos/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from rllab.tf.algos.batch_polopt import BatchPolopt
from rllab.tf.algos.npo import NPO
from rllab.tf.algos.trpo import TRPO
from rllab.tf.algos.vpg import VPG
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import time
from rllab.algos import RLAlgorithm
import rllab.misc.logger as logger
from sandbox.rocky.tf.policies.base import Policy
from rllab.tf.policies.base import Policy
import tensorflow as tf
from sandbox.rocky.tf.samplers import BatchSampler
from sandbox.rocky.tf.samplers import VectorizedSampler
from rllab.tf.samplers import BatchSampler
from rllab.tf.samplers import VectorizedSampler
from rllab.sampler.utils import rollout


Expand Down Expand Up @@ -103,7 +103,7 @@ def train(self, sess=None):
if sess is None:
sess = tf.Session()
sess.__enter__()

sess.run(tf.global_variables_initializer())
self.start_worker()
start_time = time.time()
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions sandbox/rocky/tf/algos/npo.py → rllab/tf/algos/npo.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
from rllab.misc import ext
from rllab.misc.overrides import overrides
import rllab.misc.logger as logger
from sandbox.rocky.tf.optimizers import PenaltyLbfgsOptimizer
from sandbox.rocky.tf.algos import BatchPolopt
from sandbox.rocky.tf.misc import tensor_utils
from sandbox.rocky.tf.misc.tensor_utils import enclosing_scope
from rllab.tf.optimizers import PenaltyLbfgsOptimizer
from rllab.tf.algos import BatchPolopt
from rllab.tf.misc import tensor_utils
from rllab.tf.misc.tensor_utils import enclosing_scope
import tensorflow as tf


Expand Down
4 changes: 2 additions & 2 deletions sandbox/rocky/tf/algos/trpo.py → rllab/tf/algos/trpo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


from sandbox.rocky.tf.algos import NPO
from sandbox.rocky.tf.optimizers import ConjugateGradientOptimizer
from rllab.tf.algos import NPO
from rllab.tf.optimizers import ConjugateGradientOptimizer


class TRPO(NPO):
Expand Down
8 changes: 4 additions & 4 deletions sandbox/rocky/tf/algos/vpg.py → rllab/tf/algos/vpg.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from rllab.misc import logger
from rllab.misc import ext
from rllab.misc.overrides import overrides
from sandbox.rocky.tf.algos import BatchPolopt
from sandbox.rocky.tf.optimizers import FirstOrderOptimizer
from sandbox.rocky.tf.misc import tensor_utils
from sandbox.rocky.tf.misc.tensor_utils import enclosing_scope
from rllab.tf.algos import BatchPolopt
from rllab.tf.optimizers import FirstOrderOptimizer
from rllab.tf.misc import tensor_utils
from rllab.tf.misc.tensor_utils import enclosing_scope
from rllab.core import Serializable
import tensorflow as tf

Expand Down
8 changes: 8 additions & 0 deletions rllab/tf/core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from rllab.tf.core.parameterized import JointParameterized
from rllab.tf.core.parameterized import Parameterized
from rllab.tf.core.layers_powered import LayersPowered
from rllab.tf.core import layers
from rllab.tf.core.network import MLP
from rllab.tf.core.network import GRUNetwork
from rllab.tf.core.network import ConvNetwork
from rllab.tf.core.network import LSTMNetwork
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from sandbox.rocky.tf.core import Parameterized
from sandbox.rocky.tf.core import layers as L
from rllab.tf.core import Parameterized
from rllab.tf.core import layers as L
import itertools


Expand Down
6 changes: 3 additions & 3 deletions sandbox/rocky/tf/core/network.py → rllab/tf/core/network.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from sandbox.rocky.tf.core import layers as L
from rllab.tf.core import layers as L
import tensorflow as tf
import numpy as np
import itertools
from rllab.core import Serializable
from sandbox.rocky.tf.core import Parameterized
from sandbox.rocky.tf.core import LayersPowered
from rllab.tf.core import Parameterized
from rllab.tf.core import LayersPowered


class MLP(LayersPowered, Serializable):
Expand Down
File renamed without changes.
6 changes: 6 additions & 0 deletions rllab/tf/distributions/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from rllab.tf.distributions.bernoulli import Bernoulli
from rllab.tf.distributions.categorical import Categorical
from rllab.tf.distributions.base import Distribution
from rllab.tf.distributions.diagonal_gaussian import DiagonalGaussian
from rllab.tf.distributions.recurrent_categorical import RecurrentCategorical
from rllab.tf.distributions.recurrent_diagonal_gaussian import RecurrentDiagonalGaussian
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .base import Distribution
import tensorflow as tf
import numpy as np
from sandbox.rocky.tf.misc.tensor_utils import enclosing_scope
from rllab.tf.misc.tensor_utils import enclosing_scope

TINY = 1e-8

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
from .base import Distribution
import tensorflow as tf
from sandbox.rocky.tf.misc.tensor_utils import enclosing_scope
from rllab.tf.misc.tensor_utils import enclosing_scope

TINY = 1e-8

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import tensorflow as tf
import numpy as np
from sandbox.rocky.tf.distributions import Distribution
from sandbox.rocky.tf.misc.tensor_utils import enclosing_scope
from rllab.tf.distributions import Distribution
from rllab.tf.misc.tensor_utils import enclosing_scope


class DiagonalGaussian(Distribution):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import tensorflow as tf
import numpy as np
from sandbox.rocky.tf.misc.tensor_utils import enclosing_scope
from sandbox.rocky.tf.distributions import Categorical
from sandbox.rocky.tf.distributions import Distribution
from rllab.tf.misc.tensor_utils import enclosing_scope
from rllab.tf.distributions import Categorical
from rllab.tf.distributions import Distribution

TINY = 1e-8

Expand Down
6 changes: 6 additions & 0 deletions rllab/tf/distributions/recurrent_diagonal_gaussian.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@



from rllab.tf.distributions import DiagonalGaussian

RecurrentDiagonalGaussian = DiagonalGaussian
4 changes: 4 additions & 0 deletions rllab/tf/envs/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from rllab.tf.envs.base import TfEnv
from rllab.tf.envs.base import to_tf_space
from rllab.tf.envs.parallel_vec_env_executor import ParallelVecEnvExecutor
from rllab.tf.envs.vec_env_executor import VecEnvExecutor
6 changes: 3 additions & 3 deletions sandbox/rocky/tf/envs/base.py → rllab/tf/envs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from rllab.spaces import Box as TheanoBox
from rllab.spaces import Discrete as TheanoDiscrete
from rllab.spaces import Product as TheanoProduct
from sandbox.rocky.tf.spaces import Discrete
from sandbox.rocky.tf.spaces import Box
from sandbox.rocky.tf.spaces import Product
from rllab.tf.spaces import Discrete
from rllab.tf.spaces import Box
from rllab.tf.spaces import Product
from cached_property import cached_property


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np
import pickle as pickle
from sandbox.rocky.tf.misc import tensor_utils
from rllab.tf.misc import tensor_utils
from rllab.misc import logger

from rllab.sampler import singleton_pool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np
import pickle as pickle
from sandbox.rocky.tf.misc import tensor_utils
from rllab.tf.misc import tensor_utils


class VecEnvExecutor(object):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from sandbox.rocky.tf.algos import TRPO
from rllab.tf.algos import TRPO
from rllab.baselines import LinearFeatureBaseline
from rllab.envs.box2d import CartpoleEnv
from rllab.envs.normalized_env import normalize
from sandbox.rocky.tf.optimizers import ConjugateGradientOptimizer
from sandbox.rocky.tf.optimizers import FiniteDifferenceHvp
from sandbox.rocky.tf.policies import GaussianMLPPolicy
from sandbox.rocky.tf.envs import TfEnv
from rllab.tf.optimizers import ConjugateGradientOptimizer
from rllab.tf.optimizers import FiniteDifferenceHvp
from rllab.tf.policies import GaussianMLPPolicy
from rllab.tf.envs import TfEnv
from rllab.misc import stub, run_experiment_lite

env = TfEnv(normalize(CartpoleEnv()))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from sandbox.rocky.tf.algos import TRPO
from rllab.tf.algos import TRPO
from rllab.baselines import LinearFeatureBaseline
from rllab.envs.box2d import CartpoleEnv
from rllab.envs import normalize
from sandbox.rocky.tf.policies import GaussianGRUPolicy
from sandbox.rocky.tf.policies import GaussianLSTMPolicy
from sandbox.rocky.tf.envs import TfEnv
import sandbox.rocky.tf.core.layers as L
from sandbox.rocky.tf.optimizers import ConjugateGradientOptimizer, FiniteDifferenceHvp
from rllab.tf.policies import GaussianGRUPolicy
from rllab.tf.policies import GaussianLSTMPolicy
from rllab.tf.envs import TfEnv
import rllab.tf.core.layers as L
from rllab.tf.optimizers import ConjugateGradientOptimizer, FiniteDifferenceHvp
from rllab.misc import stub, run_experiment_lite

env = TfEnv(normalize(CartpoleEnv()))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from sandbox.rocky.tf.algos import VPG
from rllab.tf.algos import VPG
from rllab.baselines import LinearFeatureBaseline
from rllab.envs.box2d import CartpoleEnv
from rllab.envs import normalize
from sandbox.rocky.tf.policies import GaussianMLPPolicy
from sandbox.rocky.tf.envs import TfEnv
from rllab.tf.policies import GaussianMLPPolicy
from rllab.tf.envs import TfEnv
from rllab.misc import stub, run_experiment_lite

env = TfEnv(normalize(CartpoleEnv()))
Expand Down
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions rllab/tf/optimizers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from rllab.tf.optimizers.conjugate_gradient_optimizer import ConjugateGradientOptimizer
from rllab.tf.optimizers.conjugate_gradient_optimizer import FiniteDifferenceHvp
from rllab.tf.optimizers.lbfgs_optimizer import LbfgsOptimizer
from rllab.tf.optimizers.first_order_optimizer import FirstOrderOptimizer
from rllab.tf.optimizers.penalty_lbfgs_optimizer import PenaltyLbfgsOptimizer
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import itertools
import numpy as np
import tensorflow as tf
from sandbox.rocky.tf.misc import tensor_utils
from sandbox.rocky.tf.misc.tensor_utils import enclosing_scope
from rllab.tf.misc import tensor_utils
from rllab.tf.misc.tensor_utils import enclosing_scope
from rllab.misc import sliced_fun


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
from rllab.misc import ext
from rllab.misc import logger
from rllab.optimizers import BatchDataset
from sandbox.rocky.tf.misc import tensor_utils
from rllab.tf.misc import tensor_utils
# from rllab.algo.first_order_method import parse_update_method
from sandbox.rocky.tf.misc.tensor_utils import enclosing_scope
from rllab.tf.misc.tensor_utils import enclosing_scope


class FirstOrderOptimizer(Serializable):
Expand Down Expand Up @@ -146,4 +146,4 @@ def optimize(self, inputs, extra_inputs=None, callback=None):

if abs(last_loss - new_loss) < self._tolerance:
break
last_loss = new_loss
last_loss = new_loss
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

from rllab.core import Serializable
from rllab.misc import ext
from sandbox.rocky.tf.misc import tensor_utils
from sandbox.rocky.tf.misc.tensor_utils import enclosing_scope
from rllab.tf.misc import tensor_utils
from rllab.tf.misc.tensor_utils import enclosing_scope


class LbfgsOptimizer(Serializable):
Expand Down Expand Up @@ -100,4 +100,4 @@ def opt_callback(params):
x0=self._target.get_param_values(trainable=True),
maxiter=self._max_opt_itr,
callback=opt_callback,
)
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from sandbox.rocky.tf.misc import tensor_utils
from sandbox.rocky.tf.misc.tensor_utils import enclosing_scope
from rllab.tf.misc import tensor_utils
from rllab.tf.misc.tensor_utils import enclosing_scope
from rllab.misc import logger
from rllab.misc import ext
from rllab.core import Serializable
Expand Down
6 changes: 6 additions & 0 deletions rllab/tf/policies/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from rllab.tf.policies.base import Policy
from rllab.tf.policies.base import StochasticPolicy
from rllab.tf.policies.categorical_mlp_policy import CategoricalMLPPolicy
from rllab.tf.policies.gaussian_gru_policy import GaussianGRUPolicy
from rllab.tf.policies.gaussian_lstm_policy import GaussianLSTMPolicy
from rllab.tf.policies.gaussian_mlp_policy import GaussianMLPPolicy
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@



from sandbox.rocky.tf.core import Parameterized
from rllab.tf.core import Parameterized


class Policy(Parameterized):
Expand Down
Loading