<jupyter_start><jupyter_text>CS 294-112 HW1 by <NAME><jupyter_code>import matplotlib.pyplot as plt
%matplotlib inline<jupyter_output><empty_output><jupyter_text>Behavior Cloning<jupyter_code>ant_mean = [-1460.92, -1066.13, -665.21, -122.57, -86.25, 186.88, 2098.36, 3893.21, 4323.24, 4624.35]
ant_std = [4266.55, 3100.68, 1598.31, 118.59, 562.03, 395.22, 1449.51, 1311.17, 929.26, 424.38]
walker_mean = [-9.11, -4.48, 0.29, 0.34, 17.31, 194.50, 556.80, 1017.75, 2948.32, 2095.27]
walker_std = [4.48, 4.19, 1.34, 1.10, 57.32, 76.60, 461.12, 1181.55, 1859.34, 2322.00]
iters = [2000, 4000, 6000, 8000, 10000, 12000, 14000, 16000, 18000, 20000]
fig = plt.figure()
plt.plot(iters, ant_mean, '-o', label='Ant')
plt.plot(iters, walker_mean, '-o', label='Walker2d')
plt.xlabel("# of training iters")
plt.ylabel("mean returns")
plt.legend(loc='upper left')

plt.show()
fig.savefig("2_3.png")<jupyter_output><empty_output><jupyter_text>DAgger<jupyter_code>iters = list(range(3000, 30001, 3000))
expert_mean = [5526.56] * 10
expert_std = [75.39] * 10
bc_mean = [2.048825729533947, 10.682123592608736, 227.72754209253344, 337.23240429046575, 935.4274214659679, 3756.175126908764, 4873.271148216538, 4877.510333759826, 5305.142308685753, 5475.865628757152]
bc_std = [8.37089241725072, 33.315375598497035, 190.39954969044013, 218.70745266110936, 762.1845151706294, 1881.6429904884144, 1339.223052963209, 1409.5492388530988, 631.4809302973441, 100.34235852707677]
dagger_mean = [4.215569958396953, 35.828567470873544, 111.31231025561442, 254.21277125659654, 353.3356154806296, 936.0091061247847, 4018.2484973528963, 5042.728810375072, 4966.448988843131, 5303.610505155891]
dagger_std = [5.648878657649213, 73.26302177732202, 112.81851142152045, 214.1124394759466, 206.0031634021088, 1437.7073909201265, 1815.34245565631, 1238.7470043518192, 1411.2002402452702, 778.5906652859775]
fig = plt.figure()
plt.plot(iters, expert_mean, '-o', label='Expert')
plt.plot(iters, dagger_mean, '-o', label='DAgger')
plt.plot(iters, bc_mean, '-o', label='BC')

plt.xlabel("# of training iters")
plt.ylabel("mean returns")
plt.legend(loc='lower right')
plt.title("Walker2d Policy Performance Comparison")
plt.show()
fig.savefig("3_2.png")
fig = plt.figure()
plt.plot(iters, expert_mean, 'o', label='Expert')
plt.plot(iters, dagger_mean, 'o', label='DAgger')
plt.plot(iters, bc_mean, 'o', label='BC')

plt.errorbar(iters, bc_mean, yerr=bc_std)
plt.errorbar(iters, dagger_mean, yerr=dagger_std)
plt.errorbar(iters, expert_mean, yerr=expert_std)

plt.xlabel("# of training iters")
plt.ylabel("mean returns")
plt.legend(loc='lower right')
plt.title("Walker2d Policy Performance Comparison (Error Bar)")
plt.show()

fig.savefig("3_2_error.png")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16654492330168005, 'fraction_numerical': 0.34368151935719504, 'mean_word_length': 6.6722689075630255, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '337986', 'license': 'MIT', 'n_tokens_mistral': 1845, 'n_tokens_neox': 1206, 'n_words': 205, 'path': 'hw1/report.ipynb', 'repo_name': 'yujialuo/Deep-reinforcement-learning', 'size': '2741'}