Home | Develop | Download | Contact
example_flattenlayer_predict.cpp

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

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

Para executar o programa:

./example_flattenlayer_predict

Retornando por consola:

Código example_flattenlayer_predict.cpp:

#include <Pds/Ra>
#include <Pds/Nn>
int main(void)
{
Pds::Matrix M0=Pds::RandN(1,2);
Pds::Matrix M1=Pds::RandN(1,2);
Pds::SampleBlock Sample={M0,M1};
Sample[0].Print("Sample[0]:\n");
Sample[1].Print("Sample[1]:\n");
std::cout<<"\n";
Pds::Vector Out=Layer.Predict(Sample);
Out.T().Print("Out.T():\n");
std::cout<<"\n";
Pds::TensorBlock Tensor=Layer.PredictTensor({Sample});
Tensor[0][0].Print("Tensor[0][0]:\n");
return 0;
}
La clase tipo Pds::FlattenLayer . Esta clase genera un objeto con dos parametros Nlin y Ncol....
Pds::Vector Predict(const std::vector< Pds::Matrix > &In) const
Evalua la capa de la CNN.
Pds::TensorBlock PredictTensor(const Pds::TensorBlock &In) const
Evalua la capa de la CNN.

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed