ITK  4.13.0
Insight Segmentation and Registration Toolkit
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 
22 #include "itkLayerBase.h"
23 #include "itkObject.h"
24 #include "itkMacro.h"
25 
26 namespace itk
27 {
28 namespace Statistics
29 {
36 template<typename TMeasurementVector, typename TTargetVector>
37 class ITK_TEMPLATE_EXPORT BackPropagationLayer : public LayerBase<TMeasurementVector, TTargetVector>
38 {
39 public:
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;
57 
58  typedef typename Superclass::WeightSetInterfaceType WeightSetInterfaceType;
59  typedef typename Superclass::InputFunctionInterfaceType
61  typedef typename Superclass::TransferFunctionInterfaceType
63  //Member Functions
64  virtual void SetNumberOfNodes(unsigned int numNodes) ITK_OVERRIDE;
65  virtual ValueType GetInputValue(unsigned int i) const ITK_OVERRIDE;
66  virtual void SetInputValue(unsigned int i, ValueType value);
67 
68  virtual ValueType GetOutputValue(unsigned int) const ITK_OVERRIDE;
69  virtual void SetOutputValue(unsigned int, ValueType);
70 
71  virtual ValueType * GetOutputVector() ITK_OVERRIDE;
72  void SetOutputVector(TMeasurementVector value);
73 
74  virtual void ForwardPropagate() ITK_OVERRIDE;
75  virtual void ForwardPropagate(TMeasurementVector input) ITK_OVERRIDE;
76 
77  virtual void BackwardPropagate() ITK_OVERRIDE;
78  virtual void BackwardPropagate(InternalVectorType errors) ITK_OVERRIDE;
79 
80  virtual void SetOutputErrorValues(TTargetVector) ITK_OVERRIDE;
81  virtual ValueType GetOutputErrorValue(unsigned int node_id) const ITK_OVERRIDE;
82 
83  virtual ValueType GetInputErrorValue(unsigned int node_id) const ITK_OVERRIDE;
84  virtual ValueType * GetInputErrorVector() ITK_OVERRIDE;
85  virtual void SetInputErrorValue(ValueType, unsigned int node_id) ITK_OVERRIDE;
86 
87  virtual ValueType Activation(ValueType) ITK_OVERRIDE;
88  virtual ValueType DActivation(ValueType) ITK_OVERRIDE;
89 
91  itkSetMacro( Bias, ValueType );
92  itkGetConstReferenceMacro( Bias, ValueType );
94 
95 protected:
96 
98  virtual ~BackPropagationLayer() ITK_OVERRIDE;
99 
101  virtual void PrintSelf( std::ostream& os, Indent indent ) const ITK_OVERRIDE;
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
This is the itkLayerBase class.
Definition: itkLayerBase.h:38
Light weight base class for most itk classes.
LayerBase< TMeasurementVector, TTargetVector > Superclass
Superclass::TransferFunctionInterfaceType TransferFunctionInterfaceType
TMeasurementVector::ValueType ValueType
Definition: itkLayerBase.h:52
This is the itkBackPropagationLayer class.
Superclass::LayerInterfaceType LayerInterfaceType
Superclass::InputFunctionInterfaceType InputFunctionInterfaceType
CompletelyConnectedWeightSet< TMeasurementVector, TTargetVector > WeightSetType
This is the itkCompletelyConnectedWeightSet class.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Superclass::InternalVectorType InternalVectorType
Superclass::WeightSetInterfaceType WeightSetInterfaceType
Superclass::OutputVectorType OutputVectorType