ITK
4.3.0
Insight Segmentation and Registration Toolkit
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
ITK
Modules
Numerics
NeuralNetworks
include
itkBackPropagationLayer.h
Go to the documentation of this file.
1
/*=========================================================================
2
*
3
* Copyright Insight Software Consortium
4
*
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
8
*
9
* http://www.apache.org/licenses/LICENSE-2.0.txt
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*
17
*=========================================================================*/
18
#ifndef __itkBackPropagationLayer_h
19
#define __itkBackPropagationLayer_h
20
21
#include "
itkCompletelyConnectedWeightSet.h
"
22
#include "
itkLayerBase.h
"
23
#include "
itkObject.h
"
24
#include "
itkMacro.h
"
25
26
namespace
itk
27
{
28
namespace
Statistics
29
{
36
template
<
class
TMeasurementVector,
class
TTargetVector>
37
class
BackPropagationLayer
:
public
LayerBase
<TMeasurementVector, TTargetVector>
38
{
39
public
:
40
typedef
BackPropagationLayer
Self
;
41
typedef
LayerBase<TMeasurementVector, TTargetVector>
Superclass
;
42
typedef
SmartPointer<Self>
Pointer
;
43
typedef
SmartPointer<const Self>
ConstPointer
;
44
46
itkTypeMacro(
BackPropagationLayer
,
LayerBase
);
47
itkNewMacro(
Self
);
49
50
typedef
typename
Superclass::ValueType
ValueType
;
51
typedef
vnl_vector<ValueType>
NodeVectorType
;
52
typedef
typename
Superclass::InternalVectorType
InternalVectorType
;
53
typedef
typename
Superclass::OutputVectorType
OutputVectorType
;
54
typedef
typename
Superclass::LayerInterfaceType
LayerInterfaceType
;
55
typedef
CompletelyConnectedWeightSet<TMeasurementVector,TTargetVector>
56
WeightSetType
;
57
58
typedef
typename
Superclass::WeightSetInterfaceType
WeightSetInterfaceType
;
59
typedef
typename
Superclass::InputFunctionInterfaceType
60
InputFunctionInterfaceType
;
61
typedef
typename
Superclass::TransferFunctionInterfaceType
62
TransferFunctionInterfaceType
;
63
//Member Functions
64
virtual
void
SetNumberOfNodes
(
unsigned
int
numNodes);
65
virtual
ValueType
GetInputValue
(
unsigned
int
i)
const
;
66
virtual
void
SetInputValue
(
unsigned
int
i,
ValueType
value);
67
68
virtual
ValueType
GetOutputValue
(
unsigned
int
)
const
;
69
virtual
void
SetOutputValue
(
unsigned
int
,
ValueType
);
70
71
virtual
ValueType
*
GetOutputVector
();
72
void
SetOutputVector
(TMeasurementVector value);
73
74
virtual
void
ForwardPropagate
();
75
virtual
void
ForwardPropagate
(TMeasurementVector input);
76
77
virtual
void
BackwardPropagate
();
78
virtual
void
BackwardPropagate
(
InternalVectorType
errors);
79
80
virtual
void
SetOutputErrorValues
(TTargetVector);
81
virtual
ValueType
GetOutputErrorValue
(
unsigned
int
node_id)
const
;
82
83
virtual
ValueType
GetInputErrorValue
(
unsigned
int
node_id)
const
;
84
virtual
ValueType
*
GetInputErrorVector
();
85
virtual
void
SetInputErrorValue
(
ValueType
,
unsigned
int
node_id);
86
87
virtual
ValueType
Activation
(
ValueType
);
88
virtual
ValueType
DActivation
(
ValueType
);
89
91
itkSetMacro( Bias,
ValueType
);
92
itkGetConstReferenceMacro( Bias,
ValueType
);
94
95
protected
:
96
97
BackPropagationLayer
();
98
virtual
~BackPropagationLayer
();
99
101
virtual
void
PrintSelf
( std::ostream& os,
Indent
indent )
const
;
102
103
private
:
104
105
NodeVectorType
m_NodeInputValues
;
106
NodeVectorType
m_NodeOutputValues
;
107
NodeVectorType
m_InputErrorValues
;
108
NodeVectorType
m_OutputErrorValues
;
109
ValueType
m_Bias
;
110
};
111
112
}
// end namespace Statistics
113
}
// end namespace itk
114
115
#ifndef ITK_MANUAL_INSTANTIATION
116
#include "itkBackPropagationLayer.hxx"
117
#endif
118
119
#endif
120
Generated on Sun Dec 9 2012 00:46:27 for ITK by
1.8.2