Skip to content

Commit

Permalink
Merge pull request #4923 from FederatedAI/feature-1.11.2-loss-unittest
Browse files Browse the repository at this point in the history
fix loss unit test
  • Loading branch information
dylan-fan committed Jun 14, 2023
2 parents 1f72e64 + 081779c commit 8767db5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def test_compute_hess(self):
pred = np.asarray([random.random() for j in range(5)], dtype='float64')
label = random.randint(0, 4)
softmaxloss_hess = self.softmax_loss.compute_hess(label, pred)
hess = pred * (1 - pred)
hess = 2 * pred * (1 - pred)
self.assertTrue(np.fabs(hess - softmaxloss_hess).all() < consts.FLOAT_ZERO)

def test_compute_loss(self):
Expand Down

0 comments on commit 8767db5

Please sign in to comment.