MCPcopy Create free account
hub / github.com/BIT-MCS/DRL-eFresh / plot_line

Function plot_line

utils/base_utils.py:246–265  ·  view source on GitHub ↗
(name,list_data,full_path)

Source from the content-addressed store, hash-verified

244 weight *= gain / torch.sqrt(weight.pow(2).sum(1, keepdim=True))
245
246def plot_line(name,list_data,full_path):
247 pdf = PdfPages(full_path+"/"+name+'.pdf')
248
249 plt.figure(figsize=(20, 13))
250 plt.xticks(fontsize=40)
251 plt.yticks(fontsize=40)
252
253 plt.plot(list_data,linewidth=4)
254 if params.trainable is True:
255 plt.xlabel("Training episode",fontsize=40)
256 else:
257 plt.xlabel("Step",fontsize=40)
258 plt.ylabel(name,fontsize=40)
259 plt.grid(True)
260 plt.grid(linestyle='--')
261 plt.savefig(full_path + "/"+name+'.png')
262 pdf.savefig()
263
264 plt.close()
265 pdf.close()
266
267def plot_error_lines(name,list_mean,list_min,list_max,list_var,full_path):
268 plt.plot(list_mean,color='green',label="mean")

Callers 2

trainFunction · 0.90
draw_pathMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected