alibi_detect.utils.fetching package

alibi_detect.utils.fetching.fetch_detector(filepath, detector_type, dataset, detector_name, model=None)[source]

Fetch an outlier or adversarial detector from a google bucket, save it locally and return the initialised detector.

Parameters:
  • filepath (Union[str, PathLike]) – Local directory to save detector to.

  • detector_type (str) – outlier or adversarial.

  • dataset (str) – Dataset of pre-trained detector. E.g. kddcup, cifar10 or ecg.

  • detector_name (str) – Name of the detector in the bucket.

  • model (Optional[str]) – Classification model used for adversarial detection.

Return type:

Union[BaseDetector, AdversarialAE, ModelDistillation, IForest, LLR, Mahalanobis, OutlierAEGMM, OutlierAE, OutlierProphet, OutlierSeq2Seq, OutlierVAE, OutlierVAEGMM, SpectralResidual]

Returns:

Initialised pre-trained detector.

alibi_detect.utils.fetching.fetch_tf_model(dataset, model)[source]

Fetch pretrained tensorflow models from the google cloud bucket.

Parameters:
  • dataset (str) – Dataset trained on.

  • model (str) – Model name.

Return type:

Model

Returns:

Pretrained tensorflow model.

Submodules