简体   繁体   中英

Why is seeding mandatory for stateless random flipping in tensorflow image operations?

I am implementing custom data augmentation layer in my model where I am trying to use the function tf.image.stateless_random_flip_left_right .

Tensorflow Documentation says this function can,

Randomly flip an image horizontally (left to right) deterministically.

Why do we need a deterministic flip? Also, for this function, seed is a mandatory argument.

In data augmentation, I understand that from epoch to epoch, a particular image is fed in different forms. Wouldn't this force images of the same kind to be supplied?

Intuitively stateless means results wont have any state.So it will just flip the images randomly and will give different results with respect to different seeds.

For image augmentation purpose, you can use random_flip_left_right api

Attached gist for reference.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM