

def update(self, x, y):
    self.phase = 'train'
    y_pred = self.fprop(x)
    grad = self.loss.grad(y_pred, y)
    for layer in reversed(self.layers[self.bprop_until:]):
        grad = layer.bprop(grad)
    return self.loss.loss(y_pred, y)

dataset/ETHPy150Open andersbll/deeppy/deeppy/feedforward/neural_network.py NeuralNetwork.update/original