20.03.2021 Views

Deep-Learning-with-PyTorch

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

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

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

70

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

Saved successfully!

Ooh no, something went wrong!