Mercurial > hg > pycsalgos
comparison scripts/ABSapprox.py @ 10:edb5a287e0bb
Matlab SL0
author | nikcleju |
---|---|
date | Sat, 05 Nov 2011 21:15:02 +0000 |
parents | |
children | ef0629f859a3 |
comparison
equal
deleted
inserted
replaced
9:f31d5484a573 | 10:edb5a287e0bb |
---|---|
1 # -*- coding: utf-8 -*- | |
2 """ | |
3 Created on Sat Nov 05 18:08:40 2011 | |
4 | |
5 @author: Nic | |
6 """ | |
7 | |
8 import numpy | |
9 import pyCSalgos | |
10 | |
11 def gap_paramsetup(y,M,Omega,epsilon,lbd): | |
12 gapparams = dict(num_iteration = 1000, | |
13 greedy_level = 0.9, | |
14 stopping_coefficientstopping_coefficient_size = 1e-4, | |
15 l2solver = 'pseudoinverse', | |
16 noise_level = epsilon) | |
17 return y,M,M.T,Omega,Omega.T,gapparams,numpy.zeros(Omega.shape[1]) | |
18 | |
19 def omp_paramsetup(y,M,Omega,epsilon,lbd): | |
20 gapparams = dict(num_iteration = 1000, | |
21 greedy_level = 0.9, | |
22 stopping_coefficientstopping_coefficient_size = 1e-4, | |
23 l2solver = 'pseudoinverse', | |
24 noise_level = epsilon) | |
25 return y,M,M.T,Omega,Omega.T,gapparams,numpy.zeros(Omega.shape[1]) | |
26 | |
27 gap = (pyCSalgos.GAP, gap_paramsetup) | |
28 | |
29 | |
30 | |
31 gap = (pyCSalgos.GAP, gap_paramsetup) | |
32 | |
33 | |
34 | |
35 | |
36 def mainrun(): | |
37 | |
38 algos = (gap, sl0) | |
39 | |
40 for algofunc,paramsetup in algos: | |
41 xrec = algofunc(algosetup(y, Omega, epsilon, lbd)) |