ITK  4.8.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 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;
57 
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();
99 
101  virtual void PrintSelf( std::ostream& os, Indent indent ) const ITK_OVERRIDE;
102 
103 private:
104 
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
virtual void SetInputValue(unsigned int i, ValueType value)
Light weight base class for most itk classes.
virtual ValueType GetInputValue(unsigned int i) const override
LayerBase< TMeasurementVector, TTargetVector > Superclass
virtual void BackwardPropagate() override
Superclass::TransferFunctionInterfaceType TransferFunctionInterfaceType
TTargetVector OutputVectorType
Definition: itkLayerBase.h:50
virtual ValueType * GetInputErrorVector() override
TMeasurementVector::ValueType ValueType
Definition: itkLayerBase.h:52
virtual ValueType DActivation(ValueType) override
void SetOutputVector(TMeasurementVector value)
virtual ValueType GetInputErrorValue(unsigned int node_id) const override
This is the itkBackPropagationLayer class.
Superclass::LayerInterfaceType LayerInterfaceType
Superclass::InputFunctionInterfaceType InputFunctionInterfaceType
virtual void SetInputErrorValue(ValueType, unsigned int node_id) override
virtual ValueType * GetOutputVector() override
virtual void SetOutputErrorValues(TTargetVector) override
virtual ValueType GetOutputValue(unsigned int) const override
CompletelyConnectedWeightSet< TMeasurementVector, TTargetVector > WeightSetType
This is the itkCompletelyConnectedWeightSet class.
virtual ValueType GetOutputErrorValue(unsigned int node_id) const override
Control indentation during Print() invocation.
Definition: itkIndent.h:49
virtual ValueType Activation(ValueType) override
Superclass::InternalVectorType InternalVectorType
Superclass::WeightSetInterfaceType WeightSetInterfaceType
Array< ValueType > InternalVectorType
Definition: itkLayerBase.h:56
InputFunctionBase< ValueType *, ValueType > InputFunctionInterfaceType
Definition: itkLayerBase.h:61
virtual void SetNumberOfNodes(unsigned int numNodes) override
WeightSetBase< TMeasurementVector, TTargetVector > WeightSetInterfaceType
Definition: itkLayerBase.h:60
Superclass::OutputVectorType OutputVectorType
virtual void SetOutputValue(unsigned int, ValueType)
virtual void ForwardPropagate() override
virtual void PrintSelf(std::ostream &os, Indent indent) const override
TransferFunctionBase< ValueType > TransferFunctionInterfaceType
Definition: itkLayerBase.h:62