In [10]:
# Plot the weights and biases of our model
from matplotlib import pylab
from matplotlib.font_manager import FontProperties

y = np.linspace(0,1,14)
plt.plot(y,weights0[0,:],label='weights from first layer first neuron')
plt.plot(y,weights0[1,:],label='weights from first layer second neuron')
plt.plot(y,biases0,label='biases from first layer',color='k')
plt.scatter(y,weights0[0,:])
plt.scatter(y,weights0[1,:])
plt.scatter(y,biases0,marker='X',color='k')
pylab.legend(loc=9, bbox_to_anchor=(1.3, 0.9))

plt.figure()
y = np.linspace(0,1,14)
plt.plot(y,weights1[:,0],label='weights from second layer first neuron')
plt.plot(y,weights1[:,1],label='weights from second layer second neuron')
plt.plot(y,weights1[:,2],label='weights from second layer third neuron')
plt.plot(y,weights1[:,3],label='weights from second layer fourth neuron')
plt.plot(y,weights1[:,4],label='weights from second layer fifth neuron')
plt.plot(y,weights1[:,5],label='weights from second layer 6th neuron')
plt.plot(y,weights1[:,6],label='weights from second layer 7th neuron')
plt.plot(y,weights1[:,7])

plt.scatter(y,weights1[:,0])
plt.scatter(y,weights1[:,1])
plt.scatter(y,weights1[:,2])
plt.scatter(y,weights1[:,3])
plt.scatter(y,weights1[:,4])
plt.scatter(y,weights1[:,5])
plt.scatter(y,weights1[:,6])
plt.scatter(y,weights1[:,7],marker='*',label='weights from second layer 8th neuron')
y = np.linspace(0,1,8)
plt.plot(y,biases1,label='biases from second layer',color='k')
plt.scatter(y,biases1,marker='X',color='k')
pylab.legend(loc=9, bbox_to_anchor=(1.3, 0.9))

plt.figure()
y = np.linspace(0,1,8)
plt.plot(y,weights2[:,0],label='weights from third layer neuron')
plt.scatter(y,weights2[:,0])
plt.axhline(y=biases2,xmin=0.05,xmax=0.95,label='bias from third layer',color='k')
pylab.legend(loc=9, bbox_to_anchor=(1.3, 0.9))
Out[10]:
<matplotlib.legend.Legend at 0x24c033035f8>