From the course: Programming Generative AI: From Variational Autoencoders to Stable Diffusion with PyTorch and Hugging Face

Unlock this course with a free trial

Join today to access over 24,800 courses taught by industry experts.

Convolutional neural networks in PyTorch

Convolutional neural networks in PyTorch

- [Instructor] And that being said, for our first convolutional neural network, we're going to copy what's maybe the most famous CNN architecture, often called LeNet, named after Yann LeCun, who basically published a research paper that used the LeNet architecture on MNIST to classify handwriting into digits. And this architecture is the first kind of convolutional neural network applied to a task like handwriting recognition and has become the standard hello, world almost of, here's the kind of small, simple but useful baseline convolutional neural network architecture. Using PyTorch, we have pretty much exactly the same setup that we saw in the last lesson. We're subclassing from module, in this case, we're calling super. And the main difference with the kind of LeNet or a convolutional architecture really just comes down to the layers. So in this example, I'm going to show a kind of alternative pattern to using something like the PyTorch containers to do something like a sequential…

Contents