In [7]:
# in the following graphic we will see how parameters change
plt.plot(J_list,'b', label = 'J')
plt.plot(w1_list,'g', label ='$\omega1$')
plt.plot(w2_list,'r', label = '$\omega2$')
plt.xlabel('number of iteration')
plt.title('Evaluation of parameters')
plt.plot(b_list, label = 'b');
plt.legend()
plt.grid()
plt.show()
In [8]:
w1_diff = np.diff(np.array(w1_list))
w2_diff = np.diff(np.array(w2_list))
b_diff = np.diff(np.array(b_list))
b_diff = np.diff(np.array(b_list))
J_diff = np.diff(np.array(J_list))


plt.figure()
plt.plot(w1_diff, label = 'diff(w1)')
plt.plot(w2_diff, label = 'diff(w2)')
plt.plot(b_diff,label = 'diff(b)')
plt.ylim((-0.0001,0))
plt.xlabel('number of iterations')
plt.title('How much do values of parameters change with respect to number of iterations')
plt.legend()
plt.grid()
plt.show()

plt.figure()
plt.plot(J_diff,label = 'diff(J)')
plt.ylim((-0.0000005,0))
plt.legend()
plt.grid()

plt.show()