go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkFiniteDifferenceGradientDescentOptimizer.h
Go to the documentation of this file.
00001 /*======================================================================
00002 
00003   This file is part of the elastix software.
00004 
00005   Copyright (c) University Medical Center Utrecht. All rights reserved.
00006   See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
00007   details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE. See the above copyright notices for more information.
00012 
00013 ======================================================================*/
00014 
00015 #ifndef __itkFiniteDifferenceGradientDescentOptimizer_h
00016 #define __itkFiniteDifferenceGradientDescentOptimizer_h
00017 
00018 #include "itkScaledSingleValuedNonLinearOptimizer.h"
00019 
00020 
00021 namespace itk
00022 {
00023 
00052   class FiniteDifferenceGradientDescentOptimizer
00053     : public ScaledSingleValuedNonLinearOptimizer
00054   {
00055   public:
00056 
00058     typedef FiniteDifferenceGradientDescentOptimizer    Self;
00059     typedef ScaledSingleValuedNonLinearOptimizer        Superclass;
00060     typedef SmartPointer<Self>                  Pointer;
00061     typedef SmartPointer<const Self>            ConstPointer;
00062 
00064     itkNewMacro( Self );
00065 
00067     itkTypeMacro( FiniteDifferenceGradientDescentOptimizer, ScaledSingleValuedNonLinearOptimizer );
00068 
00070     typedef enum {
00071       MaximumNumberOfIterations,
00072         MetricError
00073     } StopConditionType;
00074 
00075 
00077     virtual void AdvanceOneStep( void );
00078 
00080     void StartOptimization( void );
00081 
00084     void ResumeOptimization( void );
00085 
00088     void StopOptimization( void );
00089 
00091     itkSetMacro( NumberOfIterations, unsigned long );
00092 
00094     itkGetConstMacro( NumberOfIterations, unsigned long );
00095 
00097     itkGetConstMacro( CurrentIteration, unsigned long );
00098 
00100     itkGetConstMacro( Value, double );
00101 
00103     itkGetConstMacro( StopCondition, StopConditionType );
00104 
00106     itkSetMacro( Param_a, double );
00107     itkGetMacro( Param_a, double );
00108 
00110     itkSetMacro( Param_c, double );
00111     itkGetMacro( Param_c, double );
00112 
00114     itkSetMacro( Param_A, double );
00115     itkGetMacro( Param_A, double );
00116 
00118     itkSetMacro( Param_alpha, double );
00119     itkGetMacro( Param_alpha, double );
00120 
00122     itkSetMacro( Param_gamma, double );
00123     itkGetMacro( Param_gamma, double );
00124 
00125     itkGetConstMacro( ComputeCurrentValue, bool );
00126     itkSetMacro( ComputeCurrentValue, bool );
00127     itkBooleanMacro( ComputeCurrentValue );
00128 
00130     itkGetConstMacro( GradientMagnitude, double );
00131     itkGetConstMacro( LearningRate, double);
00132 
00133   protected:
00134 
00135     FiniteDifferenceGradientDescentOptimizer();
00136     virtual ~FiniteDifferenceGradientDescentOptimizer() {};
00137 
00139     void PrintSelf( std::ostream& os, Indent indent ) const;
00140 
00141     // made protected so subclass can access
00142     DerivativeType                m_Gradient;
00143     double                        m_LearningRate;
00144     double                        m_GradientMagnitude;
00145 
00151     bool                          m_ComputeCurrentValue;
00152 
00153     // Functions to compute the parameters at iteration k.
00154     virtual double Compute_a( unsigned long k ) const;
00155     virtual double Compute_c( unsigned long k ) const;
00156 
00157   private:
00158 
00159     FiniteDifferenceGradientDescentOptimizer( const Self& );  // purposely not implemented
00160     void operator=( const Self& );                    // purposely not implemented
00161 
00163     bool                          m_Stop;
00164     double                        m_Value;
00165     StopConditionType             m_StopCondition;
00166     unsigned long                 m_NumberOfIterations;
00167     unsigned long                 m_CurrentIteration;
00168 
00170     double                        m_Param_a;
00171     double                        m_Param_c;
00172     double                        m_Param_A;
00173     double                        m_Param_alpha;
00174     double                        m_Param_gamma;
00175 
00176   }; // end class FiniteDifferenceGradientDescentOptimizer
00177 
00178 
00179 } // end namespace itk
00180 
00181 
00182 #endif // end #ifndef __itkFiniteDifferenceGradientDescentOptimizer_h
00183 


Generated on 24-05-2012 for elastix by doxygen 1.7.6.1 elastix logo