[Insight-users] regular step gradient descent optimizer - getvalueand derivative not used

Tom Vercauteren tom.vercauteren at gmail.com
Fri Jan 7 13:14:21 EST 2005


Hi all,

While going through the code of an optimization routine I realized
that the regular step gradient descent optimizer uses the following
code (in itkRegularStepGradientDescentBaseOptimizer.txx):
/////////////////////
ParametersType currentPosition = this->GetCurrentPosition();
m_Value = m_CostFunction->GetValue( currentPosition );

if( m_Stop )
  {
  break;
  }

m_PreviousGradient = m_Gradient;
m_CostFunction->GetDerivative( currentPosition, m_Gradient );

if( m_Stop )
  {
  break;
  }
//////////////////
I am not sure to get it right but I thought it would be better to use
m_CostFunction->GetValueAndDerivative(...) because GetValue and
GetDerivative often share similar code.
Am I missing something here?

Thanks for your answers,
Tom


More information about the Insight-users mailing list