00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkErrorBackPropagationLearningWithMomentum.h,v $ 00005 Language: C++ 00006 Date: $Date: 2005/08/02 19:17:37 $ 00007 Version: $Revision: 1.1 $ 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 TOutput> 00039 class ErrorBackPropagationLearningWithMomentum : public LearningFunctionBase<LayerType, TOutput> 00040 { 00041 public: 00042 00043 typedef ErrorBackPropagationLearningWithMomentum Self; 00044 typedef LearningFunctionBase<LayerType, TOutput> 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 void Learn(LayerType* layer, ValueType learningrate); 00056 00057 void Learn(LayerType* layer, TOutput errors, ValueType learningrate); 00058 00059 00060 protected: 00061 ErrorBackPropagationLearningWithMomentum(); 00062 ~ErrorBackPropagationLearningWithMomentum() {}; 00063 00064 virtual void PrintSelf( std::ostream& os, Indent indent ) const; 00065 00066 ValueType m_Momentum; 00067 }; 00068 00069 } // end namespace Statistics 00070 } // end namespace itk 00071 00072 #ifndef ITK_MANUAL_INSTANTIATION 00073 #include "itkErrorBackPropagationLearningWithMomentum.txx" 00074 #endif 00075 00076 #endif