Skip to content

Commit

Permalink
Fix loss unit test
Browse files Browse the repository at this point in the history
Signed-off-by: cwj <[email protected]>
  • Loading branch information
talkingwallace committed Jun 14, 2023
1 parent 1f72e64 commit 081779c
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 081779c

Please sign in to comment.