Skip to content

Commit f094b95

Browse files
committed
bug-fix in pyculda
1 parent df15494 commit f094b95

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

cusim/culda/pyculda.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def init_model(self):
7474

7575
# zero initialize grad alpha and new beta
7676
block_cnt = self.obj.get_block_cnt()
77-
self.grad_alpha = np.zeros(shape=(block_cnt, self.num_topics),
77+
self.grad_alpha = np.zeros(shape=(block_cnt, self.opt.num_topics),
7878
dtype=np.float32)
7979
self.new_beta = np.zeros(shape=self.beta.shape, dtype=np.float32)
8080

@@ -111,7 +111,7 @@ def _train_e_step(self, h5f):
111111

112112
# call cuda kernel
113113
train_loss, vali_loss = \
114-
self.obj.FeedData(cols, indptr, vali, self.opt.num_iters_in_e_step)
114+
self.obj.feed_data(cols, indptr, vali, self.opt.num_iters_in_e_step)
115115

116116
# accumulate loss
117117
train_loss_nume -= train_loss

examples/example1.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ def run_io():
4040

4141
def run_lda():
4242
opt = {
43+
"data_path": DATA_PATH,
4344
"data_dir": DATA_PATH2,
4445
}
4546
lda = CuLDA(opt)
46-
lda.init_model()
47+
lda.train_model()
4748

4849

4950
if __name__ == "__main__":

0 commit comments

Comments
 (0)