yamle.third_party.imagenet_c.tabular_corruptions module#

This file is an adaptation to the original ImageNet-C corruptions but for tabular data.

yamle.third_party.imagenet_c.tabular_corruptions.additive_gaussian_noise(x, severity=1)[source]#

Adds gaussian noise with mean 0 and std deviation c.

The standard deviation c is multiplied with respect to the features range to get the final standard deviation.

Parameters:
  • x (np.ndarray) – The input data of shape (N, D).

  • severity (int) – The severity of the corruption. Must be in [1, 5].

Return type:

ndarray

yamle.third_party.imagenet_c.tabular_corruptions.multiplicative_gaussian_noise(x, severity=1)[source]#

Multiplies the input by a gaussian noise with mean 1 and std deviation c.

The standard deviation c is multiplied with respect to the feature range

Return type:

ndarray

yamle.third_party.imagenet_c.tabular_corruptions.additive_uniform_noise(x, severity=1)[source]#

Adds uniform noise with range [-c, c].

The range is multiplied with respect to the feature range to get the final range.

Return type:

ndarray

yamle.third_party.imagenet_c.tabular_corruptions.multiplicative_uniform_noise(x, severity=1)[source]#

Multiplies the input by a uniform noise with range [1-c, 1+c].

Return type:

ndarray

yamle.third_party.imagenet_c.tabular_corruptions.multiplicative_bernoulli_noise(x, severity=1)[source]#

Multiplies the input by a bernoulli noise which drops features with probability c.

Return type:

ndarray