#!/bin/bash
set -e

# Table 1

task="hopper"
env=config/env/$task/base.yml

# 2 GPUs
policy=config/policy/${task}/retrieve_and_play.yml
python launch_eval.py $env $policy --trials 100 --batched --results_file_name "temp"
python get_95_ci.py "temp"

# 2 GPUs
policy=config/policy/${task}/lwr.yml
python launch_eval.py $env $policy --trials 100 --batched --results_file_name "temp"
python get_95_ci.py "temp"

# 2 GPUs
policy=config/policy/$task/bc.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched --results_file_name "temp"
python get_95_ci.py "temp"

# 4 GPUs
policy=config/policy/${task}/regent.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched --results_file_name "temp"
python get_95_ci.py "temp"

# 2 GPUs
policy=config/policy/${task}/dan.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched --results_file_name "temp"
python get_95_ci.py "temp"

# 4 GPUs
policy=config/policy/${task}/dan_set_transformer.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched --results_file_name "temp"
python get_95_ci.py "temp"

task="ant"
env=config/env/$task/base.yml

# 2 GPUs
policy=config/policy/${task}/retrieve_and_play.yml
python launch_eval.py $env $policy --trials 100 --batched --results_file_name "temp"
python get_95_ci.py "temp"

# 2 GPUs
policy=config/policy/${task}/lwr.yml
python launch_eval.py $env $policy --trials 100 --batched --results_file_name "temp"
python get_95_ci.py "temp"

# 2 GPUs
policy=config/policy/$task/bc.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched --results_file_name "temp"
python get_95_ci.py "temp"

# 4 GPUs
policy=config/policy/${task}/regent.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched --results_file_name "temp"
python get_95_ci.py "temp"

# 2 GPUs
policy=config/policy/${task}/dan.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched --results_file_name "temp"
python get_95_ci.py "temp"

# 4 GPUs
policy=config/policy/${task}/dan_set_transformer.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched --results_file_name "temp"
python get_95_ci.py "temp"

task="walker"
env=config/env/$task/base.yml

# 2 GPUs
policy=config/policy/${task}/retrieve_and_play.yml
python launch_eval.py $env $policy --trials 100 --batched --results_file_name "temp"
python get_95_ci.py "temp"

# 2 GPUs
policy=config/policy/${task}/lwr.yml
python launch_eval.py $env $policy --trials 100 --batched --results_file_name "temp"
python get_95_ci.py "temp"

# 2 GPUs
policy=config/policy/$task/bc.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched --results_file_name "temp"
python get_95_ci.py "temp"

# 4 GPUs
policy=config/policy/${task}/regent.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched --results_file_name "temp"
python get_95_ci.py "temp"

# 2 GPUs
policy=config/policy/${task}/dan.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched --results_file_name "temp"
python get_95_ci.py "temp"

# 4 GPUs
policy=config/policy/${task}/dan_set_transformer.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched --results_file_name "temp"
python get_95_ci.py "temp"

task="halfcheetah"
env=config/env/$task/base.yml

# 2 GPUs
policy=config/policy/${task}/retrieve_and_play.yml
python launch_eval.py $env $policy --trials 100 --batched --results_file_name "temp"
python get_95_ci.py "temp"

# 2 GPUs
policy=config/policy/${task}/lwr.yml
python launch_eval.py $env $policy --trials 100 --batched --results_file_name "temp"
python get_95_ci.py "temp"

# 2 GPUs
policy=config/policy/$task/bc.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched --results_file_name "temp"
python get_95_ci.py "temp"

# 4 GPUs
policy=config/policy/${task}/regent.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched --results_file_name "temp"
python get_95_ci.py "temp"

# 2 GPUs
policy=config/policy/${task}/dan.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched --results_file_name "temp"
python get_95_ci.py "temp"

# 4 GPUs
policy=config/policy/${task}/dan_set_transformer.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched --results_file_name "temp"
python get_95_ci.py "temp"

# Table 2

task="stack_task_D0"
env=config/env/$task/base.yml

# 2 GPUs
policy=config/policy/${task}_low_dim/retrieve_and_play.yml
python launch_eval.py $env $policy --trials 100 --batched

# 2 GPUs
policy=config/policy/${task}_low_dim/lwr.yml
python launch_eval.py $env $policy --trials 100 --batched

# 2 GPUs
policy=config/policy/${task}_low_dim/bc.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched

# 2 GPUs
policy=config/policy/${task}_low_dim/dan.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched

task="threading_task_D0"
env=config/env/$task/base.yml

# 2 GPUs
policy=config/policy/${task}_low_dim/retrieve_and_play.yml
python launch_eval.py $env $policy --trials 100 --batched

# 2 GPUs
policy=config/policy/${task}_low_dim/lwr.yml
python launch_eval.py $env $policy --trials 100 --batched

# 2 GPUs
policy=config/policy/${task}_low_dim/bc.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched

# 2 GPUs
policy=config/policy/${task}_low_dim/dan.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched

task="square_task_D0"
env=config/env/$task/base.yml

# 2 GPUs
policy=config/policy/${task}_low_dim/retrieve_and_play.yml
python launch_eval.py $env $policy --trials 100 --batched

# 2 GPUs
policy=config/policy/${task}_low_dim/lwr.yml
python launch_eval.py $env $policy --trials 100 --batched

# 2 GPUs
policy=config/policy/${task}_low_dim/bc.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched

# 2 GPUs
policy=config/policy/${task}_low_dim/dan.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched

# Table 3

task="stack_task_D0"
env=config/env/$task/r3m.yml

# 4 GPUs
policy=config/policy/${task}_r3m/bc_r3m.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched

# 4 GPUs
policy=config/policy/${task}_r3m/dan_r3m.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched

task="threading_task_D0"
env=config/env/$task/r3m.yml

# 4 GPUs
policy=config/policy/${task}_r3m/bc_r3m.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched

# 4 GPUs
policy=config/policy/${task}_r3m/dan_r3m.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched

task="square_task_D0"
env=config/env/$task/r3m.yml

# 4 GPUs
policy=config/policy/${task}_r3m/bc_r3m.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched

# 4 GPUs
policy=config/policy/${task}_r3m/dan_r3m.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched

# Table 4

task="maze"
env=config/env/$task/base.yml

# 2 GPUs
policy=config/policy/$task/bc.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched

# 2 GPUs
policy=config/policy/$task/dan.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched

# Table 5

task="push_t"
env=config/env/$task/base.yml

# 2 GPUs
policy=config/policy/$task/bc.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched

# 2 GPUs
policy=config/policy/$task/dan.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched

# Figure 4

task="stack_task_D0"
env=config/env/$task/base.yml

# 2 GPUs
policy=config/policy/${task}_low_dim/bc_ensemble.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched

# 2 GPUs
policy=config/policy/${task}_low_dim/dan_no_action.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched

# 2 GPUs
policy=config/policy/${task}_low_dim/dan_no_delta.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched

# 2 GPUs
policy=config/policy/${task}_low_dim/dan_permutation_dependent.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched

# 2 GPUs
policy=config/policy/${task}_low_dim/dan_delta_magnitude.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched

# 2 GPUs
policy=config/policy/${task}_low_dim/dan_random_neighbors.yml
python launch_train.py $env $policy --sloppy
python launch_eval.py $env $policy --trials 100 --batched
