Last active
December 3, 2019 23:17
-
-
Save aurotripathy/a542493ecd7aad237323878ab11a3943 to your computer and use it in GitHub Desktop.
plot of Top1/Top5 validation accuracy for ImageNet training
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from pudb import set_trace | |
import matplotlib | |
import matplotlib.pyplot as plt | |
import numpy as np | |
with open('good_run_raport.json') as json_file: | |
data = json.load(json_file) | |
print("top 5") | |
val_top5 = data['epoch']['val.top5'] | |
print(val_top5) | |
print(len(val_top5)) | |
print("top 1") | |
val_top1 = data['epoch']['val.top1'] | |
print(val_top1) | |
print(len(val_top1)) | |
# Plots | |
epochs = np.arange(len(val_top1)) | |
val_acc_top1 = val_top1 | |
val_acc_top5 = val_top5 | |
fig, ax = plt.subplots() | |
ax.plot(epochs, val_acc_top1, 'k--', label='Top1') | |
ax.plot(epochs, val_acc_top5, 'k:', label='Top5') | |
ax.set(xlabel='epochs (s)', ylabel='Validation accuracy', | |
title='Validation accuracy over {} epochs'.format(len(val_top1))) | |
ax.grid() | |
legend = ax.legend(loc='lower right', shadow=False, fontsize='x-large') | |
fig.savefig("/dockerx/val_plot.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment