From 6f27f4ff073d7fe317b4dc34e7f783a857f33c04 Mon Sep 17 00:00:00 2001 From: David Warren Katz <59783036+DavidWarrenKatz@users.noreply.github.com> Date: Fri, 24 Feb 2023 16:35:35 -0500 Subject: [PATCH] Update demo.py Previous code never selected which algorithm to use. --- demo.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/demo.py b/demo.py index 400d0cd..703de98 100644 --- a/demo.py +++ b/demo.py @@ -75,17 +75,18 @@ # convert numpy array to matlab.double V_m = matlab.double(V.tolist()) -# convert dictioary to matlab.struct -options_m = eng.struct(options); - # perform solvers in MATLAB # Fro-MU +options['alg'] = 'mu' # select which algorithm to use +options_m = eng.struct(options); # convert dictioary to matlab.struct [w_mu, infos_mu] = eng.fro_mu_nmf(V_m, rank, options_m, nargout=2) # HALS +options['alg'] = 'hals' # select which algorithm to use +options_m = eng.struct(options); # convert dictioary to matlab.struct [w_hals, infos_hals] = eng.als_nmf(V_m, rank, options_m, nargout=2) # ACC-HALS -options['alg'] = 'acc_hals' -options_m = eng.struct(options); +options['alg'] = 'acc_hals' # select which algorithm to use +options_m = eng.struct(options); # convert dictioary to matlab.struct [w_acc_hals, infos_acc_hals] = eng.als_nmf(V_m, rank, options_m, nargout=2) # convert matlab.struct to list @@ -120,4 +121,4 @@ plt.show() -eng.quit() \ No newline at end of file +eng.quit()