Skip to course content
Free PyTorch course

Advanced Deep Learning with PyTorch

Module 02 Activity

Scenario

Every later module depends on data arriving in the right shape. Build that pipeline once, correctly.

Task

  1. Load a tabular dataset into tensors, setting dtype explicitly.
  2. Confirm your target's shape matches your prediction's shape, not just its length.
  3. Split into train, validation and test with a seeded generator. Verify no overlap.
  4. Wrap them in DataLoaders. Note how many batches you get and how large the last one is.
  5. Standardise features using training statistics only, and return those statistics.

Deliverable

A reusable function that takes a DataFrame and returns loaders plus the scaling statistics, and a short note on where the leak would have been.

Check your work

The leak to name

Standardising before splitting lets validation data influence the training transformation. The score improves and the improvement is fictional.