Skip to content

Commit 8767db5

Browse files
authored
Merge pull request #4923 from FederatedAI/feature-1.11.2-loss-unittest
fix loss unit test
2 parents 1f72e64 + 081779c commit 8767db5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/federatedml/ensemble/basic_algorithms/decision_tree/tree_core/loss/test/cross_entropy_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def test_compute_hess(self):
9696
pred = np.asarray([random.random() for j in range(5)], dtype='float64')
9797
label = random.randint(0, 4)
9898
softmaxloss_hess = self.softmax_loss.compute_hess(label, pred)
99-
hess = pred * (1 - pred)
99+
hess = 2 * pred * (1 - pred)
100100
self.assertTrue(np.fabs(hess - softmaxloss_hess).all() < consts.FLOAT_ZERO)
101101

102102
def test_compute_loss(self):

0 commit comments

Comments
 (0)