I've seen division by 255 used many times as normalization in CNN tutorials online, and this is done across the entire dataset before train test split.
I was under the impression that the test set should be normalized according to the mean/std/maxmin etc. of the training set. By using /255 across the whole dataset, apparently we are giving the training set a feel for the test set. Is that true?
What's the right approach here?
This:
x_train = (x_train - x_train_mean)/x_train_std
x_test = (x_test - x_test_mean)/x_test_std
or this:
x_train = (x_train - x_train_mean)/x_train_std
x_test = (x_test - x_train_mean)/x_train_std
or this:
data/255
Thanks
I've been asked to provide background to what I've tried: This seems to be ungoogleable, I haven't found any discussion on it.
edit: Just another thought.
Because both train and test set are already on the same scale (ie. each pixel from 0-255) I assume that dividing by 255 doesn't make a difference, now they're on the same scale, but from 0-1.