From 8995e13a6ec2a2c6522393e2fcc01241292c672b Mon Sep 17 00:00:00 2001 From: "julian.treiber" Date: Sun, 2 Feb 2020 12:55:28 +0100 Subject: [PATCH] possible bug in SoftmaxCELossIgnoreIndices loss --- src/main/resources/templates/gluon/CNNSupervisedTrainer.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/templates/gluon/CNNSupervisedTrainer.ftl b/src/main/resources/templates/gluon/CNNSupervisedTrainer.ftl index 3495155..bf67e88 100644 --- a/src/main/resources/templates/gluon/CNNSupervisedTrainer.ftl +++ b/src/main/resources/templates/gluon/CNNSupervisedTrainer.ftl @@ -51,7 +51,7 @@ class SoftmaxCrossEntropyLossIgnoreIndices(gluon.loss.Loss): if self._sparse_label: loss = -pick(pred, label, axis=self._axis, keepdims=True) else: - label = _reshape_like(F, label, pred) + label = gluon.loss._reshape_like(F, label, pred) loss = -(pred * label).sum(axis=self._axis, keepdims=True) # ignore some indices for loss, e.g. tokens in NLP applications for i in self._ignore_indices: -- GitLab