Skip to content

Commit 3f7c6f6

Browse files
authored
Add reference to topic model in CTR (#341)
1 parent a828e1b commit 3f7c6f6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cornac/models/ctr/recom_ctr.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def _fit_ctr(self,):
160160
)
161161
doc_ids, doc_cnt = self._build_data(bow_mat) # bag of word feature
162162

163-
model = Model(
163+
self.model = Model(
164164
n_user=self.n_user,
165165
n_item=self.n_item,
166166
U=self.U,
@@ -177,11 +177,11 @@ def _fit_ctr(self,):
177177

178178
loop = trange(self.max_iter, disable=not self.verbose)
179179
for _ in loop:
180-
cf_loss = model.update_cf(
180+
cf_loss = self.model.update_cf(
181181
user_data=user_data, item_data=item_data
182182
) # u and v updating
183-
lda_loss = model.update_theta(doc_ids=doc_ids, doc_cnt=doc_cnt)
184-
model.update_beta()
183+
lda_loss = self.model.update_theta(doc_ids=doc_ids, doc_cnt=doc_cnt)
184+
self.model.update_beta()
185185
loop.set_postfix(cf_loss=cf_loss, lda_likelihood=-lda_loss)
186186

187187
if self.verbose:

0 commit comments

Comments
 (0)