Skip to content

API: Loss #2

@jonas-eschle

Description

@jonas-eschle

Discusson to find the optimal loss (objective, cost function) API for likelihood(-like) minimization.

Questions

Simultaneous losses

A simultaneous fit adds multiple likelihoods. How should they be combined?

  • two kinds of losses: a simple one and a simultaneous; the latter stores multiple simple ones, if two simultaneous are combined, a new simultaneous, flattened is returned.

  • one kind of loss: simple ones that can have multiple data and models. Disadvantage: how to combine different losses that are not of the same kind? Is there a real usecase for this? E.g. extended and non-extended NLL?

API

initialization

  • model with pdf (or similar) attribute or callable
  • data that can be given to model
  • constraints (or similar)

value()

A method that calculates the value of the loss. Maybe can take the parameter values (therefore also a method, not an attribute).

value_and_gradient()

Calculate the value and the gradients, can be not implemented.

get_params()

An option to get all possible tunable parameters. Can be useful but maybe too specific?

errordef

Definition of the 1 sigma error. Should this be a method that takes nsigma as argument?

data

An attribute to access the input data that was used (single or multiple)

model

An attribute to access the model that was used (single or multiple)

constraints

Or other name? Additional terms added to the likelihood function that do not fit the "data and model" scheme, such as boundary penalization or gaussian constraints with auxiliary measurements of single parameters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    API discussionDefinition of API and discussion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions