Exemple #1
0
 def initialize(self, out_dir):
     if not gfile.Exists(out_dir / "tb"):
         gfile.MakeDirs(out_dir / "tb")
     if not gfile.Exists(out_dir / "weights"):
         gfile.MakeDirs(out_dir / "weights")
     if not gfile.Exists(out_dir / "policy"):
         gfile.MakeDirs(out_dir / "policy")
     if not gfile.Exists(out_dir / "videos"):
         gfile.MakeDirs(out_dir / "videos")
     self.env = gym.from_config(self.env_params)
     self.initialize_params()
Exemple #2
0
 def initialize(self, out_dir):
     if not gfile.Exists(out_dir / "tb"):
         gfile.MakeDirs(out_dir / "tb")
     if not gfile.Exists(out_dir / "weights"):
         gfile.MakeDirs(out_dir / "weights")
     if not gfile.Exists(out_dir / "weights"):
         gfile.MakeDirs(out_dir / "weights")
     if not gfile.Exists(out_dir / "data"):
         gfile.MakeDirs(out_dir / "data")
     self.model.initialize()
     self.env = gym.from_config(self.env_params)
     self.model.make_summaries(self.env)
Exemple #3
0
from path import Path
from deepx import nn
from parasol.experiment import run, sweep
import parasol.gym as gym

env_params = {
    "environment_name": "Reacher",
    "random_start": True,
    "random_target": True,
    "image": True,
    "image_dim": 64,
}
env = gym.from_config(env_params)
do = env.get_state_dim()
ds = 10
du = da = env.get_action_dim()
horizon = 50

experiment = dict(
    experiment_name='reacher-image-mpc',
    experiment_type='train_vae',
    env=env_params,
    model=dict(
        do=do, du=du, ds=ds, da=da, horizon=horizon,
        state_encoder=(nn.Reshape(do, [64, 64, 3])
                    >> nn.Convolution([7, 7, 64], strides=(1, 1)) >> nn.Relu()
                    >> nn.Convolution([5, 5, 32], strides=(2, 2))
                    >> nn.Convolution([3, 3, 8], strides=(2, 2))
                    >> nn.Flatten() >> nn.Relu(256) >> nn.Gaussian(ds)),
        state_decoder=(nn.Relu(ds, 512) >> nn.Reshape([8, 8, 8])
                    >> nn.Deconvolution([3, 3, 32])