Skip to content

Instantly share code, notes, and snippets.

@tamnguyenvan
Created October 25, 2021 08:36
Show Gist options
  • Select an option

  • Save tamnguyenvan/4fe23d840bd091c069918e1f150d50b7 to your computer and use it in GitHub Desktop.

Select an option

Save tamnguyenvan/4fe23d840bd091c069918e1f150d50b7 to your computer and use it in GitHub Desktop.
from pyfaust.fact import palm4msa
from pyfaust.factparams import ParamsPalm4MSA, ConstraintList, StoppingCriterion
import numpy as np
# M = np.random.rand(500, 32)
# M = np.arange(500*32).reshape((500, 32)).astype('float64')
M = np.arange(100).reshape((10, 10)).astype('float64')
print(M)
# cons = ConstraintList('splin', 5, 500, 32, 'normcol', 1.0, 32, 32)
cons = ConstraintList('sp', 20, 10, 10, 'sp', 20, 10, 10)
stop_crit = StoppingCriterion(num_its=200)
param = ParamsPalm4MSA(cons, stop_crit)
F = palm4msa(M, param, backend=2020)
print(F.todense())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment