Home | Develop | Download | Contact
example_fclayer_create.cpp

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

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

Para executar o programa:

./example_fclayer_create

Retornando por consola:

L0:
     Nin: 2
    Nout: 3
 FuncAct: 0x7fcc4cc0be40
DFuncAct: 0x7fcc4cc0c480
       W: 
0.53763086114909        0.36954202465847        0.56382463392773
-0.87250749271152       -0.22063468437125       -1.3938059648353
-0.7925277058445        2.1272209970701 -1.045855489402

L1:
     Nin: 2
    Nout: 3
 FuncAct: 0x7fcc4cc0c3e0
DFuncAct: 0x7fcc4cc0c420
       W: 
0.86048864346136        0.74207001785205        1.1751184865889
0.56014623106965        0.32903772889095        0.70173766075107
-1.905261897823 -0.63665096203108       -0.79135165245963
W:
0.49358298699073  0.97277502388357  0.29251678441303  0.77135769779391  0.52674497921334  
0.76991383627519  0.40022862209018  0.89152945200518  0.28331474600514  0.35245834726489  
0.80772452000888  0.91902647396504  0.069755276231913 0.94932707536469  0.5259953502221   

L2:
     Nin: 4
    Nout: 3
 FuncAct: 0x7fcc4cc0be40
DFuncAct: 0x7fcc4cc0c480
       W: 
0.49358298699073        0.97277502388357        0.29251678441303        0.77135769779391        0.52674497921334
0.76991383627519        0.40022862209018        0.89152945200518        0.28331474600514        0.35245834726489
0.80772452000888        0.91902647396504        0.069755276231913       0.94932707536469        0.5259953502221

L3:
     Nin: 4
    Nout: 3
 FuncAct: 0x7fcc4cc0c3e0
DFuncAct: 0x7fcc4cc0c420
       W: 
0.49358298699073        0.97277502388357        0.29251678441303        0.77135769779391        0.52674497921334
0.76991383627519        0.40022862209018        0.89152945200518        0.28331474600514        0.35245834726489
0.80772452000888        0.91902647396504        0.069755276231913       0.94932707536469        0.5259953502221

L5:
     Nin: 0
    Nout: 0
 FuncAct: 0
DFuncAct: 0
       W: 

Código example_fclayer_create.cpp:

#include <Pds/Ra>
#include <Pds/Nn>
int main(void)
{
// Layer with {2 inputs, 3 outputs, sigmoid, random weights}
L0.PrintStylized("\nL0:\n");
// Layer with {2 inputs, 3 outputs, tanh, random weights}
Pds::FCLayer L1=Pds::FCLayer(2,3,Pds::Tanh,Pds::DTanh);
L1.PrintStylized("\nL1:\n");
Pds::Matrix W(3,5);
W.FillRandU(0,1); W.Print("W:\n");
// Layer with {4 inputs, 3 outputs, sigmoid, W}
L2.PrintStylized("\nL2:\n");
// Layer with {4 inputs, 3 outputs, tanh, W}
Pds::FCLayer L3=Pds::FCLayer(W,Pds::Tanh,Pds::DTanh);
L3.PrintStylized("\nL3:\n");
// Unusable empty layer
L5.PrintStylized("\nL5:\n");
return 0;
}
La clase tipo Pds::FCLayer . Esta clase genera un objeto con dos parametros Nlin y Ncol....
Definition: FCLayer.hpp:61
const std::string FCLayer
Tag de un objeto de tipo Pds::FCLayer.
Definition: NnDefines.hpp:149
void PrintStylized(std::string str="") const
Muestra en pantalla el contenido de Pds::FCLayer, en el formato (Nli,Ncol).

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed