Skip to content

Commit

Permalink
modify call to main
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaoxiao Wu committed May 7, 2019
1 parent 99cc86d commit eee2244
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions ALS/als_sp.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,15 +310,15 @@ def getALS_CG(T,U,V,W,regParam,omega,I,J,K,r,block_size,num_iter=100,err_thresh=

it += 1

if abs(curr_err_norm - next_err_norm) < err_thresh or it > num_iter:
if abs(curr_err_norm - next_err_norm) < err_thresh or it >= num_iter:
break

curr_err_norm = next_err_norm

t_ALS_CG.end()

if glob_comm.rank() == 0:
print('Time/Iteration: {}'.format((time.time() - t_before_loop)/1))
print('Time: {}'.format((time.time() - t_before_loop)/1))
print("Number of iterations: %d" % (it))


Expand Down Expand Up @@ -348,9 +348,9 @@ def main():
r = 2
sparsity = .000001
regParam = .1
block_size = 100
block_size = 1000
use_func = 0
num_iter = 20
num_iter = 1
err_thresh = .001
run_implicit = 1
run_explicit = 1
Expand Down Expand Up @@ -416,5 +416,7 @@ def main():



main()
#main()
if __name__ == '__main__':
main()

2 changes: 1 addition & 1 deletion SGD/gradient1.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,4 @@ def main():
#T.write_to_file("T.txt")
sparse_SGD(T, U, V, W, regParam, Omega, I, J, K, r, stepSize, sample_rate)

main()
#main()

0 comments on commit eee2244

Please sign in to comment.