22.02.2024 Views

Daniel Voigt Godoy - Deep Learning with PyTorch Step-by-Step A Beginner’s Guide-leanpub

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Equation 0.6 - Computing mean and standard deviation

Then, it uses both values to scale the feature:

Equation 0.7 - Standardizing

If we were to recompute the mean and the standard deviation of the scaled

feature, we would get 0 and 1, respectively. This pre-processing step is commonly

referred to as normalization, although, technically, it should always be referred to as

standardization.

IMPORTANT: Pre-processing steps like the StandardScaler

MUST be performed AFTER the train-validation-test split;

otherwise, you’ll be leaking information from the validation and /

or test sets to your model!

After using the training set only to fit the StandardScaler, you

should use its transform() method to apply the pre-processing

step to all datasets: training, validation, and test.

52 | Chapter 0: Visualizing Gradient Descent

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!