How to do Ascent with RegularStepGradientDescentOptimizerv4

The RegularStepGradientDescentOptimizer had member functions to set Maximize or Minimize mode, how this can be made with RegularStepGradientDescentOptimizerv4?

I’m thinking about changing my metric function in the UpdateParameters to subtract instead of adding the update parameters but it may not be the right way. I’m using itkGradientDescentOptimizerv4Test.cxx as a base for me right now.

Thanks!

Hello @vnpavanelli,

The ITK v4 registration framework removed this functionality (~10 years ago). All metrics are minimized, so any metric you want to add/use needs to be set up so that the minimal value is the optimum (i.e. negate the metric if the optimal value is a maximum).

1 Like

Thanks @zivy,

I got it working now! Was also missing the factor variable in the metric::UpdateTransformParameters :slight_smile: