mm.math.value_and_gradients

math.value_and_gradients(parameters)

The loss and gradients of the given cost function.

Parameters:
  • cost_fn (callable) – cost function to compute the loss and gradients of

  • parameters (dict) – parameters to compute the loss and gradients of

Returns:

loss and gradients (dict) of the given cost function

Return type:

tuple