quantus.functions.loss_func module
This module holds a collection of loss functions i.e., ways to measure the loss between two inputs.
- quantus.functions.loss_func.mse(a: array, b: array, batched: bool = False, **kwargs) float
Calculate Mean Squared Error between two images (or explanations).
- Parameters:
- a: np.ndarray
Array to calculate MSE with.
- b: np.ndarray
Array to calculate MSE with.
- batched: bool
True if arrays are batched. Arrays are expected to be 2D (B x F), where B is batch size and F is the number of features
- kwargs: optional
Keyword arguments.
- normalise_mse: boolean
Indicates whether to returned a normalised MSE calculation or not.
- Returns:
- float:
A floating point of MSE.