In [1]:
%run loss_per_iter.py


******************************
abs_adam
Step: 248
Best Cost: 0.00472885058594
******************************
update_rule
Step: 1000
Best Cost: 0.00492536035156
******************************
clip_adam
Step: 1000
Best Cost: nan
******************************
clip_sgd
Step: 1000
Best Cost: nan
******************************
abs_sgd
Step: 1000
Best Cost: nan

In [5]:
H.repl


Out[5]:
'a.fill(value)\n\n    Fill the array with a scalar value.\n\n    Parameters\n    ----------\n    value : scalar\n        All elements of `a` will be assigned this value.\n\n    Examples\n    --------\n    >>> a = np.array([1, 2])\n    >>> a.fill(0)\n    >>> a\n    array([0, 0])\n    >>> a = np.empty(2)\n    >>> a.fill(1)\n    >>> a\n    array([ 1.,  1.])'

In [2]:
%matplotlib inline
import matplotlib.pyplot as plt

In [3]:
labels = {"abs_adam": "Adam(abs)", "abs_sgd": "GD(abs)", "clip_adam": "Adam(PG)",
         "clip_sgd": "GD(PG)", "update_rule": "Mult"}

In [4]:
def plot_costs(name):
    plt.plot(range(len(costs[name])), costs[name], label=labels[name])

In [5]:
def plot_nmis(name):
    plt.plot(range(len(nmis[name])), nmis[name], label=labels[name])

In [9]:
names = ["clip_sgd", "abs_sgd", "clip_adam", "abs_adam", "update_rule"]

In [7]:
names = ["abs_adam", "update_rule"]

In [10]:
for name in names:
    plot_nmis(name)
#plt.ylim(0.0015, 0.034)
#plt.xlim(0, 50)
plt.legend()


Out[10]:
<matplotlib.legend.Legend at 0x118fa52b0>

In [15]:
for name in models:
    plot_costs(name)
#plt.ylim(0.0015, 0.0024)
#plt.xlim(0, 30)
plt.legend()


Out[15]:
<matplotlib.legend.Legend at 0x120279f28>

In [12]:
for name in names:
    plot_costs(name)
plt.ylim(0.0015, 0.0024)
plt.xlim(0, 30)
plt.legend()


Out[12]:
<matplotlib.legend.Legend at 0x12ef38e80>

In [8]:
for name in names:
    plot_costs(name)
#plt.ylim(0.0015, 0.0024)
#plt.xlim(0, 30)
plt.legend()


Out[8]:
<matplotlib.legend.Legend at 0x11daf09e8>

In [11]:



---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-11-490f60352181> in <module>()
----> 1 times

NameError: name 'times' is not defined

In [ ]: