예제 #1
0
lr = plot.load_exps(
    [vitchyr_base_dir + "papers/nips2018/06-06-lr-baseline-pusher-0.2-range/"],
    plot.filter_by_flat_params({
        'rdim': '16--lr-1e-3',
    }),
    suppress_output=True,
)
plot.tag_exps(lr, "name", "l&r")

plot.comparison(
    #lr + ours + oracle + her + dsae,
    ours + oracle + her + lr + dsae,
    ["Final  puck_distance Mean", "Final  hand_distance Mean"],
    vary=["name"],
    smooth=plot.padded_ma_filter(10),
    #method_order=[4, 0, 1, 3, 2],
    ylim=(0.1, 0.28),
    # xlim=(0, 250000),
    xlim=(0, 500000),
    figsize=(6, 4),
)
plt.gca().xaxis.set_major_formatter(plt.FuncFormatter(format_func))
plt.xlabel("Timesteps")
plt.ylabel("")  # "Final Distance to Goal")
plt.title("Visual Pusher Baselines")
plt.legend([])  # [our_method_name, "DSAE", "HER", "Oracle", "L&R", ])

plt.tight_layout()
plt.savefig(output_dir + "pusher_baselines.pdf")
print("File saved to", output_dir + "pusher_baselines.pdf")
예제 #2
0
configure_matplotlib(matplotlib)

dirs = [
    ashvin_base_dir + 's3doodad/share/camera_ready_door',
]
exps = plot.load_exps(dirs, suppress_output=True)

plot.comparison(
    exps,
    ["Final angle_difference Mean"],
    [
        #             "seed",
        "exp_prefix",
    ],
    default_vary={"env_kwargs.randomize_position_on_reset": True},
    smooth=plot.padded_ma_filter(10),
    print_final=False,
    print_min=False,
    print_plot=True,
    xlim=(0, 200000),
    #           ylim=(0, 0.35),
    figsize=(6, 4),
    method_order=(3, 2, 4, 0, 1),
)
plt.gca().xaxis.set_major_formatter(plt.FuncFormatter(format_func))
plt.xlabel("Timesteps")
plt.ylabel("Final Distance to Goal")
plt.legend([])
#     [],
#     [
#         "RIG",
예제 #3
0
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
})
exps = plot.load_exps(dirs, suppress_output=True)
plot.comparison(
    exps,
    ["Final  puck_distance Mean", "Final  hand_distance Mean"],
    vary=[
        "replay_kwargs.fraction_goals_are_env_goals",
        "replay_kwargs.fraction_goals_are_rollout_goals"
    ],
    default_vary={"replay_strategy": "future"},
    smooth=plot.padded_ma_filter(10),
    xlim=(0, 500000),
    ylim=(0.14, 0.26),
    figsize=(6, 5),
    method_order=[2, 1, 0, 3],
)
plt.gca().xaxis.set_major_formatter(plt.FuncFormatter(format_func))
# plt.ylabel("")
plt.xlabel("Timesteps")
plt.ylabel("Final Distance to Goal")
plt.title("Visual Pusher")
plt.legend(
    [
        our_method_name,
        "None",
예제 #4
0
import matplotlib.pyplot as plt
from rlkit.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")
plt.title("Visual Reacher")
plt.legend([])
plt.tight_layout()
plt.savefig(output_dir + "reacher_reward_type_ablation.pdf")
print("File saved to", output_dir + "reacher_reward_type_ablation.pdf")
예제 #5
0
dsae = plot.load_exps(
    [ashvin_base_dir + 's3doodad/share/steven/no-relabeling-test'],
    suppress_output=True)
plot.tag_exps(dsae, "name", "dsae")
lr = plot.load_exps([
    vitchyr_base_dir +
    "papers/nips2018/autoencoder_result/05-25-sawyer-reacher-autoencoder-ablation-final/"
],
                    suppress_output=True)
plot.tag_exps(lr, "name", "l&r")

plot.comparison(
    ours + oracle + her + lr + dsae,
    "Final  distance Mean",
    vary=["name"],
    figsize=(6, 4),
    # figsize=(7.5, 4),
    method_order=[4, 0, 1, 3, 2],
    ylim=(0.0, 0.25),
    xlim=(0, 10000),
)
plt.gca().xaxis.set_major_formatter(plt.FuncFormatter(format_func))
plt.xlabel("Timesteps")
plt.ylabel("Final Distance to Goal")
plt.title("Visual Reacher Baselines")

plt.legend([])
# plt.tight_layout()
# plt.savefig(output_dir + "reacher_baselines.pdf")
# print("File saved to", output_dir + "reacher_baselines.pdf")

# plt.legend(
예제 #6
0
from rlkit.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))
plt.xlabel("Timesteps")
plt.ylabel("Final Distance to Goal")
plt.title("Visual Reacher")
# plt.legend([]) # ["Ours", "No Relabeling", "HER", "VAE Only", ])
plt.legend([])
plt.tight_layout()
plt.savefig(output_dir + "reacher_relabeling_ablation.pdf")
print("File saved to", output_dir + "reacher_relabeling_ablation.pdf")
예제 #7
0
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"],
    ylim=(0.0, 0.35),
    xlim=(0, 10000),
    method_order=[2, 0, 1],
    figsize=(6, 5),
)
plt.gca().xaxis.set_major_formatter(plt.FuncFormatter(format_func))
plt.ylabel("Final Distance to Goal")
plt.title("Real-World Visual Reacher")
leg = plt.legend(
    [our_method_name, "HER", "Oracle"],
    bbox_to_anchor=(0.49, -0.2),
    loc="upper center",
    ncol=4,
    handlelength=1,
)
leg.get_frame().set_alpha(0.9)
예제 #8
0
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")

