Home | Develop | Download | Contact
example_fcnn_training_load.cpp
1 
26 #include <Pds/Ra>
27 #include <Pds/Nn>
28 
29 int main(void)
30 {
31  unsigned int M=2000;
32  std::string str;
33 
34  Pds::Matrix X(Pds::Ra::TextFormat,"../test/data_x_yinyang.txt");
35  Pds::Matrix Y(Pds::Ra::TextFormat,"../test/data_y_yinyang.txt");
36  Pds::Matrix Ys(Y.Size());
37 
38  Pds::Nn::DefaultActFunc=Pds::Sigmoid;
39  Pds::Nn::DefaultDActFunc=Pds::DSigmoid;
40  Pds::FCNn NN0("../test/NeuralNetwork0.txt");
41 
42  Y=2*Y-1.0;
43 
44  for(unsigned int k=0;k<M;k++)
45  {
46  NN0.Training(X,Y,0.1,0.01);
47 
48  NN0.Predict(X,Ys);
49 
50  str="acc: "+std::to_string(100.0*Pds::Accuracy(Ys,Y,0.1));
51  Pds::Ra::ProgressBarWithTime(32,k,M,false,str);
52  }
53  std::cout<<std::endl;
54 
55  Pds::Octave::XLabel="x_1";
56  Pds::Octave::YLabel="x_2";
57  Pds::Octave::Plot::PointsX2DY(X,Y ,"testando.m","dataset_data_Y.png");
58  Pds::Octave::Plot::PointsX2DY(X,Ys,"testando.m","dataset_data_Ys.png");
59 
60  NN0.Save("../test/NeuralNetwork0.txt");
61  return 0;
62 }
La clase tipo Pds::FCNn . Esta clase genera un objeto con dos parametros Nlin y Ncol....
Definition: FCNn.hpp:62
double(* DefaultDActFunc)(double)
double(* DefaultActFunc)(double)

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed