-
Notifications
You must be signed in to change notification settings - Fork 1
/
plot_loss.py
49 lines (40 loc) · 1.53 KB
/
plot_loss.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import numpy as np
import pandas as pd
#import matplotlib.pyplot as plt
#%matplotlib inline
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.optimizers import Adam
from keras.layers.normalization import BatchNormalization
from keras.utils import np_utils
from keras.layers import Conv2D, MaxPooling2D, ZeroPadding2D, GlobalAveragePooling2D
from keras.layers.advanced_activations import LeakyReLU
from keras.preprocessing.image import ImageDataGenerator
from keras.callbacks import ModelCheckpoint
from keras.callbacks import TensorBoard
from time import time
from keras.models import load_model
from copy import deepcopy
from keras.datasets import mnist
from keras.layers import Input, Dense, Reshape, Flatten, Dropout
from keras.layers import BatchNormalization, Activation, ZeroPadding2D
from keras.layers.advanced_activations import LeakyReLU
from keras.layers.convolutional import UpSampling2D, Conv2D
from keras.models import Sequential, Model
from keras.optimizers import Adam
import matplotlib.pyplot as plt
import sys
import numpy as np
import cv2
a = pd.read_csv('out_a_loss.csv')
b = pd.read_csv('out_b_loss.csv')
plt.figure()
plt.title('Plot of cross-entropy loss and attention loss for "GAN with attention loss" training')
plt.xlabel('epochs [0-29]')
plt.ylabel('loss')
plt.plot(a['Step'], a['Value'])
plt.plot(b['Step'], b['Value'])
plt.legend(('cross-entorpy loss','attention loss'), fontsize='x-small')
plt.show()
#plt.savefig('sense_ICDAR.png');