Skip to content

Commit

Permalink
Add reference to topic model in CTR (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
tqtg authored Jun 6, 2020
1 parent a828e1b commit 3f7c6f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cornac/models/ctr/recom_ctr.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def _fit_ctr(self,):
)
doc_ids, doc_cnt = self._build_data(bow_mat) # bag of word feature

model = Model(
self.model = Model(
n_user=self.n_user,
n_item=self.n_item,
U=self.U,
Expand All @@ -177,11 +177,11 @@ def _fit_ctr(self,):

loop = trange(self.max_iter, disable=not self.verbose)
for _ in loop:
cf_loss = model.update_cf(
cf_loss = self.model.update_cf(
user_data=user_data, item_data=item_data
) # u and v updating
lda_loss = model.update_theta(doc_ids=doc_ids, doc_cnt=doc_cnt)
model.update_beta()
lda_loss = self.model.update_theta(doc_ids=doc_ids, doc_cnt=doc_cnt)
self.model.update_beta()
loop.set_postfix(cf_loss=cf_loss, lda_likelihood=-lda_loss)

if self.verbose:
Expand Down

0 comments on commit 3f7c6f6

Please sign in to comment.