Going Deeper – The Mechanics of PyTorch
In Chapter 12, Parallelizing Neural Network Training with PyTorch, we covered how to define and manipulate tensors and worked with the torch.utils.data
module to build input pipelines. We further built and trained a multilayer perceptron to classify the Iris dataset using the PyTorch neural network module (torch.nn
).
Now that we have some hands-on experience with PyTorch neural network training and machine learning, it’s time to take a deeper dive into the PyTorch library and explore its rich set of features, which will allow us to implement more advanced deep learning models in upcoming chapters.
In this chapter, we will use different aspects of PyTorch’s API to implement NNs. In particular, we will again use the torch.nn
module, which provides multiple layers of abstraction to make the implementation of standard architectures very convenient. It also allows us to implement custom NN layers, which is very useful...