Skip to content

Commit

Permalink
count #batches instead of #users
Browse files Browse the repository at this point in the history
  • Loading branch information
hieuddo committed Oct 23, 2023
1 parent 7c7ff21 commit ebce517
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cornac/models/ncf/recom_ncf_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def _fit_pt(self):
lr=self.lr,
weight_decay=self.reg,
)
criteria = nn.BCELoss(reduction="sum")
criteria = nn.BCELoss()

loop = trange(self.num_epochs, disable=not self.verbose)
for _ in loop:
Expand All @@ -241,7 +241,7 @@ def _fit_pt(self):
loss.backward()
optimizer.step()

count += len(batch_users)
count += 1
sum_loss += loss.data.item()

if batch_id % 10 == 0:
Expand Down

0 comments on commit ebce517

Please sign in to comment.