Skip to content

Commit

Permalink
Experimenting
Browse files Browse the repository at this point in the history
  • Loading branch information
anotherbugmaster committed Sep 12, 2018
1 parent d40d89f commit 7a3ef47
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gensim/models/nmf_pgd.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ def solve_r(double[:, ::1] r, double[:, ::1] r_actual, double lambda_, double v_
with nogil:
for sample_idx in range(n_samples):
for feature_idx in range(n_features):
if r[feature_idx, sample_idx] == 0:
continue

r_new_element = fabs(r_actual[feature_idx, sample_idx]) - lambda_
r_new_element = fmax(r_new_element, 0)
r_new_element = copysign(r_new_element, r_actual[feature_idx, sample_idx])
Expand Down

0 comments on commit 7a3ef47

Please sign in to comment.