October 2018
Intermediate to advanced
472 pages
10h 57m
English
Now, let's get to plotting the train and validation loss progression during training. We will also plot the high-resolution image result from the model by feeding the test images:
loss = autoencoder_train.history['loss']val_loss = autoencoder_train.history['val_loss']epochs_ = [x for x in range(epochs)]plt.figure()plt.plot(epochs_, loss, label='Training loss')plt.plot(epochs_, val_loss, label='Validation loss')plt.title('Training and validation loss')plt.legend()plt.show()print('Input')plt.figure(figsize=(5,5))for i in range(9): plt.subplot(331 + i) plt.imshow(np.squeeze(XX_test.reshape(-1,14,14)[i]), cmap='gray')plt.show()# Test set resultsprint('GENERATED')plt.figure(figsize=(5,5))for i in range(9): pred = autoencoder.predict(XX_test.reshape(-1,14,14,1)[i:i+1], ...Read now
Unlock full access