from visualization.grill.config import ( output_dir, ashvin_base_dir, format_func, configure_matplotlib, ) import matplotlib.pyplot as plt from railrl.visualization import plot_util as plot configure_matplotlib(matplotlib) f = plot.filter_by_flat_params( {'replay_kwargs.fraction_goals_are_env_goals': 0.5}) exps = plot.load_exps([ ashvin_base_dir + 's3doodad/share/steven/pushing-multipushing/pusher-reward-variants' ], f, suppress_output=True) plot.tag_exps(exps, "name", "dsae") plot.comparison(exps, ["Final puck_distance Mean", "Final hand_distance Mean"], figsize=(6, 4), vary=["vae_wrapped_env_kwargs.reward_params.type"], default_vary={"reward_params.type": "unknown"}, smooth=plot.padded_ma_filter(10), xlim=(0, 250000), ylim=(0.15, 0.22), method_order=None) plt.gca().xaxis.set_major_formatter(plt.FuncFormatter(format_func)) plt.xlabel("Timesteps")
import matplotlib from visualization.grill.config import ( output_dir, ashvin_base_dir, format_func, configure_matplotlib, ) import matplotlib.pyplot as plt from railrl.visualization import plot_util as plot configure_matplotlib(matplotlib) dirs = [ ashvin_base_dir + 's3doodad/share/camera_ready_pick', ] pick_exps = plot.load_exps(dirs, suppress_output=True) plot.comparison( pick_exps, ["Final hand_and_obj_distance Mean"], [ # "seed", "exp_prefix", "train_vae_variant.vae_type", ], default_vary={"train_vae_variant.vae_type": True}, smooth=plot.padded_ma_filter(10), print_final=False, print_min=False, print_plot=True, xlim=(0, 500000),
configure_matplotlib, ) import matplotlib.pyplot as plt from railrl.visualization import plot_util as plot configure_matplotlib(matplotlib) f = plot.filter_by_flat_params({ 'algo_kwargs.num_updates_per_env_step': 4, 'replay_kwargs.fraction_goals_are_env_goals': 0.5 }) oracle = plot.load_exps( [ashvin_base_dir + "s3doodad/share/reacher/reacher-baseline-oracle"], suppress_output=True) plot.tag_exps(oracle, "name", "oracle") ours = plot.load_exps( [ashvin_base_dir + "s3doodad/share/reacher/reacher-main-results-ours"], suppress_output=True) plot.tag_exps(ours, "name", "ours") f = plot.filter_by_flat_params({ 'replay_kwargs.fraction_goals_are_env_goals': 0.0, 'reward_params.type': 'latent_distance' }) her = plot.load_exps( [ashvin_base_dir + "s3doodad/share/reward-reaching-sweep"], f,
import matplotlib.pyplot as plt from railrl.visualization import plot_util as plot ########## PUSHER PLOT dirs = [ '/home/ashvin/data/rail-khazatsky/sasha/cond-rig/hyp-tuning/tuning/batch_size/', ] #f = plot.filter_by_flat_params({'grill_variant.algo_kwargs.batch_size': 128, # 'grill_variant.algo_kwargs.num_trains_per_train_loop': 1000}) normal = plot.load_exps(dirs, suppress_output=True, progress_filename="tensorboard_log.csv") #f = plot.filter_by_flat_params({'grill_variant.algo_kwargs.num_trains_per_train_loop': 4000}) #4000_updates = plot.load_exps(dirs, f, suppress_output=True, progress_filename="tensorboard_log.csv") #f = plot.filter_by_flat_params({'grill_variant.algo_kwargs.batch_size': 1024}) #batch_1024 = plot.load_exps(dirs, f, suppress_output=True, progress_filename="tensorboard_log.csv") plot.comparison( normal, [ "evaluation/env_infos/final/current_object_distance_Mean", ], # "AverageReturn", "Final puck_distance Mean", "Final hand_and_puck_distance Mean"], # [ # 'train_vae_variant.algo_kwargs.batch_size', # 'train_vae_variant.latent_sizes' # ], [
import matplotlib from visualization.grill.config import ( output_dir, ashvin_base_dir, format_func, our_method_name, configure_matplotlib, ) import matplotlib.pyplot as plt from railrl.visualization import plot_util as plot configure_matplotlib(matplotlib) # f = plot.filter_by_flat_params({'algorithm': 'Ours'}) ours = plot.load_exps([ashvin_base_dir + "s3doodad/share/real-reacher/ours"], suppress_output=True) plot.tag_exps(ours, "name", "ours") # f = plot.filter_by_flat_params({'algorithm': 'Sparse-HER', 'reward_params.epsilon': 0.1}) her = plot.load_exps([ashvin_base_dir + "s3doodad/share/real-reacher/her"], suppress_output=True) plot.tag_exps(her, "name", "her") # f = plot.filter_by_flat_params({'algorithm': 'TDM'}) oracle = plot.load_exps( [ashvin_base_dir + "s3doodad/share/real-reacher/oracle"], suppress_output=True) plot.tag_exps(oracle, "name", "oracle") plot.comparison( ours + her + oracle, "Test Final End Effector Distance from Target Mean", vary=["name"],
our_method_name, configure_matplotlib, ) import matplotlib.pyplot as plt from railrl.visualization import plot_util as plot configure_matplotlib(matplotlib) dirs = [ ashvin_base_dir + 's3doodad/ashvin/vae/fixed3/sawyer-pusher/vae-dense-multi3/run1', ] f = plot.filter_by_flat_params({ 'algo_kwargs.num_updates_per_env_step': 4, "replay_kwargs.fraction_goals_are_env_goals": 0.5 }) ours = plot.load_exps(dirs, f, suppress_output=True) plot.tag_exps(ours, "name", "ours") dirs = [ ashvin_base_dir + 's3doodad/ashvin/vae/fixed3/sawyer-pusher/state-dense-multi1/run1', ] f = plot.filter_by_flat_params({ 'replay_kwargs.fraction_goals_are_env_goals': 0.5, 'algo_kwargs.reward_scale': 1e-4 }) oracle = plot.load_exps(dirs, f, suppress_output=True) plot.tag_exps(oracle, "name", "oracle") # dsae = plot.load_exps( # [ashvin_base_dir + 's3doodad/share/steven/pushing-multipushing/multipusher-reward-variants-spatial'], # plot.filter_by_flat_params({'training_mode': 'test'}),
import matplotlib from visualization.grill.config import ( output_dir, format_func, configure_matplotlib, ) import matplotlib.pyplot as plt from railrl.visualization import plot_util as plot configure_matplotlib(matplotlib) dirs = [ '/home/khazatsky/rail/data/rail-khazatsky/sasha/cond-rig/pointmass/baseline', ] VAE = plot.load_exps(dirs, suppress_output=True) plot.tag_exps(VAE, "name", "VAE") dirs = [ '/home/khazatsky/rail/data/rail-khazatsky/sasha/cond-rig/pointmass/standard', ] f = plot.exclude_by_flat_params({'grill_variant.vae_path': '/home/khazatsky/rail/data/rail-khazatsky/sasha/PCVAE/standard/run1002/id0/vae.pkl',}) CVAE = plot.load_exps(dirs, f, suppress_output=True) plot.tag_exps(CVAE, "name", "CVAE") dirs = [ '/home/khazatsky/rail/data/rail-khazatsky/sasha/cond-rig/pointmass/dynamics/run12', ] CDVAE = plot.load_exps(dirs, suppress_output=True) plot.tag_exps(CDVAE, "name", "Dynamics CVAE")
import matplotlib.pyplot as plt from railrl.visualization import plot_util as plot configure_matplotlib(matplotlib) dirs = [ ashvin_base_dir + 's3doodad/ashvin/vae/fixed3/sawyer-pusher/state-dense-wider2/run1', ] f = plot.filter_by_flat_params({ 'algo_kwargs.num_updates_per_env_step': 4, 'replay_kwargs.fraction_goals_are_env_goals': 0.0 }) oracle = plot.load_exps(dirs, f, suppress_output=True) plot.tag_exps(oracle, "name", "oracle") dirs = [ ashvin_base_dir + 's3doodad/ashvin/vae/fixed3/sawyer-pusher/vae-dense-wider3/run1', ashvin_base_dir + 's3doodad/ashvin/vae/fixed3/sawyer-pusher/vae-dense-wider3-relabeling/run1', ] f = plot.filter_by_flat_params({ 'algo_kwargs.num_updates_per_env_step': 4, "replay_kwargs.fraction_goals_are_env_goals": 0.5, "replay_kwargs.fraction_goals_are_rollout_goals": 0.2
import matplotlib from visualization.grill.config import ( output_dir, ashvin_base_dir, format_func, configure_matplotlib, ) import matplotlib.pyplot as plt from railrl.visualization import plot_util as plot configure_matplotlib(matplotlib) exps = plot.load_exps([ ashvin_base_dir + "s3doodad/share/reacher/reacher-abalation-resample-strategy" ], suppress_output=True) # plot.tag_exps(exps, "name", "oracle") plot.comparison( exps, "Final distance Mean", vary=[ "replay_kwargs.fraction_goals_are_env_goals", "replay_kwargs.fraction_goals_are_rollout_goals" ], # smooth=plot.padded_ma_filter(10), ylim=(0.04, 0.2), xlim=(0, 10000), method_order=[2, 1, 0, 3], figsize=(6, 4)) plt.gca().xaxis.set_major_formatter(plt.FuncFormatter(format_func))
import matplotlib from visualization.grill.config import ( output_dir, ashvin_base_dir, format_func, configure_matplotlib, ) import matplotlib.pyplot as plt from railrl.visualization import plot_util as plot configure_matplotlib(matplotlib) f = plot.filter_by_flat_params( {'replay_kwargs.fraction_goals_are_env_goals': 0.5}) exps = plot.load_exps( [ashvin_base_dir + "s3doodad/share/reward-reaching-sweep"], f, suppress_output=True) plot.comparison( exps, "Final distance Mean", vary=["reward_params.type"], # smooth=plot.padded_ma_filter(10), ylim=(0.0, 0.2), xlim=(0, 10000), # method_order=[1, 0, 2]), figsize=(6, 4), ) plt.gca().xaxis.set_major_formatter(plt.FuncFormatter(format_func)) plt.xlabel("Timesteps") plt.ylabel("Final Distance to Goal")
configure_matplotlib(matplotlib) dirs = [ ashvin_base_dir + 's3doodad/ashvin/vae/fixed3/sawyer-pusher/vae-dense-multi3/run1', ] f = plot.filter_by_flat_params({ 'algo_kwargs.num_updates_per_env_step': 4, 'rdim': 16, 'replay_kwargs.fraction_goals_are_rollout_goals': 0.2 }) her = plot.load_exps(dirs, f, suppress_output=True) dirs = [ ashvin_base_dir + 's3doodad/ashvin/vae/fixed3/sawyer-pusher/vae-dense-multi3/run1', ] f = plot.filter_by_flat_params({ 'algo_kwargs.num_updates_per_env_step': 4, 'rdim': 16, 'replay_kwargs.fraction_goals_are_rollout_goals': 1.0, 'replay_kwargs.fraction_goals_are_env_goals': 0.0 })
output_dir, ashvin_base_dir, configure_matplotlib, ) import matplotlib.pyplot as plt from railrl.visualization import plot_util as plot configure_matplotlib(matplotlib) f = plot.filter_by_flat_params({ 'grill_variant.algo_kwargs.rl_offpolicy_num_training_steps': 10000, }) ours = plot.load_exps([ ashvin_base_dir + "s3doodad/ashvin/corl2019/offpolicy/rig-dcvae-offpolicy2-sweep1/run3", ashvin_base_dir + "s3doodad/ashvin/corl2019/offpolicy/rig-dcvae-offpolicy2-sweep1/run4", ashvin_base_dir + "s3doodad/ashvin/corl2019/offpolicy/rig-dcvae-offpolicy2-sweep1/run5", ], f, suppress_output=True) plot.tag_exps(ours, "name", "off-policy") baseline = plot.load_exps([ashvin_base_dir + "s3doodad/ashvin/corl2019/offpolicy/rig-dcvae-offpolicy2-baseline", ], suppress_output=True) plot.tag_exps(baseline, "name", "on-policy") plot.comparison( ours + baseline, "evaluation/distance_to_target Mean", vary=["name"], # xlabel="evaluation/num steps total", figsize=(6, 4), # figsize=(7.5, 4),