Class QuantumLoss<T>
- Namespace
- AiDotNet.LossFunctions
- Assembly
- AiDotNet.dll
Represents a quantum-specific loss function for quantum neural networks.
public class QuantumLoss<T> : LossFunctionBase<T>, ILossFunction<T>
Type Parameters
TThe numeric type used for calculations.
- Inheritance
-
QuantumLoss<T>
- Implements
- Inherited Members
- Extension Methods
Constructors
QuantumLoss()
public QuantumLoss()
Methods
CalculateDerivative(Vector<T>, Vector<T>)
Calculates the derivative of the quantum loss function.
public override Vector<T> CalculateDerivative(Vector<T> predicted, Vector<T> expected)
Parameters
predictedVector<T>The predicted quantum state.
expectedVector<T>The expected quantum state.
Returns
- Vector<T>
The gradient of the loss with respect to the predicted values.
CalculateLoss(Vector<T>, Vector<T>)
Calculates the quantum loss between predicted and expected quantum states.
public override T CalculateLoss(Vector<T> predicted, Vector<T> expected)
Parameters
predictedVector<T>The predicted quantum state.
expectedVector<T>The expected quantum state.
Returns
- T
The calculated quantum loss.
Remarks
This method implements a form of quantum fidelity loss, which measures how close the predicted quantum state is to the expected quantum state.