go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkFiniteDifferenceGradientDescentOptimizer.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
19#ifndef itkFiniteDifferenceGradientDescentOptimizer_h
20#define itkFiniteDifferenceGradientDescentOptimizer_h
21
23
24namespace itk
25{
26
56{
57public:
59
63 using Pointer = SmartPointer<Self>;
64 using ConstPointer = SmartPointer<const Self>;
65
67 itkNewMacro(Self);
68
71
74 {
77 };
78
80 virtual void
82
84 void
86
89 void
91
94 void
96
98 itkSetMacro(NumberOfIterations, unsigned long);
99
101 itkGetConstMacro(NumberOfIterations, unsigned long);
102
104 itkGetConstMacro(CurrentIteration, unsigned long);
105
107 itkGetConstMacro(Value, double);
108
110 itkGetConstMacro(StopCondition, StopConditionType);
111
113 itkSetMacro(Param_a, double);
114 itkGetConstMacro(Param_a, double);
115
117 itkSetMacro(Param_c, double);
118 itkGetConstMacro(Param_c, double);
119
121 itkSetMacro(Param_A, double);
122 itkGetConstMacro(Param_A, double);
123
125 itkSetMacro(Param_alpha, double);
126 itkGetConstMacro(Param_alpha, double);
127
129 itkSetMacro(Param_gamma, double);
130 itkGetConstMacro(Param_gamma, double);
131
132 itkGetConstMacro(ComputeCurrentValue, bool);
133 itkSetMacro(ComputeCurrentValue, bool);
134 itkBooleanMacro(ComputeCurrentValue);
135
137 itkGetConstMacro(GradientMagnitude, double);
138 itkGetConstMacro(LearningRate, double);
139
140protected:
143
145 void
146 PrintSelf(std::ostream & os, Indent indent) const override;
147
148 // made protected so subclass can access
149 DerivativeType m_Gradient;
150 double m_LearningRate{ 0.0 };
151 double m_GradientMagnitude{ 0.0 };
152
159
160 // Functions to compute the parameters at iteration k.
161 virtual double
162 Compute_a(unsigned long k) const;
163
164 virtual double
165 Compute_c(unsigned long k) const;
166
167private:
169 bool m_Stop{ false };
170 double m_Value{ 0.0 };
172 unsigned long m_NumberOfIterations{ 100 };
173 unsigned long m_CurrentIteration{ 0 };
174
176 double m_Param_a{ 1.0 };
177 double m_Param_c{ 1.0 };
178 double m_Param_A{ 1.0 };
179 double m_Param_alpha{ 0.602 };
180 double m_Param_gamma{ 0.101 };
181};
182
183} // end namespace itk
184
185#endif // end #ifndef itkFiniteDifferenceGradientDescentOptimizer_h
ITK_DISALLOW_COPY_AND_MOVE(FiniteDifferenceGradientDescentOptimizer)
virtual double Compute_a(unsigned long k) const
void PrintSelf(std::ostream &os, Indent indent) const override
~FiniteDifferenceGradientDescentOptimizer() override=default
virtual double Compute_c(unsigned long k) const


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