art.preprocessing.expectation_over_transformation

EOT Image Rotation - TensorFlow V2

class art.preprocessing.expectation_over_transformation.EOTImageRotationTensorFlowV2(nb_samples: int = 1, angles_range: float = 3.14, clip_values: Optional[CLIP_VALUES_TYPE] = None, label_type: str = 'classification', apply_fit: bool = False, apply_predict: bool = True)

This module implements Expectation over Transformation preprocessing.

__init__(nb_samples: int = 1, angles_range: float = 3.14, clip_values: Optional[CLIP_VALUES_TYPE] = None, label_type: str = 'classification', apply_fit: bool = False, apply_predict: bool = True) → None

Create an instance of EOTImageRotationTensorFlowV2.

Parameters
  • nb_samples (int) – Number of random samples per input sample.

  • angles_range (float) – A positive scalar angle in radians defining the uniform sampling range from negative and positive angles_range.

  • clip_values – Tuple of the form (min, max) representing the minimum and maximum values allowed for features.

  • label_type (str) – String defining the type of labels. Currently supported: classification

  • apply_fit (bool) – True if applied during fitting/training.

  • apply_predict (bool) – True if applied during predicting.

forward(x: tf.Tensor, y: Optional[tf.Tensor] = None) → Tuple[tf.Tensor, Optional[tf.Tensor]]

Apply audio filter to a single sample x.

Return type

Tuple

Parameters
  • x – A single audio sample.

  • y – Label of the sample x. This function does not affect them in any way.

Returns

Similar sample.