[Insight-users] RegularStepGradientDescentBaseOptimizer
Luis Ibanez
luis . ibanez at kitware . com
Tue, 11 Nov 2003 22:59:20 -0500
Hi Bing,
The method GetScales() is defined in the Superclass.
Whenever you have doubts regarding the location of
methods in the superclasses, simply follow the
Doxygen page. For example, look at the UML class
diagram in:
http://www . itk . org/Insight/Doxygen/html/classitk_1_1RegularStepGradientDescentOptimizer . html
That will bring you rapidly to find the method GetScales()
implemented at the level of
http://www . itk . org/Insight/Doxygen/html/classitk_1_1Optimizer . html
2) In what circumstances did you find the value of the
scale[] components to be Null ?
That will break the behavior of the compiler....
You must set the scaling array before starting
the optimization (the registration for that matter).
Zero is not an acceptable value for the scaling
factors.
Regards,
Luis
=-----------------------------
Bing Jian wrote:
> Hi, Luis,
>
> In \Code\Numerics\itkRegularStepGradientDescentBase.cxx,
> You have following function:
>
> /**
> * Advance one Step following the gradient direction
> */
> void
> RegularStepGradientDescentBaseOptimizer
> ::AdvanceOneStep( void )
> {
> //...
> ScalesType scales = this->GetScales();
> for(unsigned int i = 0; i < spaceDimension; i++)
> {
> transformedGradient[i] = m_Gradient[i] / scales[i];
> previousTransformedGradient[i] =
> m_PreviousGradient[i] / scales[i];
> }
> //...
> }
>
> Regarding the code above, I have two questions:
> 1) where is the definition of GetScales()? I cannot find it.
> 2) In my debugging, I did find scales[i] == 0 at some points.
> I guess this case should be taken care of.
>
> Thanks!
>