OneHotObjectiveFunction#

class OneHotObjectiveFunction(X, y, neural_network, loss)[소스]#

기반 클래스: ObjectiveFunction

An objective function for one hot encoding representation of the output. For instance, classes like [1, 0, 0], [0, 1, 0], [0, 0, 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