torchsig.image_datasets.transforms.impairments.BlurTransform

class torchsig.image_datasets.transforms.impairments.BlurTransform(strength: float = 1, blur_shape=5, **kwargs)[source]

Bases: Seedable

Methods

add_parent

Add parent Seedable object and set up RNGs accordingly

get_distribution

get_second_seed

Gets second seed, usually used to seed both torch and numpy generators with slightly different seeds

seed

Seed number generators with given seed.

setup_rngs

Initialize torch and numpy number generators, and update its children.

update_from_parent

Update numpy and torch number generators with parent seed

__init__(strength: float = 1, blur_shape=5, **kwargs)[source]

Initializes seedable object with self.seed = seed; if a parent Seedable object is passed in, they will share random number generators, and the seed argument will not be used

Parameters:
  • seed (int, optional) – Seed for use for number genrators. Defaults to None.

  • parent (Seedable, optional) – Parent Seedable responsible for seeding this object. Defaults to None.

__call__(image_raw)[source]

Call self as a function.

__repr__() str

Return repr(self).

add_parent(parent) None

Add parent Seedable object and set up RNGs accordingly

get_second_seed(seed: int) int

Gets second seed, usually used to seed both torch and numpy generators with slightly different seeds

Parameters:

seed (int) – Seed to use.

Returns:

New seed.

Return type:

int

seed(seed: int) None

Seed number generators with given seed.

Parameters:

seed (int) – Seed to use.

setup_rngs() None

Initialize torch and numpy number generators, and update its children.

update_from_parent() None

Update numpy and torch number generators with parent seed