PyTorch

What is PyTorch?

PyTorch is a machine learning library for Python used mainly for natural language processing. The open-source software was developed by the artificial intelligence teams at Facebook Inc. in 2016. PyTorch offers two significant features including tensor computation, as well as functional deep neural networks.

How does PyTorch work?

PyTorch uses an Autograd module to compute automatic differentiation. In short, a recorder details what operations are performed and then replays it to synthesize the gradients. This saves time in the development of neural networks as data differentiation is performed swiftly at the forward pass. PyTorch's optim package allows a user to define an optimizer that will update weights automatically. However, when users want to create their own custom model, they can take advantage of PyTorch's nn.module. Given the various modules, PyTorch allows you to implement different types of layers such as convolutional layers, recurrent layers, and linear layers, among others.