class
FrequencyMixStyle2D
PythonApply frequency mix style augmentation to the 2D input.
FrequencyMixStyle2D(probability: float = 0.5, alpha: float = 1.0, epsilon: float = 1e-06, **kwargs={})Apply frequency mix style augmentation to the 2D input.
Example:
x = np.random.rand(4, 4, 3) lyr = FrequencyMixStyle2D(probability=1.0, alpha=1.0) y = lyr(x, training=True)Base class: BaseAugmentation2D.
Inherited from BaseAugmentation: augment_masks(), augment_sample(), augment_targets(), batch_augment(), call().
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
probability | float | 0.5 | Probability of applying the augmentation. |
alpha | float | 1.0 | Mixup alpha value. |
epsilon | float | 1e-06 | Epsilon value for numerical stability. |
attribute
probability
Pythonprobability: float = probabilityattribute
alpha
Pythonalpha: float = alphaattribute
epsilon
Pythonepsilon: float = epsilonmethod
Generate noise distortion tensor
get_random_transformations(input_shape: tuple[int, int, int]) -> dictGenerate noise distortion tensor
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
input_shape | tuple[int, ...] | Required | Input shape. |
Returns
| Value | Type | Description |
|---|---|---|
dict | dict | Dictionary containing the noise tensor. |
method
apply_mixstyle
PythonApply mixstyle augmentation
apply_mixstyle(x: keras.KerasTensor, lmda: keras.KerasTensor, perm: keras.KerasTensor) -> keras.KerasTensorApply mixstyle augmentation
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
x | tf.Tensor | Required | Input tensor |
lmda | tf.Tensor | Required | Lambda tensor |
perm | tf.Tensor | Required | Permutation tensor |
Returns
| Type | Description |
|---|---|
keras.KerasTensor | tf.Tensor: Augmented tensor |
method
augment_samples
PythonAugment samples
augment_samples(inputs) -> keras.KerasTensorAugment samples
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
inputs | tf.Tensor | Required | Input tensor |
Returns
| Type | Description |
|---|---|
keras.KerasTensor | tf.Tensor: Augmented tensor |
method
get_config
Pythonget_config()