go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkGradientDescentOptimizer2.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright UMC Utrecht and contributors
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 * http://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 itkGradientDescentOptimizer2_h
19#define itkGradientDescentOptimizer2_h
20
22
23
24namespace itk
25{
26
55{
56public:
58
62 using Pointer = SmartPointer<Self>;
63 using ConstPointer = SmartPointer<const Self>;
64
66 itkNewMacro(Self);
67
70
72 using Superclass::MeasureType;
73 using Superclass::ParametersType;
74 using Superclass::DerivativeType;
75 using Superclass::CostFunctionType;
79
84 {
88 };
89
91 virtual void
93
95 void
97
100 virtual void
102
104 virtual void
105 MetricErrorResponse(ExceptionObject & err);
106
109 virtual void
111
113 itkSetMacro(LearningRate, double);
114
116 itkGetConstReferenceMacro(LearningRate, double);
117
119 itkSetMacro(NumberOfIterations, unsigned long);
120
122 itkGetConstReferenceMacro(NumberOfIterations, unsigned long);
123
125 itkGetConstMacro(CurrentIteration, unsigned int);
126
128 itkGetConstReferenceMacro(Value, double);
129
131 itkGetConstReferenceMacro(StopCondition, StopConditionType);
132
134 itkGetConstReferenceMacro(Gradient, DerivativeType);
135
137 itkGetConstReferenceMacro(SearchDirection, DerivativeType);
138
140 itkSetMacro(UseOpenMP, bool);
141
142protected:
144 ~GradientDescentOptimizer2() override = default;
145 void
146 PrintSelf(std::ostream & os, Indent indent) const override;
147
148 // made protected so subclass can access
149 DerivativeType m_Gradient;
150 DerivativeType m_SearchDirection;
152
153private:
154 double m_Value{ 0.0 };
155 double m_LearningRate{ 1.0 };
156 bool m_Stop{ false };
157 unsigned long m_NumberOfIterations{ 100 };
158 unsigned long m_CurrentIteration{ 0 };
159
161};
162
163} // end namespace itk
164
165#endif
Implement a gradient descent optimizer.
ITK_DISALLOW_COPY_AND_MOVE(GradientDescentOptimizer2)
void PrintSelf(std::ostream &os, Indent indent) const override
virtual void MetricErrorResponse(ExceptionObject &err)
void StartOptimization() override
~GradientDescentOptimizer2() override=default
A cost function that applies a scaling to another cost function.


Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo