ITK  6.0.0
Insight Toolkit
itkRegularStepGradientDescentOptimizerv4.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 itkRegularStepGradientDescentOptimizerv4_h
19#define itkRegularStepGradientDescentOptimizerv4_h
20
23
24namespace itk
25{
46template <typename TInternalComputationValueType = double>
48 : public GradientDescentOptimizerv4Template<TInternalComputationValueType>
49{
50public:
51 ITK_DISALLOW_COPY_AND_MOVE(RegularStepGradientDescentOptimizerv4);
52
58
60 itkOverrideGetNameOfClassMacro(RegularStepGradientDescentOptimizerv4);
61
63 itkNewMacro(Self);
64
65
67 using InternalComputationValueType = TInternalComputationValueType;
68
70 using typename Superclass::DerivativeType;
71
73 using typename Superclass::MeasureType;
74 using typename Superclass::IndexRangeType;
75 using typename Superclass::ScalesType;
76 using typename Superclass::ParametersType;
77
80
90 itkSetMacro(MinimumStepLength, TInternalComputationValueType);
91 itkGetConstReferenceMacro(MinimumStepLength, TInternalComputationValueType);
95 itkSetMacro(RelaxationFactor, TInternalComputationValueType);
96 itkGetConstReferenceMacro(RelaxationFactor, TInternalComputationValueType);
100 itkSetMacro(GradientMagnitudeTolerance, TInternalComputationValueType);
101 itkGetConstReferenceMacro(GradientMagnitudeTolerance, TInternalComputationValueType);
105 itkSetMacro(CurrentLearningRateRelaxation, MeasureType);
106 itkGetConstReferenceMacro(CurrentLearningRateRelaxation, MeasureType);
110 void
111 StartOptimization(bool doOnlyInitialization = false) override;
112
114 void
116
118 double
120
121protected:
124 void
125 AdvanceOneStep() override;
126
128 void
130 void
137
140
141 void
142 PrintSelf(std::ostream & os, Indent indent) const override;
143
144
145private:
146 TInternalComputationValueType m_RelaxationFactor{};
147
148 TInternalComputationValueType m_MinimumStepLength{};
149
150 TInternalComputationValueType m_GradientMagnitudeTolerance{};
151
152 MeasureType m_CurrentLearningRateRelaxation{};
153};
154
155} // end namespace itk
156
157#ifndef ITK_MANUAL_INSTANTIATION
158# include "itkRegularStepGradientDescentOptimizerv4.hxx"
159#endif
160
161#endif
Perform more precise accumulation of floating point numbers.
ThreadedIndexedContainerPartitioner::IndexRangeType IndexRangeType
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
~RegularStepGradientDescentOptimizerv4() override=default
void ModifyGradientByScalesOverSubRange(const IndexRangeType &subrange) override
void ModifyGradientByLearningRateOverSubRange(const IndexRangeType &subrange) override
void StartOptimization(bool doOnlyInitialization=false) override
void PrintSelf(std::ostream &os, Indent indent) const override
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....