Skip to content

Commit

Permalink
small efficiency improvement for SVI
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cortes committed Aug 5, 2018
1 parent 0607951 commit cf5e820
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hpfrec/cython_loops.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,8 @@ def fit_hpf(float a, float a_prime, float b_prime,

Beta[:,:] = Lambda_shp / Lambda_rte

k_rte = step_size_batch * (add_k_rte + Theta.sum(axis=1, keepdims=True)) + step_prev * k_rte
t_rte = step_size_batch * (add_t_rte + Beta.sum(axis=1, keepdims=True)) + step_prev * t_rte
k_rte[users_this_batch] = step_size_batch * (add_k_rte + Theta[users_this_batch].sum(axis=1, keepdims=True)) + step_prev * k_rte[users_this_batch]
t_rte[items_this_batch] = step_size_batch * (add_t_rte + Beta[items_this_batch].sum(axis=1, keepdims=True)) + step_prev * t_rte[items_this_batch]


## assessing convergence
Expand Down

0 comments on commit cf5e820

Please sign in to comment.