Gradient Descent, Machine Learning.
usually we use mean, but to illustrate, sum is used for consistency x = np.array([1.6, 0.2]) y = np.array([1, -1]) w = 0.50 # initialize weight to something holder = [] for w in np.arange(-1,4,0.1): holder.append((w, cross_entropy_loss(x, y, w))) plt.plot(np.array(holder)[:,0],