[Insight-users] RegularStepGradientDescentBaseOptimizer
Bing Jian
bjian at cise . ufl . edu
Tue, 11 Nov 2003 23:14:15 -0500 (EST)
--
Best wishes,
Bing Jian
bjian at cise . ufl . edu
On Tue, 11 Nov 2003, Luis Ibanez wrote:
> 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
I got it. It's declared as
itkGetConstReferenceMacro( Scales, ScalesType );
I only searched GetScales(). Forgot the macro. My bad.
>
>
> 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).
>
Do you mean it's registation's responsibility to set the
scaling array of optimizer? How to do it? maybe I missed some
statement in example programs.
Thanks!
> 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!
> >
>
>
>
>
>