ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkQuasiNewtonOptimizerv4.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 itkQuasiNewtonOptimizerv4_h
19#define itkQuasiNewtonOptimizerv4_h
20
21#include "itkArray2D.h"
22#include "itkBooleanStdVector.h"
24
25#include "itkMathSVD.h"
26#if !defined(ITK_LEGACY_REMOVE) && !defined(ITK_FUTURE_LEGACY_REMOVE)
27# include "vnl/algo/vnl_matrix_inverse.h" // transitional transitive include; dropped on ITK legacy removal
28#endif
29#include "itkMathDeterminant.h"
30
31namespace itk
32{
63template <typename TInternalComputationValueType>
64class ITK_TEMPLATE_EXPORT QuasiNewtonOptimizerv4Template
65 : public GradientDescentOptimizerv4Template<TInternalComputationValueType>
66{
67public:
68 ITK_DISALLOW_COPY_AND_MOVE(QuasiNewtonOptimizerv4Template);
69
75
77 itkNewMacro(Self);
78
80 itkOverrideGetNameOfClassMacro(QuasiNewtonOptimizerv4Template);
81
83 using InternalComputationValueType = TInternalComputationValueType;
84
85 using typename Superclass::ParametersType;
86 using typename Superclass::MeasureType;
87 using typename Superclass::DerivativeType;
88 using typename Superclass::IndexRangeType;
89
92
94 using HessianArrayType = std::vector<HessianType>;
95
97 void
98 StartOptimization(bool doOnlyInitialization = false) override;
99
101 itkSetMacro(MaximumIterationsWithoutProgress, SizeValueType);
102
117 itkSetMacro(MaximumNewtonStepSizeInPhysicalUnits, TInternalComputationValueType);
118
120 itkGetConstReferenceMacro(NewtonStep, DerivativeType);
121
126 virtual void
128
129protected:
132
136
140
145
148
150 std::string m_NewtonStepWarning{};
151
153 TInternalComputationValueType m_MaximumNewtonStepSizeInPhysicalUnits{};
154
157
161
163 virtual void
165
170 virtual bool
172
174 virtual void
176
181 void
183
192 void
194
199 void
200 AdvanceOneStep() override;
201
204
205 void
206 PrintSelf(std::ostream & os, Indent indent) const override;
207
208private:
211};
212
215
216} // end namespace itk
217
218#ifndef ITK_MANUAL_INSTANTIATION
219# include "itkQuasiNewtonOptimizerv4.hxx"
220#endif
221
222#endif
Array2D class representing a 2D array.
Definition itkArray2D.h:43
SmartPointer< Self > Pointer
OptimizerParameters< TInternalComputationValueType > ParametersType
ThreadedIndexedContainerPartitioner::IndexRangeType IndexRangeType
typename MetricType::DerivativeType DerivativeType
Control indentation during Print() invocation.
Definition itkIndent.h:51
Implement a Quasi-Newton optimizer with BFGS Hessian estimation.
virtual void EstimateNewtonStepOverSubRange(const IndexRangeType &subrange)
typename MetricType::MeasureType MeasureType
OptimizerParameters< double > ParametersType
~QuasiNewtonOptimizerv4Template() override=default
void StartOptimization(bool doOnlyInitialization=false) override
virtual void ResetNewtonStep(IndexValueType loc)
ThreadedIndexedContainerPartitioner::IndexRangeType IndexRangeType
DomainThreader< ThreadedIndexedContainerPartitioner, Self >::Pointer m_EstimateNewtonStepThreader
virtual bool ComputeHessianAndStepWithBFGS(IndexValueType loc)
void PrintSelf(std::ostream &os, Indent indent) const override
GradientDescentOptimizerv4Template< TInternalComputationValueType > Superclass
itk::Array2D< TInternalComputationValueType > HessianType
typename MetricType::DerivativeType DerivativeType
TInternalComputationValueType InternalComputationValueType
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
Definition itkIntTypes.h:86
std::vector< Boolean > BooleanStdVectorType
long IndexValueType
Definition itkIntTypes.h:93
QuasiNewtonOptimizerv4Template< double > QuasiNewtonOptimizerv4