| 244 | weight *= gain / torch.sqrt(weight.pow(2).sum(1, keepdim=True)) |
| 245 | |
| 246 | def 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 | |
| 267 | def plot_error_lines(name,list_mean,list_min,list_max,list_var,full_path): |
| 268 | plt.plot(list_mean,color='green',label="mean") |