plot.comparison(
    ours + logprob + exps,
    "Final  total_distance Mean",
    figsize=(7.5, 4),
    vary=["name"],
    default_vary={"reward_params.type": "unknown"},
    smooth=plot.padded_ma_filter(10),
    xlim=(0, 250000),
    method_order=[1, 0, 2],
)
plt.gca().xaxis.set_major_formatter(plt.FuncFormatter(format_func))
plt.xlabel("Timesteps")
plt.ylabel("")
plt.title("Visual Multi-object Pusher")
plt.legend([our_method_name, "Log Prob.", "Pixel MSE", ],
    bbox_to_anchor=(1.0, 0.5), loc="center left",)
plt.tight_layout()
plt.savefig(output_dir + "multiobj_pusher_reward_type_ablation.pdf")
print("File saved to", output_dir + "multiobj_pusher_reward_type_ablation.pdf")
예제 #9
0
from rlkit.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")
plt.ylabel("")
plt.title("Visual Pusher")
plt.legend([])
plt.tight_layout()
plt.savefig(output_dir + "pusher_reward_type_ablation.pdf")
예제 #10
0
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),
    #           ylim=(0, 0.35),
    figsize=(7.5, 4),
    method_order=(2, 1, 3, 4, 0),
)
plt.gca().xaxis.set_major_formatter(plt.FuncFormatter(format_func))
plt.xlabel("Timesteps")
plt.ylabel("")
# plt.legend()
plt.legend(
    [
        "RIG",
예제 #11
0
colors = plt.rcParams['axes.prop_cycle'].by_key()['color']
label_to_color = {
    'ours': colors[0],
    'oracle': colors[3],
    'her': colors[1],
    'dsae': colors[2],
    'l&r': colors[4],
}
plot.comparison(
    ours + oracle + dsae + lr + her,
    ["Final  total_distance Mean"],
    vary=["name"],
    # default_vary={"replay_strategy": "future"},
    smooth=plot.padded_ma_filter(10),
    # xlim=(0, 250000),
    xlim=(0, 500000),
    ylim=(0.15, 0.4),
    # figsize=(7, 3.5),
    figsize=(7.5, 4),
    method_order=[4, 0, 1, 3, 2],
    # label_to_color=label_to_color,
)
plt.gca().xaxis.set_major_formatter(plt.FuncFormatter(format_func))
# leg.get_frame().set_alpha(0.9)
plt.xlabel("Timesteps")
plt.ylabel("") # "Final Distance to Goal")
plt.title("Visual Multi-object Pusher Baselines")
plt.legend(
    [
        our_method_name,
        "DSAE",
예제 #12
0
    0.0
})
norelabel = plot.load_exps(dirs, f, suppress_output=True)

dirs = [
    ashvin_base_dir +
    's3doodad/ashvin/vae/fixed3/sawyer-pusher/vae-dense-multi3-fullrelabel/run1',
]
fullrelabel = plot.load_exps(dirs, suppress_output=True)
plot.comparison(
    her + fullrelabel + norelabel,
    "Final  total_distance Mean",
    [
        "replay_kwargs.fraction_goals_are_rollout_goals",
        "replay_kwargs.fraction_goals_are_env_goals",
    ],
    #            ["training_mode", "replay_kwargs.fraction_goals_are_env_goals", "replay_kwargs.fraction_goals_are_rollout_goals", "rdim"],
    default_vary={"replay_strategy": "future"},
    smooth=plot.padded_ma_filter(10),
    figsize=(7.5, 4),
    xlim=(0, 500000),
    ylim=(0.15, 0.35),
    method_order=[1, 2, 0, 3])
plt.gca().xaxis.set_major_formatter(plt.FuncFormatter(format_func))
plt.ylabel("")
plt.xlabel("Timesteps")
plt.title("Visual Multi-object Pusher")
leg = plt.legend(
    [
        our_method_name,
        "None",
        "Future",