ITK  4.4.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<class TMeasurementVector, class 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);
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 
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;
102 
103 private:
104 
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