liveBook · Manning

Dataset

In PyTorch, Dataset is an abstraction for an indexed collection of samples that supports retrieving individual items and, typically, reporting its size.

How 2 Manning books explain it

Inside Deep Learning: Math, Algorithms, Models

How it is used
Organizes indexed input–target samples for neural-network training and hands sample selection to a DataLoader.
How deep it goes
Implements __getitem__ and __len__, explains on-demand preparation, and extends the pattern to regression, classification, and segmentation.
Examples
Uses MNIST rows, one-dimensional regression, two-class moons data, and nuclei images with combined masks.
What you can do after
Build it from scratch with indexed retrieval and size methods, or apply it via TensorDataset when the data fits in RAM.

Read how Inside Deep Learning: Math, Algorithms, Models explains Dataset →

Fight Fraud with Machine Learning

Dataset is a PyTorch base class defining an interface for indexed collections of training examples.

How it is used
Structures indexed images, masks, audio waveforms, features, and labels for PyTorch training, validation, and testing pipelines.
How deep it goes
Defines and implements __init__, __len__, and __getitem__, while delegating batching and parallel loading to DataLoader.
Examples
Uses receipt images with forgery masks and WAV files labeled real or fake as concrete indexed collections.
What you can do after
Build it from scratch by subclassing Dataset, indexing samples, applying preprocessing, and returning inputs with labels.

Read how Fight Fraud with Machine Learning explains Dataset →

Also covered in

What to know first

Related concepts

Questions about Dataset

What is Dataset?

In PyTorch, Dataset is an abstraction for an indexed collection of samples that supports retrieving individual items and, typically, reporting its size.

Which Manning books explain Dataset?

Inside Deep Learning: Math, Algorithms, Models and Fight Fraud with Machine Learning.

What should I know before learning Dataset?

Manning books that teach Dataset usually introduce language model, machine learning, optimization and generation first.

What kinds of Dataset are there?

Kinds of Dataset include synthetic data.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.