Commit a7d46f52 authored by robin.requadt's avatar robin.requadt
Browse files

Upload New File

parent f81e5e7c
import numpy as np
import unittest
from proxtoolbox.Algorithms.KM import *
from proxtoolbox.ProxOperators.P_binary import *
from proxtoolbox.ProxOperators.P_RN import *
from proxtoolbox.ProxOperators.P_M import *
# input: config={'proxoperators':[P_binary,P_RN,P_avg],'beta0':2 ,'beta_max':2,'beta_switch':1,'prox_idx':2,'iter':10,'prox_idx':2,'support_idx':np.array([1,2]),'Nx':8,'Ny':0,'Nz':0,'Prox':[P_binary,P_RN], 'norm_data':1, 'product_space_dimension':5,'beta_0':2,'Fx':np.array([1,2,3]),'phi':2}
#u=[1,2,5,6,-5,-6],
class test_KM(unittest.TestCase):
def test_KM(self):
config={'proxoperators':[P_binary,P_RN,P_M],'beta0':2 ,'beta_max':2,'beta_switch':1,'prox_idx':2,'iter':10,'prox_idx':2,'support_idx':np.array([1,2]),'Nx':8,'Ny':0,'Nz':0,'Prox':[P_binary,P_RN], 'norm_data':1, 'product_space_dimension':5,'beta_0':2,'Fx':np.array([1,2,3]),'phi':2, 'T':P_M,'M':np.array([1,2,2,2,2,12])}
self.pro= KM(config)
u = np.array([1,2,5,6,-5,-6])
self.assertEqual(self.pro.evaluate(u).tolist(),np.array([1000,1001,1004,1005,994,993]).tolist())
if __name__ == '__main__':
unittest.main()
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