%matplotlib nbagg from sklearn.metrics import accuracy_score import matplotlib.pyplot as plt import matplotlib.animation as animation fig = plt.figure() imgs = [] y_true = np.array(nn.y).astype(float) # back-propagation def backpropagation(n, X, y): for i in range(n.n_epoch): # forward to calculate each node's output forward(n, X) # print loss, accuracy L = np.sum((n.z2 - y)**2) y_pred = np.zeros(nn.z2.shape[0]) y_pred[np.where(nn.z2[:,0]