How to do average subtraction and normalization with Tensorflow

In http://cs231n.imtqy.com/neural-networks-2/ it is mentioned that for convolutional neural networks, it is preferable to project data using methods of subtraction and normalization of the average value.

I'm just wondering what is the best fit with Tensorflow.

Mean

X -= np.mean(X)

Normalization

X /= np.std(X, axis = 0)
+4
source share
3 answers

You are looking for

Linearly scale the image to have a zero average and unit rate.

op (x - mean)/adjust_stddev, - , adjust_stddev = max (stddev, 1.0/sqrt (image.NumElements())).

+4

, real_valued_column , :

real_valued_column("col_name", normalizer = lambda x: (x-X.mean())/X.std())

X - . , , . .

+1
+1

Source: https://habr.com/ru/post/1650028/


All Articles