4 Real-world data representation using tensors

 

This chapter covers

  • Representing real-world data as PyTorch tensors
  • Working with a range of data types
  • Loading data from a file
  • Converting data to tensors
  • Shaping tensors so they can be used as inputs for neural network models

In the previous chapter, we learned that tensors are the building blocks for data in PyTorch. Neural networks take tensors as input and produce tensors as outputs. In fact, all operations within a neural network and during optimization are operations between tensors, and all parameters (for example, weights and biases) in a neural network are tensors. Having a good sense of how to perform operations on tensors and index them effectively is central to using tools like PyTorch successfully. Now that you know the basics of tensors, your dexterity with them will grow as you make your way through the book.

4.1 Working with images

 

4.1.1 Adding color channels

 
 
 

4.1.2 Loading an image file

 
 
 

4.1.3 Changing the layout

 
 

4.1.4 Normalizing the data

 
 

4.2 3D images: Volumetric data

 
 
 

4.2.1 Loading a specialized format

 
 
 

4.3 Representing tabular data

 
 

4.3.1 Using a real-world dataset

 
 
 

4.3.2 Loading a wine data tensor

 
 
 
 

4.3.3 Representing scores

 
 
 
 

4.3.4 One-hot encoding

 
 
 
 

4.3.5 When to categorize

 
 

4.3.6 Finding thresholds

 
 
 
 

4.4 Working with time series

 
 

4.4.1 Adding a time dimension

 

4.4.2 Shaping the data by time period

 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage