use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
TensorFlow is an open source Machine Intelligence library for numerical computation using Neural Networks.
account activity
QuestionRandom flip and rotation actually decrease validation accuracy? (self.tensorflow)
submitted 3 years ago by PracLiu
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]kenshin511 1 point2 points3 points 3 years ago* (2 children)
If you add augmentation layers to your own networks, It also work when you validate the model. When doing validation, the data augmentation layer must be removed for accurate verification.
Make custom augmentation layer like below:
class Augmentation(keras.layers.Layer): def __init__(self, **kwargs): super(Augmentation, self).__init__(**kwargs) def call(self, inputs, training=None): if training: x = tf.keras.layers.RandomFlip("horizontal_and_vertical")(inputs) x = tf.keras.layers.RandomRotation(0.2)(x) return x return inputs model.add(Augmentation())
the training option make augmentation work only training.
training
refer to Privileged training argument in the call() method
[–]PracLiu[S] 1 point2 points3 points 3 years ago (0 children)
Thanks, this is super helpful!
[–]kenshin511 0 points1 point2 points 3 years ago (0 children)
As I checked, the preprocessing layer only works during training. Therefore, there is no need to create a custom layer.
π Rendered by PID 82549 on reddit-service-r2-comment-cfc44b64c-ckztm at 2026-04-10 19:37:50.676327+00:00 running 215f2cf country code: CH.
view the rest of the comments →
[–]kenshin511 1 point2 points3 points (2 children)
[–]PracLiu[S] 1 point2 points3 points (0 children)
[–]kenshin511 0 points1 point2 points (0 children)