Programa para el testeo de las funciones Fully Connected Layer.Para compilar o código example_conv2dlayer_predict.cpp:
g++ -static -o example_conv2dlayer_predict example_conv2dlayer_predict.cpp -lpdsramm -lpdsnnmm
Para executar o programa:
./example_conv2dlayer_predict
Retornando por consola:
Código example_conv2dlayer_predict.cpp:
#include <Pds/Ra>
#include <Pds/Nn>
int main(void)
{
Pds::SampleBlock Out;
unsigned int L=5;
Pds::SampleBlock In=Pds::Matrix::ImportBmpFile("../manual/imagenes/pimienta-gray3.bmp");
Pds::Matrix Gabor=Pds::Kernel2D::Gabor(L,6.0,5.5,Pds::Ra::Pi/4,8.0,0.0)/3;
Pds::Octave::Plot::ImageSc(Gabor,"testando.m","gabor5.png");
Pds::Matrix Mean=Pds::Kernel2D::Mean(L)/3;
Pds::TensorBlock W={{Gabor,Gabor,Gabor},{Mean,Mean,Mean}};
for(unsigned int n=0;n<Out.size();n++)
Out[n].ExportBmpFile(Pds::Colormap::Gray,"out"+std::to_string(n)+".bmp");
return 0;
}
La clase tipo Pds::Conv2DLayer . Esta clase genera un objeto con parametros. Para usar incluir <Pds/C...
std::vector< Pds::Matrix > Predict(const std::vector< Pds::Matrix > &Input) const
Evalua la capa de la Conv2D.