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
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
139protected:
141 ~GradientDescentOptimizer2() override = default;
142 void
143 PrintSelf(std::ostream & os, Indent indent) const override;
144
145 // made protected so subclass can access
146 DerivativeType m_Gradient{};
147 DerivativeType m_SearchDirection{};
149
150private:
151 double m_Value{ 0.0 };
152 double m_LearningRate{ 1.0 };
153 bool m_Stop{ false };
154 unsigned long m_NumberOfIterations{ 100 };
155 unsigned long m_CurrentIteration{ 0 };
156};
157
158} // end namespace itk
159
160#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 2024-07-17 for elastix by doxygen 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) elastix logo