Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
PyTorch Deep Learning Hands-On

You're reading from   PyTorch Deep Learning Hands-On Build CNNs, RNNs, GANs, reinforcement learning, and more, quickly and easily

Arrow left icon
Product type Paperback
Published in Apr 2019
Publisher Packt
ISBN-13 9781788834131
Length 250 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Sherin Thomas Sherin Thomas
Author Profile Icon Sherin Thomas
Sherin Thomas
Sudhanshu Passi Sudhanshu Passi
Author Profile Icon Sudhanshu Passi
Sudhanshu Passi
Arrow right icon
View More author details
Toc

The PyTorch way

So far, we have developed a simple two-layer neural network in a hybrid NumPy-PyTorch style. We have coded each operation line by line, like how we do it in NumPy, and we have adopted automatic differentiation from PyTorch so that we don't have to code the backward pass.

On the way, we have learned how to wrap matrices (or tensors) in PyTorch, and that helps us with backpropagation. The PyTorch way of doing the same thing is a bit more convenient and that is what we are going to discuss in this section. PyTorch gives access to almost all the functionality required for a deep learning project inbuilt. Since PyTorch supports all the mathematical functions available in Python, it's not a tough task to build one function if it's not available in the core. You can not only build any functionality you need, but PyTorch defines the derivative function of the functionality you build implicitly.

PyTorch is helpful for people who need to know the low-level...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image