Commit 32729085 authored by kvdgoenna's avatar kvdgoenna
Browse files

commit before change of workplace

first demo with sample matrix
parent 5bcfff14
from proxtoolbox.experiments.MatrixCompletion.APCompletion_Experiment import APCompletion_Experiment
import SetProxPythonPath
from proxtoolbox.experiments.matrix_completion.APCompletion_Experiment import APCompletion_Experiment
MC = APCompletion_Experiment(algorithm='AP')
import numpy as np
Ml = np.random.rand(10,4)
Mr = np.random.rand(4,10)
M = Ml @ Mr
obs_mask = np.random.choice(2,(10,10),p=(.3,.7))
obs = M * obs_mask
print(obs,obs_mask)
MC = APCompletion_Experiment(algorithm='AP', obs = obs, obs_mask = obs_mask, rank = 4)
MC.run()
MC.show()
\ No newline at end of file
# pylint: disable=no-member # for dynamically created variables
# pylint: disable=access-member-before-definition # for dynamically created variables
from proxtoolbox.experiments.MatrixCompletion.MatrixCompletionExperiment import MatrixCompletionExperiment
from proxtoolbox.experiments.matrix_completion.MatrixCompletionExperiment import MatrixCompletionExperiment
from proxtoolbox import proxoperators
import numpy as np
......@@ -16,11 +16,28 @@ class APCompletion_Experiment(MatrixCompletionExperiment):
@staticmethod
def getDefaultParameters():
defaultParams = {
'experiment_name' : 'Matrix Completion',
'algorithm' : 'Alternating Projections',
'rank' : 4
'experiment_name' : 'Matrix Completion',
'algorithm' : 'Alternating Projections',
'iterate_monitor_name' : 'CT_IterateMonitor',
'rank' : 4
}
return defaultParams
def setupProxOperators(self):
super().setupProxOperators()
self.proxOperators = ['P_rank','P_diag']
def __init__(self, obs, obs_mask, rank, **kwargs):
super().__init__(**kwargs)
self.obs = obs
self.obs_mask = obs_mask
self.rank = rank
def loadData(self):
self.u0 = self.obs
\ No newline at end of file
......@@ -28,4 +28,5 @@ class MatrixCompletionExperiment(Experiment):
pass
\ No newline at end of file
def loadData(self):
pass
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment