grad_step_size=fast_learning_rate, hidden_nonlinearity=tf.nn.relu, hidden_sizes=variant['hidden_sizes'], ) baseline = LinearFeatureBaseline(env_spec=env.spec) algo = MAMLTRPO( env=env, policy=policy, baseline=baseline, batch_size=fast_batch_size, # number of trajs for grad update max_path_length=max_path_length, meta_batch_size=meta_batch_size, num_grad_updates=num_grad_updates, n_itr=1000, use_maml=True, step_size=meta_step_size, plot=False, numExpertPolicies=20, expertDataInfo={ 'expert_loc': expertDataLoc, 'expert_itr': expertDataItr }) algo.train() args = dd.get_args() experiment(args['variant'])
import doodad try: import cloudpickle except ImportError as e: raise ImportError("cloudpickle must be installed inside the docker image") def failure(): raise ValueError("Must provide run_method via doodad args!") fn = doodad.get_args('run_method', failure) fn()
import doodad as dd from mujoco_torch.doodad.launcher import run_experiment_here args_dict = dd.get_args() method_call = args_dict['method_call'] run_experiment_kwargs = args_dict['run_experiment_kwargs'] output_dir = args_dict['output_dir'] run_mode = args_dict.get('mode', None) if run_mode and run_mode == 'ec2': try: import urllib.request instance_id = urllib.request.urlopen( 'http://169.254.169.254/latest/meta-data/instance-id').read( ).decode() run_experiment_kwargs['variant']['EC2_instance_id'] = instance_id except Exception as e: print("Could not get instance ID. Error was...") print(e) run_experiment_here(method_call, log_dir=output_dir, **run_experiment_kwargs)
import doodad try: import cloudpickle except ImportError as e: raise ImportError("cloudpickle must be installed inside the docker image") def failure(): raise ValueError("Must provide run_method via doodad args!") fn = doodad.get_args("run_method", failure) fn()