Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple random augmentations but with reproducibility #21

Open
notmatthancock opened this issue Sep 19, 2024 · 0 comments
Open

Multiple random augmentations but with reproducibility #21

notmatthancock opened this issue Sep 19, 2024 · 0 comments

Comments

@notmatthancock
Copy link

notmatthancock commented Sep 19, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant