GPLIB++
SigmoidalNeuron.cpp
Go to the documentation of this file.
1 #include "SigmoidalNeuron.h"
4 
5 namespace gplib
6  {
8  Output(0.0), Delta(0.0), Net(0.0), cachedoutput(wantcached)
9  {
10  SetType(type);
11  }
12 
14  {
15  }
16 
17  double SigmoidalNeuron::CalcOutput()
18  {
19  Net = Combiner->CalcOutput();
20  Output = Function->CalcOutput(Net);
21  return Output;
22  }
23 
26  {
27  Combiner->SetInput(input);
28  }
29 
31  {
32  switch (type)
33  {
34  case bipolar:
35  Function = boost::shared_ptr<GeneralActivationFunction>(
37  break;
38  case identity:
39  Function = boost::shared_ptr<GeneralActivationFunction>(
41  break;
42  }
43  Combiner = boost::shared_ptr<GeneralLinearCombiner>(
44  new GeneralLinearCombiner(cachedoutput));
45  }
46  }
This activation function simply outputs its input.
virtual void SetInput(const GeneralLinearCombiner::tinvector &input)
Set the input neurons.
virtual void SetType(tneurontype type)
Set the type of neuron, determines the activation function.
SigmoidalNeuron(tneurontype type, bool wantcached=false)
Construct neuron with a known type.
The bipolar activation function is a common function in NN applications.
A linear combiner as a component of a neural network.
std::vector< boost::shared_ptr< GeneralNeuron > > tinvector
tneurontype
At the moment there are two types of neurons: bipolar and identity, they differ in their activation f...