GPLIB++
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
Neural_Network
InputNeuron.h
Go to the documentation of this file.
1
#ifndef INPUTNEURON_H_
2
#define INPUTNEURON_H_
3
#include "
GeneralNeuron.h
"
4
#include "
FatalException.h
"
5
6
namespace
gplib
7
{
8
/** \addtogroup neuralnet Neural Network filtering */
9
/* @{ */
10
11
//! The iput neuron class provides the bridge between the network input and the other neurons,
12
//! a lot of base class functionality does not make sense here and throws an exception, should think of a better way
13
class
InputNeuron
:
public
GeneralNeuron
14
{
15
private
:
16
//! A reference to a double that is used as input for the neural network
17
double
&In;
18
//! There are no weights or bias, so we just return the input value as output
19
virtual
double
CalcOutput()
20
{
21
return
In;
22
}
23
public
:
24
virtual
const
std::vector<double> &
GetOldDelta
()
25
{
26
throw
FatalException
(
"Not implemented"
);
27
}
28
virtual
std::vector<double> &
SetOldDelta
()
29
{
30
throw
FatalException
(
"Not implemented"
);
31
}
32
virtual
double
CalcDeriv
(
const
double
input)
33
{
34
return
1.0;
35
}
36
virtual
double
GetNet
()
37
{
38
return
In;
39
}
40
virtual
double
GetDelta
()
41
{
42
return
0.0;
43
}
44
virtual
void
SetDelta
(
const
double
d)
45
{
46
}
47
virtual
void
SetBias
(
const
double
b)
48
{
49
}
50
virtual
double
GetBias
()
51
{
52
return
0.0;
53
}
54
virtual
const
std::vector<double> &
GetWeights
()
55
{
56
throw
FatalException
(
"Not implemented"
);
57
}
58
virtual
std::vector<double> &
SetWeights
()
59
{
60
throw
FatalException
(
"Not implemented"
);
61
}
62
virtual
const
GeneralLinearCombiner::tinvector
&
GetInput
()
63
{
64
throw
FatalException
(
"Not implemented"
);
65
}
66
InputNeuron
(
double
&Infield) :
67
In(Infield)
68
{
69
}
70
virtual
~InputNeuron
()
71
{
72
}
73
};
74
/* @} */
75
}
76
#endif
/*INPUTNEURON_H_*/
FatalException.h
gplib::InputNeuron::GetWeights
virtual const std::vector< double > & GetWeights()
Access function for the weights.
Definition:
InputNeuron.h:54
gplib::InputNeuron::GetNet
virtual double GetNet()
Get the net output before application of the activation function.
Definition:
InputNeuron.h:36
gplib::InputNeuron::SetDelta
virtual void SetDelta(const double d)
Set delta.
Definition:
InputNeuron.h:44
gplib::InputNeuron::SetWeights
virtual std::vector< double > & SetWeights()
Definition:
InputNeuron.h:58
gplib::InputNeuron::GetInput
virtual const GeneralLinearCombiner::tinvector & GetInput()
Get the pointers to the input neurons.
Definition:
InputNeuron.h:62
gplib::GeneralNeuron
The base class for all neurons in a neural network.
Definition:
GeneralNeuron.h:14
gplib::InputNeuron::InputNeuron
InputNeuron(double &Infield)
Definition:
InputNeuron.h:66
gplib::InputNeuron::GetOldDelta
virtual const std::vector< double > & GetOldDelta()
Vector valued delta for the momentum adaptation scheme.
Definition:
InputNeuron.h:24
gplib::InputNeuron::CalcDeriv
virtual double CalcDeriv(const double input)
Calculate the derivative of the activation function, at point input.
Definition:
InputNeuron.h:32
gplib::InputNeuron::SetOldDelta
virtual std::vector< double > & SetOldDelta()
Definition:
InputNeuron.h:28
gplib::InputNeuron::GetBias
virtual double GetBias()
Get the bias.
Definition:
InputNeuron.h:50
gplib::InputNeuron::GetDelta
virtual double GetDelta()
Get delta for the weight correction formula.
Definition:
InputNeuron.h:40
gplib::InputNeuron::SetBias
virtual void SetBias(const double b)
Set the bias.
Definition:
InputNeuron.h:47
gplib::InputNeuron
Definition:
InputNeuron.h:13
gplib::GeneralLinearCombiner::tinvector
std::vector< boost::shared_ptr< GeneralNeuron > > tinvector
Definition:
GeneralLinearCombiner.h:20
GeneralNeuron.h
gplib::FatalException
The basic exception class for all errors that arise in gplib.
Definition:
FatalException.h:11
gplib::InputNeuron::~InputNeuron
virtual ~InputNeuron()
Definition:
InputNeuron.h:70
Generated on Wed May 25 2016 14:21:06 for GPLIB++ by
1.8.6