ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkGradientDescentOptimizerv4.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 __itkGradientDescentOptimizerv4_h
19 #define __itkGradientDescentOptimizerv4_h
20 
24 
25 namespace itk
26 {
85 {
86 public:
92 
95 
97  itkNewMacro(Self);
98 
101 
105 
109 
111  itkSetMacro(LearningRate, InternalComputationValueType);
112 
114  itkGetConstReferenceMacro(LearningRate, InternalComputationValueType);
115 
122  itkSetMacro(MaximumStepSizeInPhysicalUnits, InternalComputationValueType);
123 
125  itkGetConstReferenceMacro(MaximumStepSizeInPhysicalUnits, InternalComputationValueType);
126 
136  itkSetObjectMacro(ScalesEstimator, OptimizerParameterScalesEstimator);
137 
142  itkSetMacro(DoEstimateScales, bool);
143  itkGetConstReferenceMacro(DoEstimateScales, bool);
144  itkBooleanMacro(DoEstimateScales);
146 
154  itkSetMacro(DoEstimateLearningRateAtEachIteration, bool);
155  itkGetConstReferenceMacro(DoEstimateLearningRateAtEachIteration, bool);
156  itkBooleanMacro(DoEstimateLearningRateAtEachIteration);
158 
166  itkSetMacro(DoEstimateLearningRateOnce, bool);
167  itkGetConstReferenceMacro(DoEstimateLearningRateOnce, bool);
168  itkBooleanMacro(DoEstimateLearningRateOnce);
170 
180  itkSetMacro(MinimumConvergenceValue, InternalComputationValueType);
181 
190  itkSetMacro(ConvergenceWindowSize, SizeValueType);
191 
193  itkGetConstReferenceMacro( ConvergenceValue, InternalComputationValueType );
194 
206  itkSetMacro(ReturnBestParametersAndValue, bool);
207  itkGetConstReferenceMacro(ReturnBestParametersAndValue, bool);
208  itkBooleanMacro(ReturnBestParametersAndValue);
210 
212  virtual void StartOptimization( bool doOnlyInitialization = false );
213 
214  virtual void StopOptimization(void);
215 
216  virtual void ResumeOptimization();
217 
219  virtual void EstimateLearningRate();
220 
221 protected:
222 
225  virtual void AdvanceOneStep(void);
226 
228  virtual void ModifyGradientByScalesOverSubRange( const IndexRangeType& subrange );
229  virtual void ModifyGradientByLearningRateOverSubRange( const IndexRangeType& subrange );
231 
236 
241 
244 
246  virtual ~GradientDescentOptimizerv4();
247 
248  virtual void PrintSelf( std::ostream & os, Indent indent ) const;
249 
251 
258 
264 
267 
270 
274 
277 
278 private:
283 
288 
293 
294  GradientDescentOptimizerv4( const Self & ); //purposely not implemented
295  void operator=( const Self& ); //purposely not implemented
296 };
297 
298 } // end namespace itk
299 
300 #endif
301