Loading...
Searching...
No Matches
itkFiniteDifferenceGradientDescentOptimizer.h
Go to the documentation of this file.
/*=========================================================================
*
* Copyright UMC Utrecht and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef itkFiniteDifferenceGradientDescentOptimizer_h
#define itkFiniteDifferenceGradientDescentOptimizer_h
#include "itkScaledSingleValuedNonLinearOptimizer.h"
namespace itk
{
class FiniteDifferenceGradientDescentOptimizer : public ScaledSingleValuedNonLinearOptimizer
{
public:
ITK_DISALLOW_COPY_AND_MOVE(FiniteDifferenceGradientDescentOptimizer);
using Self = FiniteDifferenceGradientDescentOptimizer;
using Superclass = ScaledSingleValuedNonLinearOptimizer;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
itkNewMacro(Self);
itkTypeMacro(FiniteDifferenceGradientDescentOptimizer, ScaledSingleValuedNonLinearOptimizer);
enum StopConditionType
{
MaximumNumberOfIterations,
MetricError
};
virtual void
AdvanceOneStep();
void
StartOptimization() override;
void
ResumeOptimization();
void
StopOptimization();
itkSetMacro(NumberOfIterations, unsigned long);
itkGetConstMacro(NumberOfIterations, unsigned long);
itkGetConstMacro(CurrentIteration, unsigned long);
itkGetConstMacro(Value, double);
itkGetConstMacro(StopCondition, StopConditionType);
itkSetMacro(Param_a, double);
itkGetConstMacro(Param_a, double);
itkSetMacro(Param_c, double);
itkGetConstMacro(Param_c, double);
itkSetMacro(Param_A, double);
itkGetConstMacro(Param_A, double);
itkSetMacro(Param_alpha, double);
itkGetConstMacro(Param_alpha, double);
itkSetMacro(Param_gamma, double);
itkGetConstMacro(Param_gamma, double);
itkGetConstMacro(ComputeCurrentValue, bool);
itkSetMacro(ComputeCurrentValue, bool);
itkBooleanMacro(ComputeCurrentValue);
itkGetConstMacro(GradientMagnitude, double);
itkGetConstMacro(LearningRate, double);
protected:
FiniteDifferenceGradientDescentOptimizer();
~FiniteDifferenceGradientDescentOptimizer() override = default;
void
PrintSelf(std::ostream & os, Indent indent) const override;
// made protected so subclass can access
DerivativeType m_Gradient{};
double m_LearningRate{ 0.0 };
double m_GradientMagnitude{ 0.0 };
bool m_ComputeCurrentValue{ false };
// Functions to compute the parameters at iteration k.
virtual double
Compute_a(unsigned long k) const;
virtual double
Compute_c(unsigned long k) const;
private:
bool m_Stop{ false };
double m_Value{ 0.0 };
StopConditionType m_StopCondition{ MaximumNumberOfIterations };
unsigned long m_NumberOfIterations{ 100 };
unsigned long m_CurrentIteration{ 0 };
double m_Param_a{ 1.0 };
double m_Param_c{ 1.0 };
double m_Param_A{ 1.0 };
double m_Param_alpha{ 0.602 };
double m_Param_gamma{ 0.101 };
};
} // end namespace itk
#endif // end #ifndef itkFiniteDifferenceGradientDescentOptimizer_h
itk::FiniteDifferenceGradientDescentOptimizer::FiniteDifferenceGradientDescentOptimizer
FiniteDifferenceGradientDescentOptimizer()
itk::FiniteDifferenceGradientDescentOptimizer::m_NumberOfIterations
unsigned long m_NumberOfIterations
Definition itkFiniteDifferenceGradientDescentOptimizer.h:172
itk::FiniteDifferenceGradientDescentOptimizer::Self
FiniteDifferenceGradientDescentOptimizer Self
Definition itkFiniteDifferenceGradientDescentOptimizer.h:61
itk::FiniteDifferenceGradientDescentOptimizer::Superclass
ScaledSingleValuedNonLinearOptimizer Superclass
Definition itkFiniteDifferenceGradientDescentOptimizer.h:62
itk::FiniteDifferenceGradientDescentOptimizer::ITK_DISALLOW_COPY_AND_MOVE
ITK_DISALLOW_COPY_AND_MOVE(FiniteDifferenceGradientDescentOptimizer)
itk::FiniteDifferenceGradientDescentOptimizer::m_Gradient
DerivativeType m_Gradient
Definition itkFiniteDifferenceGradientDescentOptimizer.h:149
itk::FiniteDifferenceGradientDescentOptimizer::m_Param_gamma
double m_Param_gamma
Definition itkFiniteDifferenceGradientDescentOptimizer.h:180
itk::FiniteDifferenceGradientDescentOptimizer::StartOptimization
void StartOptimization() override
itk::FiniteDifferenceGradientDescentOptimizer::Compute_a
virtual double Compute_a(unsigned long k) const
itk::FiniteDifferenceGradientDescentOptimizer::AdvanceOneStep
virtual void AdvanceOneStep()
itk::FiniteDifferenceGradientDescentOptimizer::ConstPointer
SmartPointer< const Self > ConstPointer
Definition itkFiniteDifferenceGradientDescentOptimizer.h:64
itk::FiniteDifferenceGradientDescentOptimizer::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
itk::FiniteDifferenceGradientDescentOptimizer::~FiniteDifferenceGradientDescentOptimizer
~FiniteDifferenceGradientDescentOptimizer() override=default
itk::FiniteDifferenceGradientDescentOptimizer::m_Stop
bool m_Stop
Definition itkFiniteDifferenceGradientDescentOptimizer.h:169
itk::FiniteDifferenceGradientDescentOptimizer::m_CurrentIteration
unsigned long m_CurrentIteration
Definition itkFiniteDifferenceGradientDescentOptimizer.h:173
itk::FiniteDifferenceGradientDescentOptimizer::m_Param_alpha
double m_Param_alpha
Definition itkFiniteDifferenceGradientDescentOptimizer.h:179
itk::FiniteDifferenceGradientDescentOptimizer::m_Param_c
double m_Param_c
Definition itkFiniteDifferenceGradientDescentOptimizer.h:177
itk::FiniteDifferenceGradientDescentOptimizer::StopConditionType
StopConditionType
Definition itkFiniteDifferenceGradientDescentOptimizer.h:74
itk::FiniteDifferenceGradientDescentOptimizer::MaximumNumberOfIterations
@ MaximumNumberOfIterations
Definition itkFiniteDifferenceGradientDescentOptimizer.h:75
itk::FiniteDifferenceGradientDescentOptimizer::MetricError
@ MetricError
Definition itkFiniteDifferenceGradientDescentOptimizer.h:76
itk::FiniteDifferenceGradientDescentOptimizer::m_LearningRate
double m_LearningRate
Definition itkFiniteDifferenceGradientDescentOptimizer.h:150
itk::FiniteDifferenceGradientDescentOptimizer::Compute_c
virtual double Compute_c(unsigned long k) const
itk::FiniteDifferenceGradientDescentOptimizer::m_GradientMagnitude
double m_GradientMagnitude
Definition itkFiniteDifferenceGradientDescentOptimizer.h:151
itk::FiniteDifferenceGradientDescentOptimizer::m_ComputeCurrentValue
bool m_ComputeCurrentValue
Definition itkFiniteDifferenceGradientDescentOptimizer.h:158
itk::FiniteDifferenceGradientDescentOptimizer::StopOptimization
void StopOptimization()
itk::FiniteDifferenceGradientDescentOptimizer::Pointer
SmartPointer< Self > Pointer
Definition itkFiniteDifferenceGradientDescentOptimizer.h:63
itk::FiniteDifferenceGradientDescentOptimizer::m_Param_A
double m_Param_A
Definition itkFiniteDifferenceGradientDescentOptimizer.h:178
itk::FiniteDifferenceGradientDescentOptimizer::ResumeOptimization
void ResumeOptimization()
itk::FiniteDifferenceGradientDescentOptimizer::m_Value
double m_Value
Definition itkFiniteDifferenceGradientDescentOptimizer.h:170
itk::FiniteDifferenceGradientDescentOptimizer::m_Param_a
double m_Param_a
Definition itkFiniteDifferenceGradientDescentOptimizer.h:176
itk::FiniteDifferenceGradientDescentOptimizer::m_StopCondition
StopConditionType m_StopCondition
Definition itkFiniteDifferenceGradientDescentOptimizer.h:171
itk::ScaledSingleValuedNonLinearOptimizer::ScaledSingleValuedNonLinearOptimizer
ScaledSingleValuedNonLinearOptimizer()
itkScaledSingleValuedNonLinearOptimizer.h
itk
Definition itkAdvancedImageToImageMetric.h:43

Generated on 1768596610 for elastix by 1.15.0 |