Skip to content

MIGRAD can call G2 even if HasG2 is set to false #20913

@AdrianDBS

Description

@AdrianDBS

Check duplicate issues.

  • Checked for duplicates

Description

Minuit2's gradient-based minimizers are occasionally calling the hessian diagonal method G2 of a cost function even if the HasG2 property is set to false.
In other words, HasG2may just be ignored, at least during minimizer seeding.

See #20665

Reproducer

Example:

  1. Create a FCNBase subclass for the Rosenbrock problem:
function = Pow(1 - x, 2) + 100*Pow(-Pow(x, 2) + y, 2);

gradient[x] = 400*x*(Pow(x, 2) - y) + 2*x - 2;
gradient[y] = -200*Pow(x, 2) + 200*y;

hessian[x, x] = 1200*Pow(x, 2) - 400*y + 2;
hessian[x, y] = -400*x;
hessian[y, x] = -400*x;
hessian[y, y] = 200;

which

  • returns true for HasGradient and HasHessian
  • returns the above-mentioned values for the cost function value, gradient and hessian
  • returns false for HasG2
  • throws an exception when G2 is called (or passively monitors a call to it)
  1. Minimize that problem for the initial values (x=0, y=1) using MnMigrad
  2. See G2 getting called although it shouldn't (at least to my mind)

ROOT version

ROOT v6.36.06

Installation method

Build from source

Operating system

Windows

Additional context

No response

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions