Search is not available for this dataset
repo stringlengths 2 152 ⌀ | file stringlengths 15 239 | code stringlengths 0 58.4M | file_length int64 0 58.4M | avg_line_length float64 0 1.81M | max_line_length int64 0 12.7M | extension_type stringclasses 364
values |
|---|---|---|---|---|---|---|
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/sampler/test_sampler.py | from dowel import logger
import numpy as np
from garage.sampler.utils import truncate_paths
from tests.fixtures.logger import NullOutput
class TestSampler:
def setup_method(self):
logger.add_output(NullOutput())
def teardown_method(self):
logger.remove_all()
def test_truncate_paths(sel... | 1,183 | 27.878049 | 55 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/sampler/test_stateful_pool.py | from garage.sampler.stateful_pool import StatefulPool
def _worker_collect_once(_):
return 'a', 1
class TestStatefulPool:
def test_stateful_pool(self):
stateful_pool = StatefulPool()
stateful_pool.initialize(n_parallel=10)
results = stateful_pool.run_collect(
_worker_colle... | 694 | 30.590909 | 69 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/sampler/test_utils.py | import numpy as np
import pytest
from garage.envs import GarageEnv
from garage.sampler import utils
from tests.fixtures.envs.dummy import DummyBoxEnv
from tests.fixtures.policies import DummyPolicy
class TestRollout:
def setup_method(self):
self.env = GarageEnv(DummyBoxEnv(obs_dim=(4, 4), action_dim=(2,... | 3,172 | 33.11828 | 76 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/sampler/test_vec_worker.py | import pprint
import pytest
from garage.envs import GarageEnv
from garage.envs import GridWorldEnv
from garage.experiment.task_sampler import EnvPoolSampler
from garage.np.policies import ScriptedPolicy
from garage.sampler import LocalSampler, VecWorker, WorkerFactory
SEED = 100
N_TRAJ = 5
MAX_PATH_LENGTH = 9
@pyt... | 6,027 | 34.046512 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/__init__.py | 0 | 0 | 0 | py | |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/algos/__init__.py | 0 | 0 | 0 | py | |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/algos/test_batch_polopt.py | 0 | 0 | 0 | py | |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/algos/test_ddpg.py | """This script creates a test that fails when garage.tf.algos.DDPG performance
is too low.
"""
import gym
import pytest
import tensorflow as tf
from garage.envs import GarageEnv, normalize
from garage.experiment import LocalTFRunner
from garage.np.exploration_policies import AddOrnsteinUhlenbeckNoise
from garage.repla... | 5,795 | 41.306569 | 78 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/algos/test_dqn.py | """
This script creates a test that fails when garage.tf.algos.DQN performance is
too low.
"""
import pickle
import gym
import numpy as np
import pytest
import tensorflow as tf
from garage.envs import GarageEnv
from garage.experiment import LocalTFRunner
from garage.np.exploration_policies import EpsilonGreedyPolicy
... | 8,134 | 40.505102 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/algos/test_erwr.py | import pytest
from garage.envs import GarageEnv
from garage.experiment import deterministic, LocalTFRunner
from garage.np.baselines import LinearFeatureBaseline
from garage.tf.algos import ERWR
from garage.tf.policies import CategoricalMLPPolicy
from tests.fixtures import snapshot_config, TfGraphTestCase
class TestE... | 1,245 | 31.789474 | 70 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/algos/test_npo.py | """
This script creates a test that fails when garage.tf.algos.NPO performance is
too low.
"""
import gym
import pytest
import tensorflow as tf
from garage.envs import GarageEnv, normalize
from garage.experiment import LocalTFRunner
from garage.tf.algos import NPO
from garage.tf.baselines import GaussianMLPBaseline
fr... | 3,679 | 32.761468 | 78 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/algos/test_ppo.py | """
This script creates a test that fails when garage.tf.algos.PPO performance is
too low.
"""
import gym
import pytest
import tensorflow as tf
from garage.envs import GarageEnv, normalize
from garage.experiment import LocalTFRunner
from garage.np.baselines import LinearFeatureBaseline
from garage.tf.algos import PPO
... | 12,311 | 38.210191 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/algos/test_reps.py | """
This script creates a test that fails when garage.tf.algos.REPS performance is
too low.
"""
import gym
import pytest
from garage.envs import GarageEnv
from garage.experiment import LocalTFRunner
from garage.np.baselines import LinearFeatureBaseline
from garage.tf.algos import REPS
from garage.tf.policies import Ca... | 1,242 | 29.317073 | 78 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/algos/test_rl2ppo.py | """
This script creates a test that fails when garage.tf.algos.RL2PPO
performance is too low.
"""
import numpy as np
import pytest
try:
# pylint: disable=unused-import
import mujoco_py # noqa: F401
except ImportError:
pytest.skip('To use mujoco-based features, please install garage[mujoco].',
... | 9,914 | 44.691244 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/algos/test_rl2trpo.py | """
This script creates a test that fails when garage.tf.algos.RL2TRPO
performance is too low.
"""
import pytest
try:
# pylint: disable=unused-import
import mujoco_py # noqa: F401
except ImportError:
pytest.skip('To use mujoco-based features, please install garage[mujoco].',
allow_module_le... | 5,469 | 43.112903 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/algos/test_td3.py | """Create a test that fails when garage.tf.algos.TD3 performance is too low."""
import gym
import pytest
import tensorflow as tf
from garage.envs import GarageEnv
from garage.experiment import LocalTFRunner
from garage.np.exploration_policies import AddGaussianNoise
from garage.replay_buffer import PathBuffer
from ga... | 3,098 | 41.452055 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/algos/test_te.py | """This script tests Task Embedding algorithms."""
import akro
import numpy as np
import tensorflow as tf
from garage import InOutSpec
from garage.envs import GarageEnv, MultiEnvWrapper, PointEnv
from garage.envs.multi_env_wrapper import round_robin_strategy
from garage.experiment import LocalTFRunner
from garage.np.b... | 6,241 | 35.290698 | 77 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/algos/test_tnpg.py | import gym
import pytest
from garage.envs import GarageEnv, normalize
from garage.experiment import LocalTFRunner
from garage.np.baselines import LinearFeatureBaseline
from garage.tf.algos import TNPG
from garage.tf.policies import GaussianMLPPolicy
from tests.fixtures import snapshot_config, TfGraphTestCase
class T... | 1,306 | 32.512821 | 71 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/algos/test_trpo.py | """
This script creates a test that fails when garage.tf.algos.TRPO performance is
too low.
"""
import gym
import pytest
import tensorflow as tf
from garage.envs import GarageEnv, normalize
from garage.experiment import deterministic
from garage.experiment import LocalTFRunner
from garage.experiment import snapshotter... | 6,691 | 36.595506 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/algos/test_vpg.py | import pytest
from garage.envs import GarageEnv
from garage.experiment import LocalTFRunner
from garage.np.baselines import LinearFeatureBaseline
from garage.tf.algos import VPG
from garage.tf.policies import CategoricalMLPPolicy
from tests.fixtures import snapshot_config, TfGraphTestCase
class TestVPG(TfGraphTestCa... | 1,249 | 31.894737 | 70 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/baselines/__init__.py | 0 | 0 | 0 | py | |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/baselines/test_baselines.py | """
This script creates a test that fails when
garage.tf.baselines failed to initialize.
"""
import tensorflow as tf
from garage.envs import GarageEnv
from garage.tf.baselines import ContinuousMLPBaseline
from garage.tf.baselines import GaussianMLPBaseline
from tests.fixtures import TfGraphTestCase
from tests.fixtures... | 857 | 30.777778 | 76 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/baselines/test_continuous_mlp_baseline.py | import pickle
from unittest import mock
import numpy as np
import pytest
import tensorflow as tf
from garage.envs import GarageEnv
from garage.tf.baselines import ContinuousMLPBaseline
from tests.fixtures import TfGraphTestCase
from tests.fixtures.envs.dummy import DummyBoxEnv
from tests.fixtures.regressors import Si... | 3,916 | 39.802083 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/baselines/test_gaussian_cnn_baseline.py | import pickle
from unittest import mock
import numpy as np
import pytest
import tensorflow as tf
from garage.envs import GarageEnv
from garage.misc.tensor_utils import normalize_pixel_batch
from garage.tf.baselines import GaussianCNNBaseline
from tests.fixtures import TfGraphTestCase
from tests.fixtures.envs.dummy im... | 7,255 | 39.99435 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/baselines/test_gaussian_mlp_baseline.py | import pickle
from unittest import mock
import numpy as np
import pytest
import tensorflow as tf
from garage.envs import GarageEnv
from garage.tf.baselines import GaussianMLPBaseline
from tests.fixtures import TfGraphTestCase
from tests.fixtures.envs.dummy import DummyBoxEnv
from tests.fixtures.regressors import Simp... | 4,024 | 39.656566 | 76 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/distributions/test_diagonal_gaussian.py | import numpy as np
from garage.tf.distributions import DiagonalGaussian
def test_kl():
gaussian = DiagonalGaussian(dim=2)
dist1 = dict(mean=np.array([0, 0]), log_std=np.array([0, 0]))
dist2 = dict(mean=np.array([0, 0]), log_std=np.array([1, 1]))
dist3 = dict(mean=np.array([1, 1]), log_std=np.array([... | 1,197 | 34.235294 | 71 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/embeddings/__init__.py | 0 | 0 | 0 | py | |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/embeddings/test_gaussian_mlp_encoder.py | import pickle
from unittest import mock
# pylint: disable=wrong-import-order
import akro
import numpy as np
import pytest
import tensorflow as tf
from garage import InOutSpec
from garage.envs import GarageEnv
from garage.tf.embeddings import GaussianMLPEncoder
from tests.fixtures import TfGraphTestCase
from tests.fix... | 5,614 | 37.724138 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/envs/__init__.py | 0 | 0 | 0 | py | |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/envs/test_base.py | import pickle
import gym
import pytest
from garage.envs import GarageEnv
from tests.helpers import step_env_with_gym_quirks
class TestGarageEnv:
def test_is_pickleable(self):
env = GarageEnv(env_name='CartPole-v1')
round_trip = pickle.loads(pickle.dumps(env))
assert round_trip.spec == e... | 1,551 | 34.272727 | 72 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/experiment/__init__.py | 0 | 0 | 0 | py | |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/experiment/test_local_tf_runner.py | import pytest
import ray
import tensorflow as tf
from garage.envs import GarageEnv
from garage.experiment import LocalTFRunner
from garage.np.baselines import LinearFeatureBaseline
from garage.sampler import LocalSampler, RaySampler, singleton_pool
from garage.tf.algos import VPG
from garage.tf.plotter import Plotter
... | 6,269 | 37.703704 | 74 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/misc/__init__.py | 0 | 0 | 0 | py | |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/misc/test_tensor_utils.py | """
Test tf utility functions mainly in garage.tf.misc.tensor_utils
"""
import numpy as np
import tensorflow as tf
from garage.tf.misc.tensor_utils import compute_advantages, get_target_ops
from tests.fixtures import TfGraphTestCase
class TestTensorUtil(TfGraphTestCase):
"""Test class for tf utility functions.""... | 2,567 | 39.125 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/models/__init__.py | 0 | 0 | 0 | py | |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/models/test_categorical_cnn_model.py | import pickle
import numpy as np
import pytest
import tensorflow as tf
import tensorflow_probability as tfp
from garage.tf.models import CategoricalCNNModel
from tests.fixtures import TfGraphTestCase
class TestCategoricalMLPModel(TfGraphTestCase):
def setup_method(self):
super().setup_method()
... | 3,728 | 41.862069 | 76 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/models/test_categorical_gru_model.py | import pickle
import numpy as np
import pytest
import tensorflow as tf
import tensorflow_probability as tfp
from garage.tf.models import CategoricalGRUModel
from tests.fixtures import TfGraphTestCase
class TestCategoricalGRUModel(TfGraphTestCase):
def setup_method(self):
super().setup_method()
... | 5,858 | 45.133858 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/models/test_categorical_lstm_model.py | import pickle
import numpy as np
import pytest
import tensorflow as tf
import tensorflow_probability as tfp
from garage.tf.models import CategoricalLSTMModel
from tests.fixtures import TfGraphTestCase
class TestCategoricalLSTMModel(TfGraphTestCase):
def setup_method(self):
super().setup_method()
... | 6,902 | 47.272727 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/models/test_categorical_mlp_model.py | import pickle
import numpy as np
import pytest
import tensorflow as tf
import tensorflow_probability as tfp
from garage.tf.models import CategoricalMLPModel
from tests.fixtures import TfGraphTestCase
class TestCategoricalMLPModel(TfGraphTestCase):
def setup_method(self):
super().setup_method()
... | 3,067 | 37.835443 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/models/test_cnn.py | import numpy as np
import pytest
import tensorflow as tf
from garage.tf.models.cnn import cnn
from garage.tf.models.cnn import cnn_with_max_pooling
from tests.fixtures import TfGraphTestCase
from tests.helpers import convolve
from tests.helpers import max_pooling
class TestCNN(TfGraphTestCase):
def setup_method... | 12,923 | 44.992883 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/models/test_cnn_mlp_merge_model.py | import pickle
import numpy as np
import pytest
import tensorflow as tf
from garage.tf.models import CNNMLPMergeModel
from tests.fixtures import TfGraphTestCase
class TestCNNMLPMergeModel(TfGraphTestCase):
def setup_method(self):
super().setup_method()
self.batch_size = 1
self.input_widt... | 9,887 | 42.946667 | 78 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/models/test_cnn_model.py | import pickle
import numpy as np
import pytest
import tensorflow as tf
from garage.tf.models import CNNModel
from garage.tf.models import CNNModelWithMaxPooling
from tests.fixtures import TfGraphTestCase
class TestCNNModel(TfGraphTestCase):
def setup_method(self):
super().setup_method()
self.ba... | 6,701 | 41.150943 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/models/test_gaussian_cnn_model.py | import pickle
from unittest import mock
import numpy as np
import pytest
import tensorflow as tf
from garage.tf.models import GaussianCNNModel
from tests.fixtures import TfGraphTestCase
class TestGaussianCNNModel(TfGraphTestCase):
def setup_method(self):
super().setup_method()
self.batch_size =... | 30,504 | 48.201613 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/models/test_gaussian_gru_model.py | import pickle
from unittest import mock
import numpy as np
import pytest
import tensorflow as tf
import tensorflow_probability as tfp
from garage.tf.models import GaussianGRUModel
from tests.fixtures import TfGraphTestCase
from tests.helpers import recurrent_step_gru
class TestGaussianGRUModel(TfGraphTestCase):
... | 18,127 | 47.084881 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/models/test_gaussian_lstm_model.py | import pickle
from unittest import mock
import numpy as np
import pytest
import tensorflow as tf
import tensorflow_probability as tfp
from garage.tf.models import GaussianLSTMModel
from tests.fixtures import TfGraphTestCase
from tests.helpers import recurrent_step_lstm
class TestGaussianLSTMModel(TfGraphTestCase):
... | 22,399 | 50.494253 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/models/test_gaussian_mlp_model.py | import pickle
import numpy as np
import pytest
import tensorflow as tf
import tensorflow_probability as tfp
from garage.tf.models import GaussianMLPModel
from tests.fixtures import TfGraphTestCase
class TestGaussianMLPModel(TfGraphTestCase):
def setup_method(self):
super().setup_method()
self.i... | 18,970 | 48.923684 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/models/test_gru.py | import numpy as np
import pytest
import tensorflow as tf
from garage.tf.models.gru import gru
from tests.fixtures import TfGraphTestCase
from tests.helpers import recurrent_step_gru
class TestGRU(TfGraphTestCase):
def setup_method(self):
super().setup_method()
self.batch_size = 2
self.hi... | 17,963 | 42.814634 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/models/test_gru_model.py | import pickle
import numpy as np
import pytest
import tensorflow as tf
from garage.tf.models import GRUModel
from tests.fixtures import TfGraphTestCase
class TestGRUModel(TfGraphTestCase):
def setup_method(self):
super().setup_method()
self.batch_size = 1
self.time_step = 1
self... | 4,926 | 43.387387 | 78 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/models/test_lstm.py | import numpy as np
import pytest
import tensorflow as tf
from garage.tf.models.lstm import lstm
from tests.fixtures import TfGraphTestCase
from tests.helpers import recurrent_step_lstm
class TestLSTM(TfGraphTestCase):
def setup_method(self):
super().setup_method()
self.batch_size = 2
sel... | 20,605 | 42.381053 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/models/test_lstm_model.py | import pickle
import numpy as np
import pytest
import tensorflow as tf
from garage.tf.models import LSTMModel
from tests.fixtures import TfGraphTestCase
class TestLSTMModel(TfGraphTestCase):
def setup_method(self):
super().setup_method()
self.batch_size = 1
self.time_step = 1
se... | 5,801 | 45.790323 | 78 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/models/test_mlp.py | import numpy as np
import tensorflow as tf
from garage.tf.models.mlp import mlp
from tests.fixtures import TfGraphTestCase
class TestMLP(TfGraphTestCase):
# pylint: disable=unsubscriptable-object
def setup_method(self):
super(TestMLP, self).setup_method()
self.obs_input = np.array([[1, 2, 3,... | 6,649 | 40.823899 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/models/test_mlp_concat.py | import numpy as np
import pytest
import tensorflow as tf
from garage.tf.models.mlp import mlp
from tests.fixtures import TfGraphTestCase
class TestMLPConcat(TfGraphTestCase):
# pylint: disable=unsubscriptable-object
def setup_method(self):
super(TestMLPConcat, self).setup_method()
self.obs_i... | 12,567 | 42.944056 | 78 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/models/test_mlp_model.py | import pickle
import numpy as np
import pytest
import tensorflow as tf
from garage.tf.models import MLPDuelingModel
from garage.tf.models import MLPMergeModel
from garage.tf.models import MLPModel
from tests.fixtures import TfGraphTestCase
class TestMLPModel(TfGraphTestCase):
def setup_method(self):
su... | 4,651 | 34.51145 | 78 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/models/test_model.py | import collections
import pickle
import numpy as np
import pytest
import tensorflow as tf
from garage.tf.models.mlp import mlp
from garage.tf.models.model import Model
from tests.fixtures import TfGraphTestCase
class SimpleModel(Model):
def __init__(self, output_dim=2, hidden_sizes=(4, 4), name=None):
... | 13,214 | 39.045455 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/models/test_parameter.py | import numpy as np
import tensorflow as tf
from garage.tf.models.parameter import parameter
from garage.tf.models.parameter import recurrent_parameter
from tests.fixtures import TfGraphTestCase
class TestParameter(TfGraphTestCase):
def setup_method(self):
super().setup_method()
self.input_vars =... | 1,901 | 38.625 | 75 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/optimizers/test_conjugate_gradient_optimizer.py | """Tests for garage.tf.optimizers.conjugateGradientOptimizer"""
import pickle
import numpy as np
import pytest
import tensorflow as tf
from garage.tf.optimizers.conjugate_gradient_optimizer import (
cg, ConjugateGradientOptimizer, FiniteDifferenceHvp, PearlmutterHvp)
from garage.tf.policies import Policy
from tes... | 10,947 | 35.372093 | 86 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/policies/__init__.py | 0 | 0 | 0 | py | |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/policies/test_categorical_cnn_policy.py | import pickle
from unittest import mock
import numpy as np
import pytest
import tensorflow as tf
from garage.envs import GarageEnv
from garage.tf.policies import CategoricalCNNPolicy
from tests.fixtures import TfGraphTestCase
from tests.fixtures.envs.dummy import DummyDictEnv, DummyDiscretePixelEnv
class TestCatego... | 5,520 | 41.79845 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/policies/test_categorical_gru_policy.py | import pickle
import numpy as np
import pytest
import tensorflow as tf
from garage.envs import GarageEnv
from garage.tf.policies import CategoricalGRUPolicy
# yapf: disable
from tests.fixtures import TfGraphTestCase # noqa: I202
from tests.fixtures.envs.dummy import (DummyBoxEnv,
... | 6,816 | 37.954286 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/policies/test_categorical_lstm_policy.py | import pickle
import numpy as np
import pytest
import tensorflow as tf
from garage.envs import GarageEnv
from garage.tf.policies import CategoricalLSTMPolicy
# yapf: disable
from tests.fixtures import TfGraphTestCase # noqa: I202
from tests.fixtures.envs.dummy import (DummyBoxEnv,
... | 6,823 | 37.994286 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/policies/test_categorical_mlp_policy.py | import pickle
import numpy as np
import pytest
import tensorflow as tf
from garage.envs import GarageEnv
from garage.tf.policies import CategoricalMLPPolicy
# yapf: disable
from tests.fixtures import TfGraphTestCase # noqa:I202
from tests.fixtures.envs.dummy import (DummyBoxEnv,
... | 4,229 | 34.546218 | 78 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/policies/test_categorical_policies.py | """
This script creates a unittest that tests Categorical policies in
garage.tf.policies.
"""
import gym
import pytest
from garage.envs import GarageEnv, normalize
from garage.experiment import LocalTFRunner
from garage.np.baselines import LinearFeatureBaseline
from garage.tf.algos import TRPO
from garage.tf.optimizer... | 1,653 | 32.755102 | 78 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/policies/test_continuous_mlp_policy.py | """Tests for garage.tf.policies.ContinuousMLPPolicy"""
import pickle
from unittest import mock
import numpy as np
import pytest
import tensorflow as tf
from garage.envs import GarageEnv
from garage.tf.policies import ContinuousMLPPolicy
from tests.fixtures import TfGraphTestCase
from tests.fixtures.envs.dummy import ... | 5,163 | 35.366197 | 76 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/policies/test_gaussian_gru_policy.py | import pickle
import numpy as np
import pytest
import tensorflow as tf
from garage.envs import GarageEnv
from garage.tf.policies import GaussianGRUPolicy
# yapf: disable
from tests.fixtures import TfGraphTestCase # noqa: I202
from tests.fixtures.envs.dummy import (DummyBoxEnv,
... | 7,502 | 37.086294 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/policies/test_gaussian_lstm_policy.py | import pickle
import numpy as np
import pytest
import tensorflow as tf
from garage.envs import GarageEnv
from garage.tf.policies import GaussianLSTMPolicy
# yapf: disable
from tests.fixtures import TfGraphTestCase # noqa: I202
from tests.fixtures.envs.dummy import (DummyBoxEnv,
... | 7,481 | 37.173469 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/policies/test_gaussian_mlp_policy.py | import pickle
import numpy as np
import pytest
import tensorflow as tf
from garage.envs import GarageEnv
from garage.tf.policies import GaussianMLPPolicy
# yapf: disable
from tests.fixtures import TfGraphTestCase # noqa: I202
from tests.fixtures.envs.dummy import (DummyBoxEnv,
... | 4,173 | 33.495868 | 78 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/policies/test_gaussian_mlp_task_embedding_policy.py | from itertools import chain
import pickle
from unittest import mock
# pylint: disable=wrong-import-order
import akro
import numpy as np
import pytest
import tensorflow as tf
from garage import InOutSpec
from garage.envs import GarageEnv
from garage.tf.embeddings import GaussianMLPEncoder
from garage.tf.policies impor... | 9,691 | 46.048544 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/policies/test_gaussian_policies.py | import gym
import pytest
from garage.envs import GarageEnv, normalize
from garage.experiment import LocalTFRunner
from garage.np.baselines import LinearFeatureBaseline
from garage.tf.algos import TRPO
from garage.tf.optimizers import ConjugateGradientOptimizer
from garage.tf.optimizers import FiniteDifferenceHvp
from ... | 1,531 | 33.818182 | 70 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/policies/test_policies.py | import tensorflow as tf
from garage.envs import GarageEnv
from garage.tf.policies import CategoricalGRUPolicy
from garage.tf.policies import CategoricalLSTMPolicy
from garage.tf.policies import CategoricalMLPPolicy
from garage.tf.policies import ContinuousMLPPolicy
from garage.tf.policies import GaussianGRUPolicy
from... | 3,262 | 36.505747 | 77 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/policies/test_qf_derived_policy.py | import pickle
import pytest
import tensorflow as tf
from garage.envs import GarageEnv
from garage.envs.wrappers import AtariEnv
from garage.tf.policies import DiscreteQfDerivedPolicy
from garage.tf.q_functions import DiscreteCNNQFunction
# yapf: disable
from tests.fixtures import TfGraphTestCase # noqa: I202
from t... | 3,698 | 38.351064 | 74 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/q_functions/__init__.py | 0 | 0 | 0 | py | |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/q_functions/test_continuous_cnn_q_function.py | import pickle
from unittest import mock
import numpy as np
import pytest
import tensorflow as tf
from garage.envs import GarageEnv
from garage.tf.q_functions import ContinuousCNNQFunction
from tests.fixtures import TfGraphTestCase
from tests.fixtures.envs.dummy import DummyDictEnv
from tests.fixtures.envs.dummy impor... | 14,300 | 39.86 | 78 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/q_functions/test_continuous_mlp_q_function.py | import pickle
from unittest import mock
import numpy as np
import pytest
import tensorflow as tf
from garage.envs import GarageEnv
from garage.tf.q_functions import ContinuousMLPQFunction
from tests.fixtures import TfGraphTestCase
from tests.fixtures.envs.dummy import DummyBoxEnv, DummyDictEnv
from tests.fixtures.mod... | 5,557 | 35.326797 | 76 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/q_functions/test_discrete_cnn_q_function.py | import pickle
from unittest import mock
import numpy as np
import pytest
import tensorflow as tf
from garage.envs import GarageEnv
from garage.tf.models import CNNModel
from garage.tf.q_functions import DiscreteCNNQFunction
from tests.fixtures import TfGraphTestCase
from tests.fixtures.envs.dummy import DummyDiscrete... | 11,327 | 43.423529 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/q_functions/test_discrete_mlp_q_function.py | import pickle
from unittest import mock
import numpy as np
import pytest
import tensorflow as tf
from garage.envs import GarageEnv
from garage.tf.q_functions.discrete_mlp_q_function import DiscreteMLPQFunction
from tests.fixtures import TfGraphTestCase
from tests.fixtures.envs.dummy import DummyDiscreteEnv
from tests... | 5,051 | 35.085714 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/regressors/__init__.py | 0 | 0 | 0 | py | |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/regressors/test_bernoulli_mlp_regressor.py | import pickle
from unittest import mock
import numpy as np
import pytest
import tensorflow as tf
from garage.tf.optimizers import ConjugateGradientOptimizer, LbfgsOptimizer
from garage.tf.regressors import BernoulliMLPRegressor
from tests.fixtures import TfGraphTestCase
def get_labels(input_shape, xs, output_dim):
... | 10,547 | 36.272085 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/regressors/test_categorical_mlp_regressor.py | import pickle
from unittest import mock
import numpy as np
import pytest
import tensorflow as tf
import tensorflow_probability as tfp
from garage.tf.optimizers import ConjugateGradientOptimizer, LbfgsOptimizer
from garage.tf.regressors import CategoricalMLPRegressor
from tests.fixtures import TfGraphTestCase
def ge... | 7,693 | 36.349515 | 78 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/regressors/test_continuous_mlp_regressor.py | import pickle
import numpy as np
import pytest
import tensorflow as tf
from garage.tf.optimizers import LbfgsOptimizer
from garage.tf.regressors import ContinuousMLPRegressor
from tests.fixtures import TfGraphTestCase
class TestContinuousMLPRegressor(TfGraphTestCase):
def test_fit_normalized(self):
cmr... | 4,360 | 39.757009 | 78 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/regressors/test_gaussian_cnn_regressor.py | import pickle
from unittest import mock
import numpy as np
import pytest
import tensorflow as tf
from garage.tf.optimizers import LbfgsOptimizer
from garage.tf.regressors import GaussianCNNRegressor
from tests.fixtures import TfGraphTestCase
def get_train_test_data():
matrices = [
np.linspace(i - 0.5, i... | 11,010 | 40.2397 | 78 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/regressors/test_gaussian_mlp_regressor.py | import pickle
import numpy as np
import pytest
import tensorflow as tf
from garage.tf.optimizers import PenaltyLbfgsOptimizer
from garage.tf.regressors import GaussianMLPRegressor
from tests.fixtures import TfGraphTestCase
class TestGaussianMLPRegressor(TfGraphTestCase):
# unmarked to balance test jobs
# @p... | 7,128 | 39.276836 | 78 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/samplers/__init__.py | 0 | 0 | 0 | py | |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/samplers/test_ray_batched_sampler_tf.py | """
Test whether tensorflow session is properly created and destroyed.
Other features of ray sampler are tested in
tests/garage/sampler/test_ray_sampler.py
"""
from unittest.mock import Mock
import ray
from garage.envs import GarageEnv, GridWorldEnv
from garage.np.policies import ScriptedPolicy
from garage.sampler... | 1,629 | 25.721311 | 78 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/samplers/test_task_embedding_worker.py | from unittest.mock import Mock
import numpy as np
from garage.envs import GarageEnv
from garage.tf.algos.te import TaskEmbeddingWorker
from tests.fixtures import TfGraphTestCase
from tests.fixtures.envs.dummy import DummyBoxEnv
class TestTaskEmbeddingWorker(TfGraphTestCase):
def test_task_embedding_worker(self... | 1,618 | 36.651163 | 69 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/samplers/test_tf_batch_sampler.py | import pytest
from garage.envs import GarageEnv
from garage.experiment import LocalTFRunner
from garage.np.baselines import LinearFeatureBaseline
from garage.tf.algos import VPG
from garage.tf.policies import CategoricalMLPPolicy
from garage.tf.samplers import BatchSampler
from tests.fixtures import snapshot_config
... | 1,960 | 34.654545 | 77 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/tf/samplers/test_tf_worker.py | import tensorflow as tf
from garage.experiment import LocalTFRunner
from garage.sampler import DefaultWorker
from garage.tf.samplers import TFWorkerWrapper
from tests.fixtures import snapshot_config
from tests.fixtures.envs.dummy import DummyBoxEnv
class TestTFWorker:
def test_tf_worker_with_default_session(sel... | 1,221 | 36.030303 | 76 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/torch/__init__.py | 0 | 0 | 0 | py | |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/torch/test_functions.py | """Module to test garage.torch._functions."""
import numpy as np
import pytest
import torch
import torch.nn.functional as F
from garage.torch import compute_advantages, pad_to_last
from garage.torch import dict_np_to_torch, global_device
from garage.torch import product_of_gaussians, set_gpu_mode, torch_to_np
import ... | 6,198 | 36.11976 | 78 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/torch/algos/__init__.py | 0 | 0 | 0 | py | |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/torch/algos/test_ddpg.py | """This script creates a test that fails when DDPG performance is too low."""
import gym
import pytest
import torch
from torch.nn import functional as F # NOQA
from garage.envs import GarageEnv, normalize
from garage.experiment import deterministic, LocalRunner
from garage.np.exploration_policies import AddOrnsteinUh... | 3,760 | 36.989899 | 77 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/torch/algos/test_maml.py | """Unit tests of MAML."""
from functools import partial
import pytest
try:
# pylint: disable=unused-import
import mujoco_py # noqa: F401
except ImportError:
pytest.skip('To use mujoco-based features, please install garage[mujoco].',
allow_module_level=True)
except Exception: # pylint: dis... | 3,881 | 37.435644 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/torch/algos/test_maml_ppo.py | """This script is a test that fails when MAML-TRPO performance is too low."""
import pytest
try:
# pylint: disable=unused-import
import mujoco_py # noqa: F401
except ImportError:
pytest.skip('To use mujoco-based features, please install garage[mujoco].',
allow_module_level=True)
except Exce... | 2,489 | 34.571429 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/torch/algos/test_maml_trpo.py | """This script is a test that fails when MAML-TRPO performance is too low."""
import pytest
try:
# pylint: disable=unused-import
import mujoco_py # noqa: F401
except ImportError:
pytest.skip('To use mujoco-based features, please install garage[mujoco].',
allow_module_level=True)
except Exce... | 3,098 | 33.054945 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/torch/algos/test_maml_vpg.py | """This script is a test that fails when MAML-VPG performance is too low."""
import pytest
try:
# pylint: disable=unused-import
import mujoco_py # noqa: F401
except ImportError:
pytest.skip('To use mujoco-based features, please install garage[mujoco].',
allow_module_level=True)
except Excep... | 3,003 | 36.55 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/torch/algos/test_mtsac.py | """Module for testing MTSAC."""
import numpy as np
import pytest
import torch
from torch.nn import functional as F
from garage.envs import GarageEnv, MultiEnvWrapper
from garage.envs.multi_env_wrapper import round_robin_strategy
from garage.experiment import deterministic, LocalRunner
from garage.replay_buffer import ... | 11,055 | 36.993127 | 78 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/torch/algos/test_pearl.py | """This script is a test that fails when PEARL performance is too low."""
import pickle
import pytest
try:
# pylint: disable=unused-import
import mujoco_py # noqa: F401
except ImportError:
pytest.skip('To use mujoco-based features, please install garage[mujoco].',
allow_module_level=True)... | 6,278 | 36.598802 | 79 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/torch/algos/test_pearl_worker.py | """This is a script to test PEARLWorker."""
import akro
import numpy as np
import torch.nn as nn
from torch.nn import functional as F # NOQA
from garage.envs import EnvSpec
from garage.envs import GarageEnv
from garage.torch.algos.pearl import PEARLWorker
from garage.torch.embeddings import MLPEncoder
from garage.to... | 3,383 | 40.268293 | 78 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/torch/algos/test_ppo.py | """This script creates a test that fails when PPO performance is too low."""
import gym
import pytest
import torch
from garage.envs import GarageEnv, normalize
from garage.experiment import deterministic, LocalRunner
from garage.torch.algos import PPO
from garage.torch.policies import GaussianMLPPolicy
from garage.tor... | 1,645 | 32.591837 | 78 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/torch/algos/test_sac.py | """Module for testing SAC loss functions."""
from unittest.mock import MagicMock
import gym
import numpy as np
import pytest
import torch
from torch.nn import functional as F
from garage.envs import GarageEnv, normalize
from garage.experiment import deterministic, LocalRunner
from garage.replay_buffer import PathBuff... | 9,098 | 32.7 | 77 | py |
CSD-locomotion | CSD-locomotion-master/garaged/tests/garage/torch/algos/test_trpo.py | """This script creates a test that fails when TRPO performance is too low."""
import gym
import pytest
import torch
from garage.envs import GarageEnv, normalize
from garage.experiment import deterministic, LocalRunner
from garage.torch.algos import TRPO
from garage.torch.policies import GaussianMLPPolicy
from garage.t... | 1,618 | 32.729167 | 78 | py |