20.03.2021 Views

Deep-Learning-with-PyTorch

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

It starts with a tensor

This chapter covers

• Understanding tensors, the basic data structure

in PyTorch

• Indexing and operating on tensors

• Interoperating with NumPy multidimensional

arrays

• Moving computations to the GPU for speed

In the previous chapter, we took a tour of some of the many applications that deep

learning enables. They invariably consisted of taking data in some form, like images

or text, and producing data in another form, like labels, numbers, or more images

or text. Viewed from this angle, deep learning really consists of building a system

that can transform data from one representation to another. This transformation is

driven by extracting commonalities from a series of examples that demonstrate the

desired mapping. For example, the system might note the general shape of a dog

and the typical colors of a golden retriever. By combining the two image properties,

the system can correctly map images with a given shape and color to the golden

retriever label, instead of a black lab (or a tawny tomcat, for that matter). The

resulting system can consume broad swaths of similar inputs and produce meaningful

output for those inputs.

39

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

Saved successfully!

Ooh no, something went wrong!