KernelLoss#
- class KernelLoss[स्रोत]#
आधार:
ABC
Abstract base class for computing the loss of a kernel function. Unlike many loss functions, which only take into account the labels and predictions of a model, kernel loss functions may be a function of internal model parameters or quantities that are generated during training.
Methods
- abstract evaluate(parameter_values, quantum_kernel, data, labels)[स्रोत]#
An abstract method for evaluating the loss of a kernel function on a labeled dataset.
- मापदण्ड:
parameter_values (Sequence[float]) -- An array of values to assign to the user params
quantum_kernel (TrainableKernel) -- A trainable quantum kernel object to evaluate
data (ndarray) -- An
(N, M)
matrix containing the dataN = # samples, M = dimension of data
labels (ndarray) -- A length-N array containing the truth labels
- प्रदत्त :
A loss value
- प्रदत्त प्रकार :