ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkGradientDescentOptimizerBasev4.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 itkGradientDescentOptimizerBasev4_h
19#define itkGradientDescentOptimizerBasev4_h
20
24#include "itkDomainThreader.h"
25
26namespace itk
27{
39template <typename TInternalComputationValueType>
41 : public ObjectToObjectOptimizerBaseTemplate<TInternalComputationValueType>
42{
43public:
44 ITK_DISALLOW_COPY_AND_MOVE(GradientDescentOptimizerBasev4Template);
45
51
53 itkOverrideGetNameOfClassMacro(GradientDescentOptimizerBasev4Template);
54
55#if !defined(ITK_LEGACY_REMOVE)
57 static constexpr itk::StopConditionObjectToObjectOptimizerEnum MAXIMUM_NUMBER_OF_ITERATIONS =
58 itk::StopConditionObjectToObjectOptimizerEnum::MAXIMUM_NUMBER_OF_ITERATIONS;
59 static constexpr itk::StopConditionObjectToObjectOptimizerEnum COSTFUNCTION_ERROR =
60 itk::StopConditionObjectToObjectOptimizerEnum::COSTFUNCTION_ERROR;
61 static constexpr itk::StopConditionObjectToObjectOptimizerEnum UPDATE_PARAMETERS_ERROR =
62 itk::StopConditionObjectToObjectOptimizerEnum::UPDATE_PARAMETERS_ERROR;
63 static constexpr itk::StopConditionObjectToObjectOptimizerEnum STEP_TOO_SMALL =
64 itk::StopConditionObjectToObjectOptimizerEnum::STEP_TOO_SMALL;
65 static constexpr itk::StopConditionObjectToObjectOptimizerEnum CONVERGENCE_CHECKER_PASSED =
66 itk::StopConditionObjectToObjectOptimizerEnum::CONVERGENCE_CHECKER_PASSED;
67 static constexpr itk::StopConditionObjectToObjectOptimizerEnum GRADIENT_MAGNITUDE_TOLEARANCE =
68 itk::StopConditionObjectToObjectOptimizerEnum::GRADIENT_MAGNITUDE_TOLEARANCE;
69 static constexpr itk::StopConditionObjectToObjectOptimizerEnum OTHER_ERROR =
70 itk::StopConditionObjectToObjectOptimizerEnum::OTHER_ERROR;
71#endif
72
75
78
80 using InternalComputationValueType = TInternalComputationValueType;
81
83 using typename Superclass::MetricType;
87 using typename Superclass::DerivativeType;
88
90 using typename Superclass::MeasureType;
91
92 using typename Superclass::ScalesType;
93
94 using typename Superclass::ParametersType;
95
98
100 itkGetConstReferenceMacro(Gradient, DerivativeType);
101
104
106 void
107 StartOptimization(bool doOnlyInitialization = false) override;
108
112 virtual void
114
117 virtual void
119
123
136 virtual void
138 virtual void
141
143
149 virtual void
151
160 virtual void
162
163protected:
168
173
178
185 TInternalComputationValueType m_MaximumStepSizeInPhysicalUnits{};
186
192
198
201
204
205 /* Common variables for optimization control and reporting */
206 bool m_Stop{ false };
209
212 void
213 PrintSelf(std::ostream & os, Indent indent) const override;
214
215private:
216};
217
220
221} // end namespace itk
222
223#ifndef ITK_MANUAL_INSTANTIATION
224# include "itkGradientDescentOptimizerBasev4.hxx"
225#endif
226
227#endif
SmartPointer< Self > Pointer
Class which monitors convergence during the course of optimization.
virtual void ModifyGradientByScalesOverSubRange(const IndexRangeType &subrange)=0
DomainThreader< ThreadedIndexedContainerPartitioner, Self >::Pointer m_ModifyGradientByLearningRateThreader
virtual void ModifyGradientByLearningRateOverSubRange(const IndexRangeType &subrange)=0
void StartOptimization(bool doOnlyInitialization=false) override
ThreadedIndexedContainerPartitioner::IndexRangeType IndexRangeType
ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType > Superclass
~GradientDescentOptimizerBasev4Template() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
typename MetricType::DerivativeType DerivativeType
itk::Function::WindowConvergenceMonitoringFunction< TInternalComputationValueType > ConvergenceMonitoringType
DomainThreader< ThreadedIndexedContainerPartitioner, Self >::Pointer m_ModifyGradientByScalesThreader
StopConditionReturnStringType GetStopConditionDescription() const override
typename MetricType::MeasureType MeasureType
OptimizerParameters< double > ParametersType
typename MetricType::DerivativeType DerivativeType
Control indentation during Print() invocation.
Definition itkIndent.h:50
ObjectToObjectMetricBaseTemplate< TInternalComputationValueType > MetricType
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
ObjectToObjectOptimizerBaseTemplateEnums::StopConditionObjectToObjectOptimizer StopConditionObjectToObjectOptimizerEnum
unsigned long SizeValueType
Definition itkIntTypes.h:86
GradientDescentOptimizerBasev4Template< double > GradientDescentOptimizerBasev4