Skip to content

Multiple random augmentations but with reproducibility #21

@notmatthancock

Description

@notmatthancock

Current behavior

If a seed is provided to an Augmenter, a new RandomState instance is created on each call to augment using the given seed. This causes an identical augmentation to be generated on each augment call, e.g.,

noise = tsaug.AddNoise(seed=42)
noise.augment(X)  # new result
noise.augment(X)  # same result

Desired behavior

Supplying a seed instantiates a RandomState() during __init__ and used on each subsequent call to augment instead of being created each time, e.g.,

noise = tsaug.AddNoise(seed=42)
noise.augment(X)  # new result
noise.augment(X)  # another new result

In this situation, setting the seed allows randomness but from a reproducible starting point, which is the typical use-case for setting a seed (e.g., in a training pipeline in ML). Currently, there is no ability to have reproducibility and pseudo random results on each call to augment as far as I understand. If the behavior is updated, then the old behavior can be captured by repeatedly instantiating the Augmenter, i.e.,

tsaug.AddNoise(seed=42).augment(X)  # new result
tsaug.AddNoise(seed=42).augment(X)  # same result

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions