squlearn.kernel.loss.kernel_loss_base.KernelLossBase
- class squlearn.kernel.loss.kernel_loss_base.KernelLossBase
Empty parent class for a kernel loss function.
- abstract compute(parameter_values: array, data: ndarray, **kwargs) float
Compute the target alignment loss.
- Parameters:
parameter_values (np.ndarray) – The parameter values for the variational quantum kernel parameters.
data (np.ndarray) – The training data to be used for the kernel matrix.
kwargs – Additional arguments for specific loss functions.
- Returns:
The loss value.
- Return type:
float
- set_quantum_kernel(quantum_kernel: KernelMatrixBase) None
Set the quantum kernel matrix to be used in the loss.
- Parameters:
quantum_kernel (KernelMatrixBase) – The quantum kernel matrix to be used in the loss.