ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkGradientDescentOptimizerv4.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 itkGradientDescentOptimizerv4_h
19#define itkGradientDescentOptimizerv4_h
20
22
23namespace itk
24{
77template <typename TInternalComputationValueType>
78class ITK_TEMPLATE_EXPORT GradientDescentOptimizerv4Template
79 : public GradientDescentOptimizerBasev4Template<TInternalComputationValueType>
80{
81public:
82 ITK_DISALLOW_COPY_AND_MOVE(GradientDescentOptimizerv4Template);
83
89
91 itkOverrideGetNameOfClassMacro(GradientDescentOptimizerv4Template);
92
94 itkNewMacro(Self);
95
96
98 using InternalComputationValueType = TInternalComputationValueType;
99
101 using typename Superclass::DerivativeType;
102
104 using typename Superclass::MeasureType;
105 using typename Superclass::IndexRangeType;
106 using typename Superclass::ScalesType;
107 using typename Superclass::ParametersType;
108
114 itkSetMacro(LearningRate, TInternalComputationValueType);
115 itkGetConstReferenceMacro(LearningRate, TInternalComputationValueType);
124 itkSetMacro(MaximumStepSizeInPhysicalUnits, TInternalComputationValueType);
125 itkGetConstReferenceMacro(MaximumStepSizeInPhysicalUnits, TInternalComputationValueType);
135 itkSetMacro(DoEstimateLearningRateAtEachIteration, bool);
136 itkGetConstReferenceMacro(DoEstimateLearningRateAtEachIteration, bool);
137 itkBooleanMacro(DoEstimateLearningRateAtEachIteration);
147 itkSetMacro(DoEstimateLearningRateOnce, bool);
148 itkGetConstReferenceMacro(DoEstimateLearningRateOnce, bool);
149 itkBooleanMacro(DoEstimateLearningRateOnce);
160 itkSetMacro(MinimumConvergenceValue, TInternalComputationValueType);
161
170 itkSetMacro(ConvergenceWindowSize, SizeValueType);
171
175 itkGetConstReferenceMacro(ConvergenceValue, TInternalComputationValueType);
176
189 itkSetMacro(ReturnBestParametersAndValue, bool);
190 itkGetConstReferenceMacro(ReturnBestParametersAndValue, bool);
191 itkBooleanMacro(ReturnBestParametersAndValue);
194 void
195 StartOptimization(bool doOnlyInitialization = false) override;
196
198 void
200
202 void
204
206 virtual void
208
209protected:
212 virtual void
214
216 void
218
220 void
222
225
228
229 void
230 PrintSelf(std::ostream & os, Indent indent) const override;
231
232
233 TInternalComputationValueType m_LearningRate{};
234 TInternalComputationValueType m_MinimumConvergenceValue{};
235 TInternalComputationValueType m_ConvergenceValue{};
236
240
242
249
250private:
251};
252
255
256} // end namespace itk
257
258#ifndef ITK_MANUAL_INSTANTIATION
259# include "itkGradientDescentOptimizerv4.hxx"
260#endif
261
262#endif
OptimizerParameters< TInternalComputationValueType > ParametersType
ThreadedIndexedContainerPartitioner::IndexRangeType IndexRangeType
OptimizerParameters< TInternalComputationValueType > ScalesType
typename MetricType::MeasureType MeasureType
OptimizerParameters< double > ParametersType
GradientDescentOptimizerBasev4Template< TInternalComputationValueType > Superclass
void StartOptimization(bool doOnlyInitialization=false) override
ThreadedIndexedContainerPartitioner::IndexRangeType IndexRangeType
void ModifyGradientByLearningRateOverSubRange(const IndexRangeType &subrange) override
void ModifyGradientByScalesOverSubRange(const IndexRangeType &subrange) override
void PrintSelf(std::ostream &os, Indent indent) const override
typename MetricType::DerivativeType DerivativeType
~GradientDescentOptimizerv4Template() override=default
TInternalComputationValueType InternalComputationValueType
Control indentation during Print() invocation.
Definition itkIndent.h:50
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
Definition itkIntTypes.h:86
GradientDescentOptimizerv4Template< double > GradientDescentOptimizerv4