Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkBackPropagationLayer.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkBackPropagationLayer.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/01/20 15:28:37 $
00007   Version:   $Revision: 1.6 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkBackPropagationLayerBase_h
00018 #define __itkBackPropagationLayerBase_h
00019 
00020 #include "itkLayerBase.h"
00021 #include "itkObject.h"
00022 #include "itkMacro.h"
00023 
00024 namespace itk
00025 {
00026 namespace Statistics
00027 {
00028 template<class TVector, class TOutput>
00029 class BackPropagationLayer : public LayerBase<TVector, TOutput>
00030 {
00031 public:           
00032   typedef BackPropagationLayer Self;
00033   typedef LayerBase<TVector, TOutput> Superclass;
00034   typedef SmartPointer<Self> Pointer;
00035   typedef SmartPointer<const Self> ConstPointer;
00036 
00038   itkTypeMacro(BackPropagationLayer, LayerBase);  
00039   itkNewMacro(Self);
00041 
00042   typedef typename Superclass::ValueType ValueType;
00043   typedef typename Superclass::ValuePointer ValuePointer;
00044   typedef typename Superclass::ValueConstPointer ValueConstPointer;
00045   typedef vnl_vector<ValueType> NodeVectorType;
00046   typedef typename Superclass::InternalVectorType InternalVectorType;
00047   typedef typename Superclass::OutputVectorType OutputVectorType;
00048 
00049   //Member Functions
00050   void SetNumberOfNodes(unsigned int);
00051   ValueType GetInputValue(unsigned int i) const;
00052   void SetInputValue(unsigned int i, ValueType value);
00053 
00054   ValueType GetOutputValue(unsigned int) const;
00055   void SetOutputValue(unsigned int, ValueType);
00056 
00057   ValuePointer GetOutputVector();
00058   void SetOutputVector(TVector value);
00059 
00060   void ForwardPropagate();
00061   void ForwardPropagate(TVector);
00062 
00063   void BackwardPropagate(InternalVectorType e);
00064   void BackwardPropagate();
00065 
00066   void SetOutputErrorValues(TOutput);
00067   ValueType GetOutputErrorValue(unsigned int) const;
00068 
00069   ValueType GetInputErrorValue(unsigned int) const;
00070   ValuePointer GetInputErrorVector();
00071   void SetInputErrorValue(ValueType, unsigned int);
00072 
00073   ValueType Activation(ValueType);
00074   ValueType DActivation(ValueType);
00075 
00077   itkSetMacro( Bias, ValueType );
00078   itkGetConstReferenceMacro( Bias, ValueType );
00080 
00081 protected:                
00082 
00083   BackPropagationLayer();
00084   ~BackPropagationLayer();
00085 
00087   virtual void PrintSelf( std::ostream& os, Indent indent ) const;
00088 
00089 private:
00090 
00091   NodeVectorType   m_NodeInputValues;
00092   NodeVectorType   m_NodeOutputValues;
00093   NodeVectorType   m_InputErrorValues;
00094   NodeVectorType   m_OutputErrorValues;
00095   ValueType        m_Bias;
00096 };
00097 
00098 } // end namespace Statistics
00099 } // end namespace itk
00100 
00101 #ifndef ITK_MANUAL_INSTANTIATION
00102   #include "itkBackPropagationLayer.txx"
00103 #endif
00104 
00105 #endif
00106 

Generated at Sun Mar 11 23:28:55 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000