4 #include <shark/Models/FFNet.h> 15 using namespace shark;
32 void draw(RealVector& input, RealVector& label)
const 48 size_t hiddenNeurons = 17;
49 size_t numSamples = 1000;
50 unsigned int randomSeed = 42;
69 FFNet<LogisticNeuron,LinearNeuron> elmNetwork;
70 elmNetwork.setStructure(inputDim,hiddenNeurons,
labelDimension(data));
77 transformedData.
inputs() = elmNetwork.evalLayer(0,transformedData.
inputs());
80 trainer.
train(elmOutput,transformedData);
83 elmNetwork.setLayer(1,elmOutput.
matrix(),elmOutput.
offset());
90 double outputResult = loss(transformedData.
labels(),elmOutput(transformedData.
inputs()));
91 double elmResult = loss(transformedData.
labels(),elm(data.
inputs()));
93 cout<<
"Results"<<std::endl;
94 cout<<
"============"<<std::endl;
95 cout<<
"output Layer: "<< outputResult<<std::endl;
96 cout<<
"ELM: "<< elmResult<<std::endl;