-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexp.py
26 lines (20 loc) · 813 Bytes
/
exp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import numpy as np
import matplotlib.pyplot as plt
import os, imageio
from Config import *
args = GetConfiguration()
args.model_dir = os.path.abspath(os.path.join(os.path.dirname(__file__),os.path.pardir)) + '/SmartST/model_saved_rl/'
args.result_dir = os.path.abspath(os.path.join(os.path.dirname(__file__),os.path.pardir)) + '/SmartST/result_saved_rl/'
if __name__ == '__main__':
for i in range(100):
a = np.random.randn(50, 1)
_, _ = plt.subplots()
plt.plot(a)
plt.savefig(args.result_dir + 'test{}'.format(i) + '.png')
print(i)
plots = []
for i in range(100):
save_fn = args.result_dir + 'test{}'.format(i) + '.png'
plots.append(imageio.imread(save_fn))
print(i)
imageio.mimsave(args.result_dir + 'test.gif', plots, fps=5)