Programa para el testeo de las funciones Fully Connected Layer.Para compilar o código example_conv2dlayer_predict2.cpp:
g++ -static -o example_conv2dlayer_predict2 example_conv2dlayer_predict2.cpp -lpdsramm -lpdsnnmm
Para executar o programa:
./example_conv2dlayer_predict2
Retornando por consola:
Código example_conv2dlayer_predict2.cpp:
#include <Pds/Ra>
#include <Pds/Nn>
int main(void)
{
Pds::SampleBlock Out;
unsigned int L=5;
Pds::SampleBlock In={Pds::RandN(5,5),Pds::RandN(5,5),Pds::RandN(5,5)};
In[0].Print("In[0]:\n");
In[1].Print("In[1]:\n");
In[2].Print("In[2]:\n");
std::cout<<"\n";
Pds::Matrix Mean=Pds::Kernel2D::Mean(L)/3;
Pds::TensorBlock W={{Mean,Mean,Mean}};
Out[0].Print("Out[0]:\n");
Pds::TensorBlock Block=Conv.PredictTensor({In});
Block[0][0].Print("Block[0][0]:\n");
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.