BinaryObjectiveFunction#

class BinaryObjectiveFunction(X, y, neural_network, loss)[स्रोत]#

आधार: ObjectiveFunction

An objective function for binary representation of the output. For instance, classes of -1 and +1.

मापदण्ड:
  • 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

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

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