ObjectiveFunction#

class ObjectiveFunction(X, y, neural_network, loss)[ソース]#

ベースクラス: object

An abstract objective function. Provides methods for computing objective value and gradients for forward and backward passes.

パラメータ:
  • X (ndarray) – The input data.

  • y (ndarray) – The target values.

  • neural_network (NeuralNetwork) – An instance of an quantum neural network to be used by this objective function.

  • loss (Loss) – A target loss function to be used in training.

Methods

abstract gradient(weights)[ソース]#

Computes gradients of this objective function given weights.

パラメータ:

weights (ndarray) – an array of weights to be used in the objective function.

戻り値:

Gradients of the function.

戻り値の型:

ndarray

abstract objective(weights)[ソース]#

Computes the value of this objective function given weights.

パラメータ:

weights (ndarray) – an array of weights to be used in the objective function.

戻り値:

Value of the function.

戻り値の型:

float