alibi_detect.cd.tensorflow.preprocess module
- class alibi_detect.cd.tensorflow.preprocess.HiddenOutput(model, layer=-1, input_shape=None, flatten=False)[source]
Bases:
Model
- class alibi_detect.cd.tensorflow.preprocess.UAE(encoder_net=None, input_layer=None, shape=None, enc_dim=None)[source]
Bases:
Model
- alibi_detect.cd.tensorflow.preprocess.preprocess_drift(x, model, preprocess_batch_fn=None, tokenizer=None, max_len=None, batch_size=10000000000, dtype=<class 'numpy.float32'>)[source]
Prediction function used for preprocessing step of drift detector.
- Parameters:
model (
Model
) – Model used for preprocessing.preprocess_batch_fn (
Optional
[Callable
]) – Optional batch preprocessing function. For example to convert a list of objects to a batch which can be processed by the TensorFlow model.tokenizer (
Optional
[Callable
]) – Optional tokenizer for text drift.max_len (
Optional
[int
]) – Optional max token length for text drift.batch_size (
int
) – Batch size.dtype (
Type
[generic
]) – Model output type, e.g. np.float32 or tf.float32.
- Return type:
Union
[ndarray
,Tensor
]- Returns:
Numpy array with predictions.