In [1]:
from matplotlib import pyplot as plt
import numpy as np
import json
from collections import defaultdict

In [27]:
%matplotlib inline
import seaborn as sns
import warnings
from jupyterthemes import jtplot
jtplot.style()
sns.set_context("poster")
# plt.style.use('fivethirtyeight')
warnings.filterwarnings("ignore")

In [45]:
history_data = defaultdict(lambda: [])

In [46]:
with open('history_9_original.json', 'r') as f:
    history = json.load(f)
for h in history:
    for k, v in h.items():
        history_data[k].extend(v)

In [47]:
with open('history_90.json', 'r') as f:
    history = json.load(f)
for h in history:
    for k, v in h.items():
        history_data[k].extend(v)
        
print(len(history))


5

In [48]:
def plot_history(keys_to_plot):
    for k in keys_to_plot:
        v = history_data[k]
        plt.plot(np.arange(len(v)), v, label=k)
    
    plt.legend()

In [49]:
plot_history(['loss', 'val_loss'])



In [50]:
plt.figure(figsize=(20,40))
for i in range(30):
    plt.subplot(10, 3, i+1)
    plot_history(['steer_output_{}_loss'.format(i), 'val_steer_output_{}_loss'.format(i)])
    
plt.tight_layout()



In [ ]:


In [ ]: