Home | Develop | Download | Contact
example_fcnn_training_load.cpp

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

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

Para executar o programa:

./example_fcnn_training_load

Retornando por consola:

Test[0] Accuracy %: 98.15       MeanAbsError %: 4.14644
Test[1] Accuracy %: 98.15       MeanAbsError %: 4.14643
Test[2] Accuracy %: 98.15       MeanAbsError %: 4.14642
Test[3] Accuracy %: 98.15       MeanAbsError %: 4.14641
Test[4] Accuracy %: 98.15       MeanAbsError %: 4.1464
Test[5] Accuracy %: 98.15       MeanAbsError %: 4.14639
Test[6] Accuracy %: 98.15       MeanAbsError %: 4.14639
Test[7] Accuracy %: 98.15       MeanAbsError %: 4.14638
Test[8] Accuracy %: 98.15       MeanAbsError %: 4.14637
Test[9] Accuracy %: 98.15       MeanAbsError %: 4.14636

Datos de treinamento.

Datos despues del treinamento. Código example_fcnn_training_load.cpp:

#include <Pds/Ra>
#include <Pds/Nn>
int main(void)
{
Pds::Matrix X(Pds::Ra::TextFormat,"../test/data_x_yinyang.txt");
Pds::Matrix Y(Pds::Ra::TextFormat,"../test/data_y_yinyang.txt");
Pds::Matrix Ys(Y.Size());
Pds::FCNn NN0("../test/NeuralNettwork0.txt",Pds::Sigmoid,Pds::DSigmoid);
for(unsigned int k=0;k<10;k++)
{
NN0.Training(X,Y,0.1,0.01);
NN0.Evaluate(X,Ys);
std::cout<<"Test["<<k<<"]\t";
std::cout<<"Accuracy %: " <<100.0*Pds::Accuracy(Ys.Geq(0.5),Y)<<"\t";
std::cout<<"MeanAbsError %: "<<100.0*Pds::MeanAbsoluteError(Ys,Y)<<std::endl;
}
NN0.Save("../test/NeuralNettwork0.txt");
return 0;
}
La clase tipo Pds::FCNn . Esta clase genera un objeto con dos parametros Nlin y Ncol....
Definition: FCNn.hpp:61
bool Training(const Pds::Matrix &X, const Pds::Matrix &Y, double alpha, double lambda)
Treina la NN como um bloque de datos entero X para encontrar una variacion de pesos.
Pds::Vector Evaluate(const Pds::Vector &In)
Evalua la capa de la CNN.
bool Save(std::string filename)
Salva los datos en un archivo binario.

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed