solin319 closed pull request #8961: Fix bug in crossentropy example URL: https://github.com/apache/incubator-mxnet/pull/8961
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/example/recommenders/crossentropy.py b/example/recommenders/crossentropy.py index d8577ed898..5cf4a98ddc 100644 --- a/example/recommenders/crossentropy.py +++ b/example/recommenders/crossentropy.py @@ -55,6 +55,7 @@ def forward(self, is_train, req, in_data, out_data, aux): p = in_data[0] # shape=(b,d) y = in_data[1] out = y * mx.nd.log(p+self.eps) + (1.-y) * mx.nd.log((self.eps1) - p) + out = -out self.assign(out_data[0], req[0], out) else: # Just copy the predictions forward ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services