pyttb.gcp.fg

Evaluate Function And Gradient Handles.

pyttb.gcp.fg.evaluate(model: pyttb.ktensor.ktensor, data: pyttb.tensor.tensor | pyttb.sptensor.sptensor, weights: numpy.ndarray | None, function_handle: Literal[None], gradient_handle: function_type) list[numpy.ndarray][source]
pyttb.gcp.fg.evaluate(model: pyttb.ktensor.ktensor, data: pyttb.tensor.tensor | pyttb.sptensor.sptensor, weights: numpy.ndarray | None, function_handle: function_type, gradient_handle: Literal[None]) float
pyttb.gcp.fg.evaluate(model: pyttb.ktensor.ktensor, data: pyttb.tensor.tensor | pyttb.sptensor.sptensor, weights: numpy.ndarray | None, function_handle: function_type, gradient_handle: function_type) tuple[float, list[numpy.ndarray]]
pyttb.gcp.fg.evaluate(model: ttb.ktensor, data: ttb.tensor | ttb.sptensor, weights: np.ndarray | None = None, function_handle: function_type | None = None, gradient_handle: function_type | None = None) float | list[np.ndarray] | tuple[float, list[np.ndarray]]

Evaluate an objective function and/or gradient function.

Parameters:
  • model – Current decomposition.

  • data – Source tensor to decompose.

  • weights – Weighted values for returned tensor. Can be used as a mask.

  • function_handle – Objective function.

  • gradient_handle – Gradient definition.

Returns:

Objective function value and/or gradient function value with respect to model.