fchollet / deep-learning-with-python-notebooks

Jupyter notebooks for the code samples of the book "Deep Learning with Python"
MIT License
18.17k stars 8.53k forks source link

3.7 example z-score compute #118

Open david-sail opened 5 years ago

david-sail commented 5 years ago

mean = train_data.mean(axis=0) train_data -= mean std = train_data.std(axis=0) train_data /= std

test_data -= mean test_data /= std

modify

mean = train_data.mean(axis=0) std = train_data.std(axis=0) train_data -= mean train_data /= std

test_data -= mean test_data /= std

chamecall commented 5 years ago

Think there's no needing in this. Maybe even operation std will be executed faster on data obtained by mean since std will be use zero subtract operation to find the mean.

happyTonakai commented 5 years ago

V[X+c] = V[X], where c is a constant value