mindspore.nn.probability.toolbox.VAEAnomalyDetection
- class mindspore.nn.probability.toolbox.VAEAnomalyDetection(encoder, decoder, hidden_size=400, latent_size=20)[source]
Toolbox for anomaly detection by using VAE.
Variational Auto-Encoder(VAE) can be used for Unsupervised Anomaly Detection. The anomaly score is the error between the X and the reconstruction of X. If the score is high, the X is mostly outlier.
- Parameters
- Supported Platforms:
Ascend
GPU
- predict_outlier(sample_x, threshold=100.0)[source]
Predict whether the sample is an outlier.
- Parameters
sample_x (Tensor) – The sample to be predicted, the shape is (N, C, H, W).
threshold (float) – the threshold of the outlier. Default: 100.0.
- Returns
Bool, whether the sample is an outlier.