ITK  6.0.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  * https://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);
72 
74  itkOverrideGetNameOfClassMacro(GradientDescentLineSearchOptimizerv4Template);
75 
77  itkNewMacro(Self);
78 
80  using InternalComputationValueType = TInternalComputationValueType;
81 
83  using typename Superclass::DerivativeType;
84 
86  using typename Superclass::MeasureType;
87  using typename Superclass::ParametersType;
88 
91 
95  itkSetMacro(Epsilon, TInternalComputationValueType);
96  itkGetMacro(Epsilon, TInternalComputationValueType);
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);
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 
139  TInternalComputationValueType
140  GoldenSectionSearch(TInternalComputationValueType a,
141  TInternalComputationValueType b,
142  TInternalComputationValueType c,
143  TInternalComputationValueType metricb = NumericTraits<TInternalComputationValueType>::max());
146  TInternalComputationValueType m_LowerLimit{};
147  TInternalComputationValueType m_UpperLimit{};
148  TInternalComputationValueType m_Phi{};
149  TInternalComputationValueType m_Resphi{};
150  TInternalComputationValueType m_Epsilon{};
151 
153  unsigned int m_MaximumLineSearchIterations{};
154 
156  unsigned int m_LineSearchIterations{};
157 };
158 
161 
162 } // end namespace itk
163 
164 #ifndef ITK_MANUAL_INSTANTIATION
165 # include "itkGradientDescentLineSearchOptimizerv4.hxx"
166 #endif
167 
168 #endif
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::InternalComputationValueType
TInternalComputationValueType InternalComputationValueType
Definition: itkGradientDescentLineSearchOptimizerv4.h:80
itkOptimizerParameterScalesEstimator.h
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
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:60
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::GradientDescentLineSearchOptimizerv4Template
Gradient descent optimizer with a golden section line search.
Definition: itkGradientDescentLineSearchOptimizerv4.h:60