https://github.com/oreilly-japan/deep-learning-from-scratch/blob/master/ch04/two_layer_net.py
loss_W = lambda W: self.loss(x, t)
grads = {}
numerical_gradient(loss_W, self.params['W1'])
However, it seems that the second argument of numerical_gradient
is passed by reference.
Recommended Posts