from plots import * from experiments import load_results from matplotlib.ticker import MultipleLocator, FuncFormatter d = load_results("lqr_imp_onpolicy") l = [2, 3, 4] marker = ["o", "v", "D", "*"] names = [r"TD $\searrow$", r"TD $\rightarrow$", r"TDC $\rightarrow$"] for i, m in enumerate(d["methods"]): if i not in l: m.hide = True else: m.ls = "-" m.name = names[0] m.marker = marker[0] marker = marker[1:] names = names[1:] if i == 4: m.ls = "--" plt.ioff() d["title"] = None f = plot_errorbar(criterion="RMSPBE", ncol=2, figsize=(6, 4), **d) major_formatter = FuncFormatter(lambda x, pos: str(int(x / 1000)) + "k" if x >= 1000 else str(x)) plt.gca().xaxis.set_major_formatter(major_formatter) plt.ylim(0, .4) plt.xlim(0, 15000) save_figure("td_rm", fig=f) marker = ["o", "v", "D", "*"]
from plots import * from experiments import load_results d = load_results("lqr_imp_offpolicy") l = [1,2,4,8] marker = ["o", "v", "D", "*"] names = [r"GTD2", r"TD $\searrow$", "TDC", "LSTD"] for i,m in enumerate(d["methods"]): if i not in l: m.hide=True else: m.marker = marker[0] marker = marker[1:] m.ls = "-" m.name = names[0] names = names[1:] plt.ioff() d["title"] = None a=0.75 f = plot_errorbar(criterion="RMSE", ncol=2, figsize=(a*7,a*4.5), kformatter=True, **d) plt.ylim(2,4) plt.xlim(0, 30000) #plt.xlim(0,15e3) save_figure("lqr_mse", fig=f)
from plots import * from experiments import load_results marker = ["o", "v", "D", "*", "1"] d = load_results("swingup_gauss_offpolicy") l = [7, 6, 8, 9] names = ["LSPE", "LSPE-TO", "LSTD-TO", "LSTD"] for i in l: m = d["methods"][i] m.ls = "-" m.name = names[0] names = names[1:] m.nobar = True m.marker = marker[0] marker = marker[1:] if m.name == "LSTD": m.nobar = True elif m.name == "LSTD-TO": m.ls = "--" plt.ioff() d["title"] = None f = plot_errorbar(criterion="RMSPBE", ncol=2, figsize=(6, 4), order=l, **d) plt.gca().set_yscale('log') #plt.ylim(0,3) save_figure("to", fig=f) marker = ["o", "v", "D", "*", "1"] d = load_results("lqr_imp_offpolicy") l = [6, 7, 8, 9] names = ["LSPE", "LSPE-TO", "LSTD-TO", "LSTD"] for i in l:
from plots import * from experiments import load_results d = load_results("lqr_imp_onpolicy") l = [1,4,6,9,11] marker = ["o", "v", "D", "*", ","] names = [r"GTD2", "TDC", "LSTD", "RG", "BRM"] for i,m in enumerate(d["methods"]): if i not in l: m.hide=True else: m.ls = "-" m.name = names[0] names = names[1:] m.marker = marker[0] marker = marker[1:] plt.ioff() d["title"] = None f = plot_errorbar(criterion="RMSPBE", ncol=3, kformatter=True, figsize=(0.8*7,0.8*4.5), **d) plt.ylim(0,.5) plt.xlim(0,15e3) save_figure("norm", fig=f) d = load_results("lqr_imp_onpolicy_unnorm") names = [r"GTD2", "TDC", "LSTD", "RG", "BRM"] marker = ["o", "v", "D", "*", ","] for i,m in enumerate(d["methods"]): if i not in l: m.hide=True else: m.ls = "-"
from plots import * from experiments import load_results d = load_results("disc_random_off") l = [11,12,13,14] for i,m in enumerate(d["methods"]): if i not in l: m.hide=True else: m.ls = "-" if i == 13: m.name="BRM DS" m.nobar=True m.marker = "o" elif i == 11: m.name="RG DS" m.marker = "v" elif i == 12: m.name="RG" m.marker = "D" elif i == 14: m.name="BRM" m.marker = "*" d["title"] = None a = 0.9 plt.ioff() f = plot_errorbar(criterion="RMSBE", ncol=2,figsize=(6 * a,4 * a), kformatter=True, **d) plt.title("") plt.ylim(0,1) save_figure("ds_off", fig=f)
from plots import * from experiments import load_results marker = ["o", "v", "D", "*", "1"] d = load_results("swingup_gauss_offpolicy") l = [7,6,8,9] names = ["LSPE", "LSPE-TO", "LSTD-TO", "LSTD"] for i in l: m = d["methods"][i] m.ls = "-" m.name = names[0] names = names[1:] m.nobar = True m.marker = marker[0] marker = marker[1:] if m.name == "LSTD": m.nobar=True elif m.name == "LSTD-TO": m.ls = "--" plt.ioff() d["title"] = None f = plot_errorbar(criterion="RMSPBE", ncol=2, figsize=(6,4), order=l, **d) plt.gca().set_yscale('log') #plt.ylim(0,3) save_figure("to", fig=f) marker = ["o", "v", "D", "*", "1"] d = load_results("lqr_imp_offpolicy") l = [6,7,8,9] names = ["LSPE", "LSPE-TO", "LSTD-TO", "LSTD"] for i in l:
from plots import * from experiments import load_results d = load_results("lqr_imp_onpolicy") l = [1, 4, 6, 9, 11] marker = ["o", "v", "D", "*", ","] names = [r"GTD2", "TDC", "LSTD", "RG", "BRM"] for i, m in enumerate(d["methods"]): if i not in l: m.hide = True else: m.ls = "-" m.name = names[0] names = names[1:] m.marker = marker[0] marker = marker[1:] plt.ioff() d["title"] = None f = plot_errorbar(criterion="RMSPBE", ncol=3, kformatter=True, figsize=(0.8 * 7, 0.8 * 4.5), **d) plt.ylim(0, .5) plt.xlim(0, 15e3) save_figure("norm", fig=f) d = load_results("lqr_imp_onpolicy_unnorm") names = [r"GTD2", "TDC", "LSTD", "RG", "BRM"] marker = ["o", "v", "D", "*", ","] for i, m in enumerate(d["methods"]):
from plots import * from experiments import load_results d = load_results("disc_random_off") l = [11, 12, 13, 14] for i, m in enumerate(d["methods"]): if i not in l: m.hide = True else: m.ls = "-" if i == 13: m.name = "BRM DS" m.nobar = True m.marker = "o" elif i == 11: m.name = "RG DS" m.marker = "v" elif i == 12: m.name = "RG" m.marker = "D" elif i == 14: m.name = "BRM" m.marker = "*" d["title"] = None a = 0.9 plt.ioff() f = plot_errorbar(criterion="RMSBE", ncol=2, figsize=(6 * a, 4 * a), kformatter=True,
from plots import * from experiments import load_results marker = ["o", "v", "D", "*", "1"] d = load_results("disc_random_on") l = [0,3,4,6,9] names = ["GTD", "TD", "TDC", "LSTD", "RG"] for i,m in enumerate(d["methods"]): if i not in l: m.hide=True else: m.ls = "-" m.name = names[0] names = names[1:] m.marker = marker[0] marker = marker[1:] d["title"] = "400 State Random MDP On-Policy" plt.ioff() f = plot_errorbar(criterion="RMSPBE", figsize=(6,4), ncol=3, kformatter=True, **d) #plt.ylim(0,2) save_figure("error_diff_MSPBE", fig=f) f = plot_errorbar(criterion="RMSE", figsize=(6,4),kformatter=True,ncol=3, **d) plt.ylim(0,14) save_figure("error_diff_MSE", fig=f)
from plots import * from experiments import load_results d = load_results("lqr_imp_offpolicy") l = [1, 2, 4, 8] marker = ["o", "v", "D", "*"] names = [r"GTD2", r"TD $\searrow$", "TDC", "LSTD"] for i, m in enumerate(d["methods"]): if i not in l: m.hide = True else: m.marker = marker[0] marker = marker[1:] m.ls = "-" m.name = names[0] names = names[1:] plt.ioff() d["title"] = None a = 0.75 f = plot_errorbar(criterion="RMSE", ncol=2, figsize=(a * 7, a * 4.5), kformatter=True, **d) plt.ylim(2, 4) plt.xlim(0, 30000) #plt.xlim(0,15e3) save_figure("lqr_mse", fig=f)
from plots import * from experiments import load_results from matplotlib.ticker import MultipleLocator, FuncFormatter d = load_results("lqr_imp_onpolicy") l = [2,3,4] marker = ["o", "v", "D", "*"] names = [r"TD $\searrow$", r"TD $\rightarrow$", r"TDC $\rightarrow$"] for i,m in enumerate(d["methods"]): if i not in l: m.hide=True else: m.ls = "-" m.name = names[0] m.marker = marker[0] marker = marker[1:] names = names[1:] if i == 4: m.ls = "--" plt.ioff() d["title"] = None f = plot_errorbar(criterion="RMSPBE", ncol=2, figsize=(6,4), **d) major_formatter = FuncFormatter(lambda x,pos: str(int(x/1000))+"k" if x >= 1000 else str(x)) plt.gca().xaxis.set_major_formatter(major_formatter) plt.ylim(0,.4) plt.xlim(0,15000) save_figure("td_rm", fig=f) marker = ["o", "v", "D", "*"] names = [r"TD $\searrow$", r"TD $\rightarrow$", r"TDC $\rightarrow$"]