Loading...
Searching...
No Matches
elxQuasiNewtonLBFGS.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 elxQuasiNewtonLBFGS_h
#define elxQuasiNewtonLBFGS_h
#include "elxIncludes.h" // include first to avoid MSVS warning
#include "itkQuasiNewtonLBFGSOptimizer.h"
#include "itkMoreThuenteLineSearchOptimizer.h"
namespace elastix
{
template <class TElastix>
class ITK_TEMPLATE_EXPORT QuasiNewtonLBFGS
: public itk::QuasiNewtonLBFGSOptimizer
, public OptimizerBase<TElastix>
{
public:
ITK_DISALLOW_COPY_AND_MOVE(QuasiNewtonLBFGS);
using Self = QuasiNewtonLBFGS;
using Superclass1 = QuasiNewtonLBFGSOptimizer;
using Superclass2 = OptimizerBase<TElastix>;
using Pointer = itk::SmartPointer<Self>;
using ConstPointer = itk::SmartPointer<const Self>;
itkNewMacro(Self);
itkTypeMacro(QuasiNewtonLBFGS, QuasiNewtonLBFGSOptimizer);
elxClassNameMacro("QuasiNewtonLBFGS");
using Superclass1::CostFunctionType;
using Superclass1::CostFunctionPointer;
using Superclass1::StopConditionType;
using Superclass1::ParametersType;
using Superclass1::DerivativeType;
using Superclass1::ScalesType;
using typename Superclass2::ElastixType;
using typename Superclass2::RegistrationType;
using ITKBaseType = typename Superclass2::ITKBaseType;
using LineOptimizerType = itk::MoreThuenteLineSearchOptimizer;
using LineOptimizerPointer = LineOptimizerType::Pointer;
using EventPassThroughType = itk::ReceptorMemberCommand<Self>;
using EventPassThroughPointer = typename EventPassThroughType::Pointer;
void
StartOptimization() override;
void
BeforeRegistration() override;
void
BeforeEachResolution() override;
void
AfterEachResolution() override;
void
AfterEachIteration() override;
void
AfterRegistration() override;
itkGetConstMacro(StartLineSearch, bool);
protected:
QuasiNewtonLBFGS();
~QuasiNewtonLBFGS() override = default;
LineOptimizerPointer m_LineOptimizer;
virtual std::string
GetLineSearchStopCondition() const;
virtual std::string
DeterminePhase() const;
bool
TestConvergence(bool firstLineSearchDone) override;
void
LineSearch(const ParametersType searchDir, double & step, ParametersType & x, MeasureType & f, DerivativeType & g)
override;
private:
elxOverrideGetSelfMacro;
void
InvokeIterationEvent(const itk::EventObject & event);
EventPassThroughPointer m_EventPasser;
double m_SearchDirectionMagnitude;
bool m_StartLineSearch;
bool m_GenerateLineSearchIterations;
bool m_StopIfWolfeNotSatisfied;
bool m_WolfeIsStopCondition;
};
} // end namespace elastix
#ifndef ITK_MANUAL_INSTANTIATION
# include "elxQuasiNewtonLBFGS.hxx"
#endif
#endif // end #ifndef elxQuasiNewtonLBFGS_h
elastix::OptimizerBase::OptimizerBase
OptimizerBase()=default
elastix::OptimizerBase::RegistrationType
typename ElastixType::RegistrationBaseType RegistrationType
Definition elxBaseComponentSE.h:62
elastix::OptimizerBase::ElastixType
TElastix ElastixType
Definition elxBaseComponentSE.h:57
elastix::OptimizerBase::ITKBaseType
itk::Optimizer ITKBaseType
Definition elxOptimizerBase.h:70
elastix::OptimizerBase::ParametersType
typename ITKBaseType::ParametersType ParametersType
Definition elxOptimizerBase.h:73
elastix::QuasiNewtonLBFGS::TestConvergence
bool TestConvergence(bool firstLineSearchDone) override
elastix::QuasiNewtonLBFGS::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition elxQuasiNewtonLBFGS.h:100
elastix::QuasiNewtonLBFGS::Superclass2
OptimizerBase< TElastix > Superclass2
Definition elxQuasiNewtonLBFGS.h:98
elastix::QuasiNewtonLBFGS::GetLineSearchStopCondition
virtual std::string GetLineSearchStopCondition() const
elastix::QuasiNewtonLBFGS::m_GenerateLineSearchIterations
bool m_GenerateLineSearchIterations
Definition elxQuasiNewtonLBFGS.h:195
elastix::QuasiNewtonLBFGS::StartOptimization
void StartOptimization() override
elastix::QuasiNewtonLBFGS::Superclass1
QuasiNewtonLBFGSOptimizer Superclass1
Definition elxQuasiNewtonLBFGS.h:97
elastix::QuasiNewtonLBFGS::m_EventPasser
EventPassThroughPointer m_EventPasser
Definition elxQuasiNewtonLBFGS.h:192
elastix::QuasiNewtonLBFGS::BeforeRegistration
void BeforeRegistration() override
elastix::QuasiNewtonLBFGS::~QuasiNewtonLBFGS
~QuasiNewtonLBFGS() override=default
elastix::QuasiNewtonLBFGS::AfterEachIteration
void AfterEachIteration() override
elastix::QuasiNewtonLBFGS::m_StartLineSearch
bool m_StartLineSearch
Definition elxQuasiNewtonLBFGS.h:194
elastix::QuasiNewtonLBFGS::AfterRegistration
void AfterRegistration() override
elastix::QuasiNewtonLBFGS::LineSearch
void LineSearch(const ParametersType searchDir, double &step, ParametersType &x, MeasureType &f, DerivativeType &g) override
elastix::QuasiNewtonLBFGS::m_LineOptimizer
LineOptimizerPointer m_LineOptimizer
Definition elxQuasiNewtonLBFGS.h:161
elastix::QuasiNewtonLBFGS::Pointer
itk::SmartPointer< Self > Pointer
Definition elxQuasiNewtonLBFGS.h:99
elastix::QuasiNewtonLBFGS::ITK_DISALLOW_COPY_AND_MOVE
ITK_DISALLOW_COPY_AND_MOVE(QuasiNewtonLBFGS)
elastix::QuasiNewtonLBFGS::EventPassThroughPointer
typename EventPassThroughType::Pointer EventPassThroughPointer
Definition elxQuasiNewtonLBFGS.h:131
elastix::QuasiNewtonLBFGS::m_WolfeIsStopCondition
bool m_WolfeIsStopCondition
Definition elxQuasiNewtonLBFGS.h:197
elastix::QuasiNewtonLBFGS::m_StopIfWolfeNotSatisfied
bool m_StopIfWolfeNotSatisfied
Definition elxQuasiNewtonLBFGS.h:196
elastix::QuasiNewtonLBFGS::elxOverrideGetSelfMacro
elxOverrideGetSelfMacro
Definition elxQuasiNewtonLBFGS.h:187
elastix::QuasiNewtonLBFGS::InvokeIterationEvent
void InvokeIterationEvent(const itk::EventObject &event)
elastix::QuasiNewtonLBFGS::AfterEachResolution
void AfterEachResolution() override
elastix::QuasiNewtonLBFGS::DeterminePhase
virtual std::string DeterminePhase() const
elastix::QuasiNewtonLBFGS::Self
QuasiNewtonLBFGS Self
Definition elxQuasiNewtonLBFGS.h:96
elastix::QuasiNewtonLBFGS::QuasiNewtonLBFGS
QuasiNewtonLBFGS()
elastix::QuasiNewtonLBFGS::ITKBaseType
typename Superclass2::ITKBaseType ITKBaseType
Definition elxQuasiNewtonLBFGS.h:125
elastix::QuasiNewtonLBFGS::BeforeEachResolution
void BeforeEachResolution() override
elastix::QuasiNewtonLBFGS::elxClassNameMacro
elxClassNameMacro("QuasiNewtonLBFGS")
elastix::QuasiNewtonLBFGS::EventPassThroughType
itk::ReceptorMemberCommand< Self > EventPassThroughType
Definition elxQuasiNewtonLBFGS.h:130
elastix::QuasiNewtonLBFGS::m_SearchDirectionMagnitude
double m_SearchDirectionMagnitude
Definition elxQuasiNewtonLBFGS.h:193
elastix::QuasiNewtonLBFGS::LineOptimizerPointer
LineOptimizerType::Pointer LineOptimizerPointer
Definition elxQuasiNewtonLBFGS.h:129
elastix::QuasiNewtonLBFGS::LineOptimizerType
itk::MoreThuenteLineSearchOptimizer LineOptimizerType
Definition elxQuasiNewtonLBFGS.h:128
itk::MoreThuenteLineSearchOptimizer
ITK version of the MoreThuente line search algorithm.
Definition itkMoreThuenteLineSearchOptimizer.h:72
itk::MoreThuenteLineSearchOptimizer::Pointer
SmartPointer< Self > Pointer
Definition itkMoreThuenteLineSearchOptimizer.h:78
itk::QuasiNewtonLBFGSOptimizer
ITK version of the lbfgs algorithm ...
Definition itkQuasiNewtonLBFGSOptimizer.h:59
itk::QuasiNewtonLBFGSOptimizer::QuasiNewtonLBFGSOptimizer
QuasiNewtonLBFGSOptimizer()
itk::QuasiNewtonLBFGSOptimizer::ScalesType
NonLinearOptimizer::ScalesType ScalesType
Definition itkScaledSingleValuedNonLinearOptimizer.h:85
itk::QuasiNewtonLBFGSOptimizer::StopConditionType
StopConditionType
Definition itkQuasiNewtonLBFGSOptimizer.h:87
elxIncludes.h
itkMoreThuenteLineSearchOptimizer.h
itkQuasiNewtonLBFGSOptimizer.h
elastix
Definition elxDefaultConstruct.h:25

Generated on 1768596610 for elastix by 1.15.0 |