alibi_detect.utils.pytorch.misc module

alibi_detect.utils.pytorch.misc.quantile(sample, p, type=7, sorted=False)[source]

Estimate a desired quantile of a univariate distribution from a vector of samples

Parameters
Return type

float

Returns

An estimate of the quantile

alibi_detect.utils.pytorch.misc.zero_diag(mat)[source]

Set the diagonal of a matrix to 0

Parameters

mat (Tensor) – A 2D square matrix

Return type

Tensor

Returns

A 2D square matrix with zeros along the diagonal