ITK  5.2.0
Insight Toolkit
itkGradientDescentLineSearchOptimizerv4.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkGradientDescentLineSearchOptimizerv4_h
19 #define itkGradientDescentLineSearchOptimizerv4_h
20 
24 
25 namespace itk
26 {
59 template <typename TInternalComputationValueType>
61  : public GradientDescentOptimizerv4Template<TInternalComputationValueType>
62 {
63 public:
64  ITK_DISALLOW_COPY_AND_MOVE(GradientDescentLineSearchOptimizerv4Template);
66 
72 
75 
77  itkNewMacro(Self);
78 
80  using InternalComputationValueType = TInternalComputationValueType;
81 
83  using DerivativeType = typename Superclass::DerivativeType;
84 
86  using MeasureType = typename Superclass::MeasureType;
87  using ParametersType = typename Superclass::ParametersType;
88 
91 
95  itkSetMacro(Epsilon, TInternalComputationValueType);
96  itkGetMacro(Epsilon, TInternalComputationValueType);
98 
108  itkSetMacro(LowerLimit, TInternalComputationValueType);
109  itkGetMacro(LowerLimit, TInternalComputationValueType);
110  itkSetMacro(UpperLimit, TInternalComputationValueType);
111  itkGetMacro(UpperLimit, TInternalComputationValueType);
112  itkSetMacro(MaximumLineSearchIterations, unsigned int);
113  itkGetMacro(MaximumLineSearchIterations, unsigned int);
115 
116 protected:
119  void
120  AdvanceOneStep() override;
121 
124 
126  ~GradientDescentLineSearchOptimizerv4Template() override = default;
127 
128  void
129  PrintSelf(std::ostream & os, Indent indent) const override;
130 
131  TInternalComputationValueType
132  GoldenSectionSearch(TInternalComputationValueType a,
133  TInternalComputationValueType b,
134  TInternalComputationValueType c,
135  TInternalComputationValueType metricb = NumericTraits<TInternalComputationValueType>::max());
136 
137  TInternalComputationValueType m_LowerLimit;
138  TInternalComputationValueType m_UpperLimit;
139  TInternalComputationValueType m_Phi;
140  TInternalComputationValueType m_Resphi;
141  TInternalComputationValueType m_Epsilon;
142 
145 
148 };
149 
152 
153 } // end namespace itk
154 
155 #ifndef ITK_MANUAL_INSTANTIATION
156 # include "itkGradientDescentLineSearchOptimizerv4.hxx"
157 #endif
158 
159 #endif
itk::GradientDescentLineSearchOptimizerv4Template::DerivativeType
typename Superclass::DerivativeType DerivativeType
Definition: itkGradientDescentLineSearchOptimizerv4.h:83
itk::GradientDescentOptimizerv4Template
Gradient descent optimizer.
Definition: itkGradientDescentOptimizerv4.h:78
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itkWindowConvergenceMonitoringFunction.h
itk::GradientDescentLineSearchOptimizerv4Template::m_LineSearchIterations
unsigned int m_LineSearchIterations
Definition: itkGradientDescentLineSearchOptimizerv4.h:147
itk::GradientDescentLineSearchOptimizerv4Template::InternalComputationValueType
TInternalComputationValueType InternalComputationValueType
Definition: itkGradientDescentLineSearchOptimizerv4.h:80
itk::GradientDescentLineSearchOptimizerv4Template::ParametersType
typename Superclass::ParametersType ParametersType
Definition: itkGradientDescentLineSearchOptimizerv4.h:87
itk::GradientDescentLineSearchOptimizerv4Template::m_Phi
TInternalComputationValueType m_Phi
Definition: itkGradientDescentLineSearchOptimizerv4.h:139
itkOptimizerParameterScalesEstimator.h
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::GradientDescentLineSearchOptimizerv4Template::MeasureType
typename Superclass::MeasureType MeasureType
Definition: itkGradientDescentLineSearchOptimizerv4.h:86
itk::GradientDescentLineSearchOptimizerv4Template::m_UpperLimit
TInternalComputationValueType m_UpperLimit
Definition: itkGradientDescentLineSearchOptimizerv4.h:138
itkGradientDescentOptimizerv4.h
itk::Function::WindowConvergenceMonitoringFunction
Class which monitors convergence during the course of optimization.
Definition: itkWindowConvergenceMonitoringFunction.h:39
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:58
itk::GradientDescentLineSearchOptimizerv4Template::m_Resphi
TInternalComputationValueType m_Resphi
Definition: itkGradientDescentLineSearchOptimizerv4.h:140
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::GradientDescentLineSearchOptimizerv4Template::m_MaximumLineSearchIterations
unsigned int m_MaximumLineSearchIterations
Definition: itkGradientDescentLineSearchOptimizerv4.h:144
itk::GradientDescentLineSearchOptimizerv4Template::m_LowerLimit
TInternalComputationValueType m_LowerLimit
Definition: itkGradientDescentLineSearchOptimizerv4.h:137
itk::GradientDescentLineSearchOptimizerv4Template::m_Epsilon
TInternalComputationValueType m_Epsilon
Definition: itkGradientDescentLineSearchOptimizerv4.h:141
itk::GradientDescentLineSearchOptimizerv4Template
Gradient descent optimizer with a golden section line search.
Definition: itkGradientDescentLineSearchOptimizerv4.h:60