From 7c7ff2141dee17f56227b19cc4548ef1e2c8efb3 Mon Sep 17 00:00:00 2001 From: hieuddo Date: Mon, 23 Oct 2023 13:53:06 +0000 Subject: [PATCH] fix BCELoss, reduction='sum' --- cornac/models/ncf/recom_ncf_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cornac/models/ncf/recom_ncf_base.py b/cornac/models/ncf/recom_ncf_base.py index 2541a4272..bec80e4a0 100644 --- a/cornac/models/ncf/recom_ncf_base.py +++ b/cornac/models/ncf/recom_ncf_base.py @@ -218,7 +218,7 @@ def _fit_pt(self): lr=self.lr, weight_decay=self.reg, ) - criteria = nn.BCELoss() + criteria = nn.BCELoss(reduction="sum") loop = trange(self.num_epochs, disable=not self.verbose) for _ in loop: