Loading...
Searching...
No Matches
itkGradientDescentOptimizer2.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 itkGradientDescentOptimizer2_h
#define itkGradientDescentOptimizer2_h
#include "itkScaledSingleValuedNonLinearOptimizer.h"
namespace itk
{
class GradientDescentOptimizer2 : public ScaledSingleValuedNonLinearOptimizer
{
public:
ITK_DISALLOW_COPY_AND_MOVE(GradientDescentOptimizer2);
using Self = GradientDescentOptimizer2;
using Superclass = ScaledSingleValuedNonLinearOptimizer;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
itkNewMacro(Self);
itkTypeMacro(GradientDescentOptimizer2, ScaledSingleValuedNonLinearOptimizer);
using Superclass::MeasureType;
using Superclass::ParametersType;
using Superclass::DerivativeType;
using Superclass::CostFunctionType;
using Superclass::ScalesType;
using Superclass::ScaledCostFunctionType;
using Superclass::ScaledCostFunctionPointer;
enum StopConditionType
{
MaximumNumberOfIterations,
MetricError,
MinimumStepSize
};
virtual void
AdvanceOneStep();
void
StartOptimization() override;
virtual void
ResumeOptimization();
virtual void
MetricErrorResponse(ExceptionObject & err);
virtual void
StopOptimization();
itkSetMacro(LearningRate, double);
itkGetConstReferenceMacro(LearningRate, double);
itkSetMacro(NumberOfIterations, unsigned long);
itkGetConstReferenceMacro(NumberOfIterations, unsigned long);
itkGetConstMacro(CurrentIteration, unsigned int);
itkGetConstReferenceMacro(Value, double);
itkGetConstReferenceMacro(StopCondition, StopConditionType);
itkGetConstReferenceMacro(Gradient, DerivativeType);
itkGetConstReferenceMacro(SearchDirection, DerivativeType);
protected:
GradientDescentOptimizer2();
~GradientDescentOptimizer2() override = default;
void
PrintSelf(std::ostream & os, Indent indent) const override;
// made protected so subclass can access
DerivativeType m_Gradient{};
DerivativeType m_SearchDirection{};
StopConditionType m_StopCondition{ MaximumNumberOfIterations };
private:
double m_Value{ 0.0 };
double m_LearningRate{ 1.0 };
bool m_Stop{ false };
unsigned long m_NumberOfIterations{ 100 };
unsigned long m_CurrentIteration{ 0 };
};
} // end namespace itk
#endif
itk::GradientDescentOptimizer2::StopOptimization
virtual void StopOptimization()
itk::GradientDescentOptimizer2::m_SearchDirection
DerivativeType m_SearchDirection
Definition itkGradientDescentOptimizer2.h:147
itk::GradientDescentOptimizer2::ITK_DISALLOW_COPY_AND_MOVE
ITK_DISALLOW_COPY_AND_MOVE(GradientDescentOptimizer2)
itk::GradientDescentOptimizer2::ConstPointer
SmartPointer< const Self > ConstPointer
Definition itkGradientDescentOptimizer2.h:63
itk::GradientDescentOptimizer2::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
itk::GradientDescentOptimizer2::GradientDescentOptimizer2
GradientDescentOptimizer2()
itk::GradientDescentOptimizer2::Self
GradientDescentOptimizer2 Self
Definition itkGradientDescentOptimizer2.h:60
itk::GradientDescentOptimizer2::AdvanceOneStep
virtual void AdvanceOneStep()
itk::GradientDescentOptimizer2::MetricErrorResponse
virtual void MetricErrorResponse(ExceptionObject &err)
itk::GradientDescentOptimizer2::m_Value
double m_Value
Definition itkGradientDescentOptimizer2.h:151
itk::GradientDescentOptimizer2::Superclass
ScaledSingleValuedNonLinearOptimizer Superclass
Definition itkGradientDescentOptimizer2.h:61
itk::GradientDescentOptimizer2::StopConditionType
StopConditionType
Definition itkGradientDescentOptimizer2.h:84
itk::GradientDescentOptimizer2::MetricError
@ MetricError
Definition itkGradientDescentOptimizer2.h:86
itk::GradientDescentOptimizer2::MaximumNumberOfIterations
@ MaximumNumberOfIterations
Definition itkGradientDescentOptimizer2.h:85
itk::GradientDescentOptimizer2::MinimumStepSize
@ MinimumStepSize
Definition itkGradientDescentOptimizer2.h:87
itk::GradientDescentOptimizer2::m_StopCondition
StopConditionType m_StopCondition
Definition itkGradientDescentOptimizer2.h:148
itk::GradientDescentOptimizer2::m_LearningRate
double m_LearningRate
Definition itkGradientDescentOptimizer2.h:152
itk::GradientDescentOptimizer2::m_Gradient
DerivativeType m_Gradient
Definition itkGradientDescentOptimizer2.h:146
itk::GradientDescentOptimizer2::Pointer
SmartPointer< Self > Pointer
Definition itkGradientDescentOptimizer2.h:62
itk::GradientDescentOptimizer2::m_Stop
bool m_Stop
Definition itkGradientDescentOptimizer2.h:153
itk::GradientDescentOptimizer2::m_CurrentIteration
unsigned long m_CurrentIteration
Definition itkGradientDescentOptimizer2.h:155
itk::GradientDescentOptimizer2::StartOptimization
void StartOptimization() override
itk::GradientDescentOptimizer2::m_NumberOfIterations
unsigned long m_NumberOfIterations
Definition itkGradientDescentOptimizer2.h:154
itk::GradientDescentOptimizer2::~GradientDescentOptimizer2
~GradientDescentOptimizer2() override=default
itk::GradientDescentOptimizer2::ResumeOptimization
virtual void ResumeOptimization()
itk::ScaledSingleValuedNonLinearOptimizer::ScaledSingleValuedNonLinearOptimizer
ScaledSingleValuedNonLinearOptimizer()
itk::ScaledSingleValuedNonLinearOptimizer::ScaledCostFunctionPointer
ScaledCostFunctionType::Pointer ScaledCostFunctionPointer
Definition itkScaledSingleValuedNonLinearOptimizer.h:87
itk::ScaledSingleValuedNonLinearOptimizer::ScalesType
NonLinearOptimizer::ScalesType ScalesType
Definition itkScaledSingleValuedNonLinearOptimizer.h:85
itk::ScaledSingleValuedNonLinearOptimizer::ScaledCostFunctionType
ScaledSingleValuedCostFunction ScaledCostFunctionType
Definition itkScaledSingleValuedNonLinearOptimizer.h:86
itkScaledSingleValuedNonLinearOptimizer.h
itk
Definition itkAdvancedImageToImageMetric.h:43

Generated on 1768596610 for elastix by 1.15.0 |