quantus.functions.norm_func module
This module contains a collection of norm functions i.e., ways to measure the norm of a input- (or explanation) vector.
- quantus.functions.norm_func.fro_norm(a: array) float
Calculate Frobenius norm for an array.
- Parameters:
- a: np.ndarray
The array to calculate the Frobenius on. If 2D, the array is assumed to be batched.
- Returns:
- float
The norm.
- quantus.functions.norm_func.l2_norm(a: array) float
Calculate L2 norm for an array.
- Parameters:
- a: np.ndarray
The array to calculate the L2 on. If 2D, the array is assumed to be batched.
- Returns:
- float
The norm.
- quantus.functions.norm_func.linf_norm(a: array) float
Calculate L-inf norm for an array.
- Parameters:
- a: np.ndarray
The array to calculate the L-inf on. If 2D, the array is assumed to be batched.
- Returns:
- float
The norm.