From the course: Up and Running with PyTorch by Pearson
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Multilayer feedforward neural networks (MLP) - PyTorch Tutorial
From the course: Up and Running with PyTorch by Pearson
Multilayer feedforward neural networks (MLP)
So since we're adding potentially a lot of layers, if we're building a large, deep, multi-layer perceptron, I wanted to show one of the other niceties of the module API. So instead of having to write things like self.function1 or self.function2, basically explicitly having all of these just attached as attributes. We can use in PyTorch what it calls the sequential API, or the sequential container. So neuralnetwork.sequential is going to allow us to basically make a sophisticated list of layers. So we have a linear layer. In this case, let's do something a little bit more interesting. We're passing in the same single data value, a single scalar. For the first layer, let's have three output nodes. We're going to add our non-linearity, the sigmoid. So this is a one-layer perceptron. And all we need to do is copy this. Let's have three layers. And the second layer is going to take in three. So we're outputting three from the first layer. We're inputting three from the next layer. Let's…
Contents
-
-
-
What is PyTorch?4m 33s
-
The PyTorch layer cake11m 26s
-
The deep learning software trilemma7m 4s
-
(Locked)
What are tensors, really?5m 24s
-
(Locked)
Tensors in PyTorch10m 3s
-
(Locked)
Introduction to computational graphs12m 45s
-
(Locked)
Backpropagation is just the chain rule16m 31s
-
(Locked)
Effortless backpropagation with torch.autograd13m 39s
-
(Locked)
PyTorch's device abstraction: GPUs4m
-
(Locked)
Working with devices10m 47s
-
(Locked)
Components of a learning algorithm7m 9s
-
(Locked)
Introduction to gradient descent6m 4s
-
(Locked)
Getting to stochastic gradient descent (SGD)4m 8s
-
(Locked)
Comparing gradient descent and SGD5m 50s
-
(Locked)
Linear regression with PyTorch23m 56s
-
(Locked)
Perceptrons and neurons7m 52s
-
(Locked)
Layers and activations with torch.nn12m 41s
-
(Locked)
Multilayer feedforward neural networks (MLP)8m 58s
-
-