cratepy.optimization.optimizationfunction.Loss

class Loss[source]

Bases: ABC

Loss function interface.

loss(self, y, y_ref, type='minimization')[source]

abstract: Loss function.

Constructor.

List of Public Methods

loss

Loss function.

Methods

abstract __init__()[source]

Constructor.

abstract loss(y, y_ref, type='minimization')[source]

Loss function.

Parameters:
  • y (tuple[float]) – Values of parametric solution.

  • y_ref (tuple[float]) – Values of reference solution.

  • type ({'minimization', 'maximization'}, default='minimization') – Type of optimization problem. The option ‘maximization’ negates the loss function evaluation.

Returns:

loss – Loss function value.

Return type:

float