jxgu1016/MNIST_center_loss_pytorch

About the equation(4)

Closed this issue · 1 comments

Excuse me, I note that the gradients of Lc with respect to Ci computed by equation(2) is nearly the same as equation(4). So, could we update Ci by automatic differential system as follows:

Class centerloss():
return Lc/batch_size %equation(2)

L=L1+Lc
L.backward()

The grads of centers don't follow the chain rules, so automatic differential system would not be correct.