Created
March 16, 2018 10:26
-
-
Save SSARCandy/96673019555d29ce806569c8dc9f9748 to your computer and use it in GitHub Desktop.
Manipulate visdom data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| import json | |
| def getWindowsName(data): | |
| d = data['jsons'] | |
| a = d.keys() | |
| for k in a: | |
| print(k, d[k]['title']) | |
| def movingAverage(x): | |
| for i in range(len(x)): | |
| x[i] = np.mean(x[i:i+1]) | |
| return x | |
| # plt.plot(movingAverage(np.linspace(0,50))) | |
| data1 = json.load(open('./r-7_3-rot270-transfer2.json')) | |
| data1 = data1['jsons']['window_3604e8f76930ec']['content']['data'] | |
| data2 = json.load(open('./r-7-3-transfer3.json')) | |
| data2 = data2['jsons']['window_360aa9da3fac66']['content']['data'] | |
| # print(len(data1[0]['x'])) | |
| plt.plot(data1[0]['x'][::1000], data1[0]['y'][::1000], label='less variation Baseline') | |
| plt.plot(data1[1]['x'][::1000], data1[1]['y'][::1000], label='less variation ADDA') | |
| plt.plot(data2[0]['x'][::1000], data2[0]['y'][::1000], label='more variation Baseline') | |
| plt.plot(data2[1]['x'][::1000], data2[1]['y'][::1000], label='more variation ADDA') | |
| plt.title('Breakout2Pong policy distillation transfer test') | |
| plt.legend() | |
| plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment