Home | Develop | Download | Contact
example_fcnn_predict2.cpp

Programa para el testeo de las funciones Fully Connected Layer.Para compilar o código example_fcnn_predict2.cpp:

g++ -static -o example_fcnn_predict2 example_fcnn_predict2.cpp -lpdsramm -lpdsnnmm

Para executar o programa:

./example_fcnn_predict2

Retornando por consola:

X:
6.8037543430942  -2.1123414636181 
5.6619844751721  5.9688006695215  
8.2329471587357  -6.0489726141323 
-3.2955448857022 5.3645918962381  
-4.4445057839362 1.0793991159086  
-0.4520589627568 2.5774184952385  
-2.7043105441631 0.26801820391231 
9.0445945034943  8.323901360074   
2.714234559198   4.3459385886537  
-7.1679488928839 2.1393775251412  
Y:
0.97133174661294  
0.96700844603044  
0.9665458442164   
0.93021066095175  
-0.86053228823098 
0.92033251758093  
-0.87290440669112 
0.96558349386691  
0.97226774322066  
-0.81355774687219

Código example_fcnn_predict2.cpp:

#include <Pds/Ra>
#include <Pds/Nn>
int main(void)
{
unsigned int L=10;
Pds::Matrix X(L,2);
Pds::Matrix Y(L,1);
X.FillRandU(-10,+10); X.Print("X:\n");
std::vector<unsigned int> N={2,16,4,1};
Pds::FCNn NN0=Pds::FCNn(N,Pds::Tanh,Pds::DTanh);
NN0.Predict(X,Y);
Y.Print("Y:\n");
return 0;
}
La clase tipo Pds::FCNn . Esta clase genera un objeto con dos parametros Nlin y Ncol....
Definition: FCNn.hpp:62
const std::string FCNn
Tag de un objeto de tipo Pds::FCNn.
Definition: NnDefines.hpp:165
Pds::SampleBlock Predict(const Pds::SampleBlock &In) const
Evalua la capa de la CNN.

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed