accelmo.fitting.results

What a fit returns.

class accelmo.fitting.results.FitDiagnostics(converged, reason, iterations, best_loss, gradient_norm=None, damping=None, accepted_evaluations=None)[source]

Bases: object

How the optimisation ended.

iterations counts epochs (tracking) or Levenberg-Marquardt iterations. gradient_norm, damping and accepted_evaluations describe the last LM update and are None for the tracking fit.

Parameters:
  • converged (bool)

  • reason (str | None)

  • iterations (int)

  • best_loss (float)

  • gradient_norm (float | None)

  • damping (float | None)

  • accepted_evaluations (int | None)

converged: bool
reason: str | None
iterations: int
best_loss: float
gradient_norm: float | None = None
damping: float | None = None
accepted_evaluations: int | None = None
class accelmo.fitting.results.UncertaintyInfo(hessian, seconds, note='')[source]

Bases: object

How the uncertainties of a fit were computed.

Parameters:
  • hessian (str)

  • seconds (float)

  • note (str)

hessian: str

the Hessian that was used.

Type:

"true" or "gauss_newton"

seconds: float

Wall time of the uncertainty stage.

note: str = ''

Why a requested Hessian was replaced, empty when it was not.

class accelmo.fitting.results.FitResult(knobs, uncertainties, diagnostics=None, extra=dict(), extra_uncertainties=dict(), uncertainty=None)[source]

Bases: object

Fitted knobs, their 1-sigma uncertainties (by knob name) and how the fit ended.

Parameters:
  • knobs (dict[str, float])

  • uncertainties (dict[str, float])

  • diagnostics (FitDiagnostics | None)

  • extra (dict[str, float])

  • extra_uncertainties (dict[str, float])

  • uncertainty (UncertaintyInfo | None)

knobs: dict[str, float]
uncertainties: dict[str, float]
diagnostics: FitDiagnostics | None = None
extra: dict[str, float]

Extra fitted parameters that are not model knobs (e.g. BPM and corrector gains).

extra_uncertainties: dict[str, float]

1-sigma uncertainties of extra, by the same names.

uncertainty: UncertaintyInfo | None = None

None when the uncertainties were not computed or the stage failed.