In [1]:
from keras.datasets import cifar10
from keras.models import load_model
import numpy as np
from six.moves import cPickle as pickle
from IPython import display
import matplotlib.pyplot as plt
% matplotlib inline
% config InlineBackend.figure_format = 'retina'
In [2]:
def plotRecord(pickle_file):
with open("records/" + pickle_file, 'rb') as f:
records = pickle.load(f)
display.display(plt.gcf())
plt.figure(figsize=(10,8))
plt.plot(records["disc"], label='discriminitive loss')
plt.plot(records["gen"], label='generative loss')
plt.plot(records["acc_real"], label='discriminator accuracy on real images')
plt.plot(records["acc_gen"], label='discriminator accuracy on generated images')
plt.plot(records["acc_other"], label='discriminator accuracy on other images')
batch_count = [0.1 * n for n in records["gen_batches"]]
plt.plot(batch_count, label='scaled mean generator repeat batches')
plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.)
plt.ylim([0, 1.2])
plt.show()
In [3]:
for record in range(10):
plotRecord('record' + str(record) + '-500.pickle')
In [ ]: