From the course: Deep Learning and Computer Vision: Object Detection with PyTorch

Unlock this course with a free trial

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

PyTorch for deep learning, part 1

PyTorch for deep learning, part 1

- [Instructor] Welcome to the first video of Deep Learning Development using PyTorch. Now as we have learned the basics of PyTorch and tensors, it's time to build our first neural network using PyTorch. In this video, I will tell you how to create a simple feedforward neural network, train it on a basic dataset, and see how it performs. Let's start by defining a neural network. We'll be using the torch nn.Module class to create a simple feedforward network with one input layer, one hidden layer, and one output layer. Here is the code to define our network. This network has two neurons in the input layer, three in the hidden layer, and one in the output layer. We are using relu as the activation function for the hidden layer and sigmoid for the output layer. Next step is to prepare the data and train our model. For simplicity, let's use a binary classification task like the XOR problem. Our input will be a two by two metrics, and the output will be the corresponding labels. We can…

Contents