The Dogs vs. Cats dataset is a standard computer vision dataset that involves classifying photos as either containing a dog or cat. This classification is done by using the PyTorch module. In this tutorial, you will discover how to develop a convolutional neural network to classify photos of dogs and cats
- Package Load
- Prepare Dataset
- Build the model
- Train the model
- Model Evaluation
- Summary
At first, we need to import some packages for implementation.
Download the dataset and after that divide the training set into batches. Some popular datasets are included in packages.
For image classification convolutional neural network is more suitable. Therefore, this neural network contain two convolutional payers and three linear layers. The function for forwarding propagation has written.
After that, we will pass our training data to train our model so it will predict the outputs.
All process until here is the task to define the model. Now it is required to define the optimizer and loss function. Then, a confusion matrix has generated. Additionally, Tensorboard is also used to make graphs and histograms of various parameters
Now, by changing different hyper-parameters we can compare the accuracy and loss from tensorboard.