ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkRegularStepGradientDescentOptimizerv4.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 __itkRegularStepGradientDescentOptimizerv4_h
19 #define __itkRegularStepGradientDescentOptimizerv4_h
20 
23 
24 namespace itk
25 {
45 template<typename TInternalComputationValueType>
47 : public GradientDescentOptimizerv4Template<TInternalComputationValueType>
48 {
49 public:
55 
58 
60  itkNewMacro(Self);
61 
62 
64  typedef TInternalComputationValueType InternalComputationValueType;
65 
68 
75 
78 
88  itkSetMacro(MinimumStepLength, TInternalComputationValueType);
89  itkGetConstReferenceMacro(MinimumStepLength, TInternalComputationValueType);
91 
93  itkSetMacro(RelaxationFactor, TInternalComputationValueType);
94  itkGetConstReferenceMacro(RelaxationFactor, TInternalComputationValueType);
96 
98  itkSetMacro(GradientMagnitudeTolerance, TInternalComputationValueType);
99  itkGetConstReferenceMacro(GradientMagnitudeTolerance, TInternalComputationValueType);
101 
103  virtual void StartOptimization( bool doOnlyInitialization = false ) ITK_OVERRIDE;
104 
106  virtual void EstimateLearningRate();
107 
108 protected:
109 
112  virtual void AdvanceOneStep(void) ITK_OVERRIDE;
113 
115  virtual void ModifyGradientByScalesOverSubRange( const IndexRangeType& subrange ) ITK_OVERRIDE;
116  virtual void ModifyGradientByLearningRateOverSubRange( const IndexRangeType& subrange ) ITK_OVERRIDE;
118 
124  TInternalComputationValueType m_RelaxationFactor;
125 
128 
131 
132  virtual void PrintSelf( std::ostream & os, Indent indent ) const;
133 
135  TInternalComputationValueType m_MinimumStepLength;
136 
138  TInternalComputationValueType m_GradientMagnitudeTolerance;
139 
142 
143 private:
144  RegularStepGradientDescentOptimizerv4( const Self & ); //purposely not implemented
145  void operator=( const Self& ); //purposely not implemented
146 };
147 
148 } // end namespace itk
149 
150 #ifndef ITK_MANUAL_INSTANTIATION
151 #include "itkRegularStepGradientDescentOptimizerv4.hxx"
152 #endif
153 
154 #endif
Light weight base class for most itk classes.
virtual void PrintSelf(std::ostream &os, Indent indent) const
GradientDescentOptimizerv4Template< TInternalComputationValueType > Superclass
virtual void AdvanceOneStep(void) ITK_OVERRIDE
Perform more precise accumulation of floating point numbers.
virtual void StartOptimization(bool doOnlyInitialization=false) ITK_OVERRIDE
CompensatedSummation< InternalComputationValueType > CompensatedSummationType
virtual void ModifyGradientByLearningRateOverSubRange(const IndexRangeType &subrange) ITK_OVERRIDE
Control indentation during Print() invocation.
Definition: itkIndent.h:49
ThreadedIndexedContainerPartitioner::IndexRangeType IndexRangeType
virtual void ModifyGradientByScalesOverSubRange(const IndexRangeType &subrange) ITK_OVERRIDE