Logistic Regression for Multiple Classes (Part 1-5)
What we covered in this video lecture
In this video, we extended the binary logistic regression model to a multinomial logistic regression model that works with an arbitrary number of classes. In machine learning and deep learning contexts, this multinomial logistic regression model is commonly called softmax regression.
We saw that only minimal code changes required when we turn a logistic regression model into a softmax regression model. We replaced the logistic sigmoid function with a softmax activation function, and we replaced the binary cross-entropy loss by the categorical cross-entropy loss.
Additional resources if you want to learn more
It can sometimes be tricky to remember the correct inputs for the different cross-entropy loss functions in PyTorch, so I created a small cheat sheet here.
Log in or create a free Lightning.ai account to access:
- Completion badges
- Progress tracking
- Additional downloadable content
- Additional AI education resources
- Notifications when new units are released
- Free cloud computing credits