10 using namespace shark;
16 UniformPoints(std::size_t dimensions){
17 m_dimensions = dimensions;
20 void draw(RealVector& input)
const{
21 input.resize(m_dimensions);
22 for ( std::size_t j=0; j<m_dimensions; j++ ) {
28 std::size_t m_dimensions;
33 std::cout <<
"\n ----- Starting MklKernel normalization demo ---- \n\n" << std::flush;
35 std::size_t num_dims = 9;
36 std::size_t num_points = 200;
37 UniformPoints problem(num_dims);
44 std::vector< AbstractKernelFunction<RealVector> * > kernels;
45 kernels.push_back(&basekernel1);
46 kernels.push_back(&basekernel2);
47 kernels.push_back(&basekernel3);
49 std::vector< std::pair< std::size_t, std::size_t > > frs;
50 frs.push_back( std::make_pair( 0,3 ) );
51 frs.push_back( std::make_pair( 3,6 ) );
52 frs.push_back( std::make_pair( 6,9 ) );
58 normalizer.
train( scale, data );
59 std::cout <<
" Done training. Factor is " << scale.
factor() << std::endl;
60 std::cout <<
" Mean = " << normalizer.
mean() << std::endl;
61 std::cout <<
" Trace = " << normalizer.
trace() << std::endl << std::endl;
64 for ( std::size_t i=0; i<num_points; i++ ) {
66 for ( std::size_t j=0; j<num_points; j++ ) {
70 control /= num_points;
71 std::cout <<
" Variance of scaled MklKernel: " << control << std::endl;