Skip to content
Snippets Groups Projects
Commit 024019c5 authored by vkarve2's avatar vkarve2
Browse files

Replace cSNMF.py

parent 01f6d224
No related branches found
No related tags found
No related merge requests found
......@@ -70,7 +70,7 @@ def impose_L1_constraint(W, H):
return W2, H2
def factorize(data_array, rank, beta = 0.0001, eta = None, threshold = 0.20, seed_W = None, seed_H = None, log=logger):
def factorize(data_array, rank, beta = np.nanmean(data_array), threshold = 0.20, max_iter = 400, seed_W = None, seed_H = None, log=logger):
log.info('Rank= %s, Threshold= %s', rank, threshold)
......@@ -121,7 +121,7 @@ def factorize(data_array, rank, beta = 0.0001, eta = None, threshold = 0.20, see
norm_D = np.linalg.norm(D)
while abs(diff_W) + abs(diff_H) > threshold or iterations < 200:
if iterations > 400:
if iterations > max_iter:
break
W_new = update_W(D, W, H)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment