tapas.attacks.set_classifiers.SetFeature
- class tapas.attacks.set_classifiers.SetFeature
Bases:
abc.ABCRepresents a set of features that can be extracted from a dataset, as a np.array vector. This is a callable that can optionally have some configuration parameters passed via __init__.
By default, this is memoryless and static, but it can be extended to be trainable from datasets.
- __init__()
Methods
__init__()extract(datasets)Extract features from each dataset in a list.
Attributes
label- abstract extract(datasets: list[Dataset]) np.array
Extract features from each dataset in a list.
- Parameters
datasets (list of Datasets.) – Datasets to extract features from.
- Returns
features – Array of size len(datasets) x k, where the number of features k can be estimated by self.size(dataset.description). Each row is a dataset, and each column a different feature.
- Return type
np.array