Closed jeou closed 3 years ago
Welcome to Apache MXNet (incubating)! We are on a mission to democratize AI, and we are glad that you are contributing to it by opening this issue. Please make sure to include all the relevant context, and one of the @apache/mxnet-committers will be here shortly. If you are interested in contributing to our project, let us know! Also, be sure to check out our guide on contributing to MXNet and our development guides wiki.
Description
with two same models, i copy the hybrid_forward function from gluoncv.loss(softmaxcrossentropy loss in gluoncv). note that i already take away the dropout layer of models for comparison. this function yeilds the loss_11 value which is equal to loss_12(softmaxcrossentropy loss from gluoncv). but after autograd.backward, grad1(from the copied function) isn't equal to grad2(from gluoncv.loss.softmaxcrossentropy). why the forward leads to the same loss value yet the gradients are different between loss from gluoncv and copied function? the debug shotcut picture is below. softmaxcrossentropy loss from gluoncv is below.
Occurrences
values in grad2/grad1 are usually close to 1.09....
stuck by this, please help me if you know anything that may cause this.