HDIM  1.0.0
Packages for High Dimensional Linear Regression
perf_ista.hpp
1 #ifndef PERF_ISTA_H
2 #define PERF_ISTA_H
3 
4 // C System-Headers
5 //
6 // C++ System headers
7 #include <cmath>
8 // Eigen Headers
9 #include <eigen3/Eigen/Dense>
10 // Boost Headers
11 //
12 // SPAMS Headers
13 //
14 // Armadillo Headers
15 //
16 // Project Specific Headers
17 #include "../Generic/debug.h"
18 #include "../Generic/generics.h"
19 #include "ista.h"
20 
21 void PerfIsta( uint num_rows, uint num_cols ) {
22 
23  Eigen::Matrix< float, Eigen::Dynamic, Eigen::Dynamic > X = build_matrix<float>( num_rows, num_cols, &eucl_distance );
24  Eigen::Matrix< float, Eigen::Dynamic, 1 > Y = X.col(0);
25  Eigen::Matrix< float, Eigen::Dynamic, 1 > W_0 = Eigen::Matrix< float, Eigen::Dynamic, 1 > ( num_rows, 1 );
26  W_0.setZero();
27 
28  float lambda = 1.0;
29 
30  TIME_IT( ISTA< float >( X, Y, W_0, 1, 0.1f, 0.5*lambda ); );
31 
32 }
33 
34 void RunIstaPerfTests() {
35 
36  for ( uint k = 200; k <= 2000; k += 200 ) {
37 
38  std::cout << "Testing ISTA for a " \
39  << k \
40  << "x" \
41  << k \
42  << "Matrix:" \
43  << std::endl;
44 
45  PerfIsta( k, k );
46  }
47 }
48 
49 #endif // PERF_ISTA_H
#define TIME_IT(func,...)
Get the de-mangled name of a type ( as it would appear in the source code ).
Definition: debug.hpp:59