00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkErrorBackPropagationLearningWithMomentum.h,v $ 00005 Language: C++ 00006 Date: $Date: 2007/09/03 21:17:59 $ 00007 Version: $Revision: 1.3 $ 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 00026 #ifndef __itkErrorBackPropagationLearningWithMomentum_h 00027 #define __itkErrorBackPropagationLearningWithMomentum_h 00028 00029 #include <iostream> 00030 #include "itkLightProcessObject.h" 00031 #include "itkLearningFunctionBase.h" 00032 00033 namespace itk 00034 { 00035 namespace Statistics 00036 { 00037 00038 template<class LayerType, class TTargetVector> 00039 class ErrorBackPropagationLearningWithMomentum : public LearningFunctionBase<typename LayerType::LayerInterfaceType, TTargetVector> 00040 { 00041 public: 00042 00043 typedef ErrorBackPropagationLearningWithMomentum Self; 00044 typedef LearningFunctionBase<typename LayerType::LayerInterfaceType, TTargetVector> Superclass; 00045 typedef SmartPointer<Self> Pointer; 00046 typedef SmartPointer<const Self> ConstPointer; 00047 00049 itkTypeMacro(ErrorBackPropagationLearningWithMomentum, LearningFunctionBase); 00050 00052 itkNewMacro(Self); 00053 00054 typedef typename Superclass::ValueType ValueType; 00055 typedef typename LayerType::LayerInterfaceType LayerInterfaceType; 00056 00057 virtual void Learn( LayerInterfaceType * layer, ValueType learningrate ); 00058 virtual void Learn( LayerInterfaceType * layer, TTargetVector errors, ValueType learningrate ); 00059 00060 00061 protected: 00062 ErrorBackPropagationLearningWithMomentum(); 00063 virtual ~ErrorBackPropagationLearningWithMomentum() {}; 00064 00065 virtual void PrintSelf( std::ostream& os, Indent indent ) const; 00066 00067 ValueType m_Momentum; 00068 }; 00069 00070 } // end namespace Statistics 00071 } // end namespace itk 00072 00073 #ifndef ITK_MANUAL_INSTANTIATION 00074 #include "itkErrorBackPropagationLearningWithMomentum.txx" 00075 #endif 00076 00077 #endif 00078