In [ ]:
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
%matplotlib inline
In [19]:
# !python sparse_dqn.py --sparse --timesteps 100000 --results_path results.sparse
# !python sparse_dqn.py --dense --timesteps 100000 --results_path results.dense
In [20]:
sparse = pd.read_csv('results.sparse/SeaquestDeterministic-v4.train.csv')
dense = pd.read_csv('results.dense/SeaquestDeterministic-v4.train.csv')
In [21]:
fig, ax = plt.subplots(figsize=(20,5))
ax.plot(sparse['values'])
fig.suptitle('Value Function (Sparse)', fontsize=16)
ax.legend()
Out[21]:
In [22]:
sparse['values'].describe()
Out[22]:
In [23]:
fig, ax = plt.subplots(figsize=(20,5))
ax.plot(dense['values'])
fig.suptitle('Value Function (Dense)', fontsize=16)
ax.legend()
Out[23]:
In [24]:
dense['values'].describe()
Out[24]:
In [25]:
fig, ax = plt.subplots(figsize=(20,5))
ax.plot(sparse['values'].rolling(10000).mean(), label='sparse')
ax.plot(dense['values'].rolling(10000).mean(), label='dense')
fig.suptitle('Value Function (Dense vs Sparse)', fontsize=16)
ax.legend()
Out[25]:
In [26]:
fig, ax = plt.subplots(figsize=(20,5))
ax.plot(sparse['score'])
fig.suptitle('Score (Sparse)', fontsize=16)
ax.legend()
Out[26]:
In [27]:
sparse['score'].describe()
Out[27]:
In [28]:
fig, ax = plt.subplots(figsize=(20,5))
ax.plot(dense['score'])
fig.suptitle('Score (Dense)', fontsize=16)
ax.legend()
Out[28]:
In [29]:
dense['score'].describe()
Out[29]:
In [30]:
fig, ax = plt.subplots(figsize=(20,5))
ax.plot(sparse['score'].rolling(10000).mean(), label='sparse')
ax.plot(dense['score'].rolling(10000).mean(), label='dense')
fig.suptitle('Score (Dense vs Sparse)', fontsize=16)
ax.legend()
Out[30]:
In [31]:
fig, ax = plt.subplots(figsize=(20,5))
ax.plot(sparse['losses'])
fig.suptitle('Loss (Sparse)', fontsize=16)
ax.legend()
Out[31]:
In [32]:
sparse['losses'].describe()
Out[32]:
In [33]:
fig, ax = plt.subplots(figsize=(20,5))
ax.plot(dense['losses'])
fig.suptitle('Loss (Dense)', fontsize=16)
ax.legend()
Out[33]:
In [34]:
dense['losses'].describe()
Out[34]:
In [35]:
fig, ax = plt.subplots(figsize=(20,5))
ax.plot(sparse['losses'].rolling(10000).mean(), label='sparse')
ax.plot(dense['losses'].rolling(10000).mean(), label='dense')
fig.suptitle('Loss (Dense vs Sparse)', fontsize=16)
ax.legend()
Out[35]:
In [ ]: