FluxML / DataAugmentation.jl

Flexible data augmentation library for machine and deep learning
https://fluxml.ai/DataAugmentation.jl/dev/
MIT License
41 stars 17 forks source link

Random state argument for consistent random augmentations #47

Closed Dale-Black closed 3 years ago

Dale-Black commented 3 years ago

I would like to suggest an argument for RandomResizeCrop and other stochastic transformations. Something like RandomResizeCrop(seed=...) would be really convenient for augmenting supervised data with the same random seed. This isn't necessary obviously as you have already given me a helpful workaround, but in case this is easy to implement I wanted to add this suggestion

lorenzoh commented 3 years ago

So you want to fix the randomness of a stochastic transformation so it always gives the same result? What would seed do exactly?

Dale-Black commented 3 years ago

I was thinking something like this. But I’m not sure if this is much cleaner than the route you have already proposed actually

lorenzoh commented 3 years ago

Hm, I don't really see an advantage in this. One thing to do could be to implement a wrapper transform Deterministic that wraps a transform and always passes the same random state through. That way you wouldn't need to change existing transforms.

Dale-Black commented 3 years ago

Fair enough. I think I agree with you the more I think about it