Recall & Review
beginner
What is the purpose of a loss function in machine learning?
A loss function measures how well the model's predictions match the true values. It helps the model learn by showing how much it is wrong.
Click to reveal answer
beginner
What does MSELoss stand for and when is it used?
MSELoss stands for Mean Squared Error Loss. It is used for regression tasks where the goal is to predict continuous values.
Click to reveal answer
beginner
What type of problems is CrossEntropyLoss used for?
CrossEntropyLoss is used for classification problems, especially when predicting categories or classes.
Click to reveal answer
intermediate
How does MSELoss calculate the error?
MSELoss calculates the average of the squares of the differences between predicted and true values. Squaring makes bigger errors count more.
Click to reveal answer
intermediate
Why is CrossEntropyLoss suitable for classification?
CrossEntropyLoss compares the predicted probabilities with the true class labels using a formula that penalizes wrong predictions more when the model is confident but wrong.Click to reveal answer
Which loss function is best for predicting house prices?
✗ Incorrect
MSELoss is used for regression tasks like predicting house prices, which are continuous values.
CrossEntropyLoss is mainly used for:
✗ Incorrect
CrossEntropyLoss is designed for classification tasks where the output is a category.
What does MSELoss penalize more?
✗ Incorrect
MSELoss squares the errors, so larger errors have a bigger penalty.
In PyTorch, which loss function expects raw scores (logits) as input?
✗ Incorrect
CrossEntropyLoss expects raw scores (logits) and applies softmax internally.
Which loss function would you use for a multi-class classification problem?
✗ Incorrect
CrossEntropyLoss is suitable for multi-class classification problems.
Explain the difference between MSELoss and CrossEntropyLoss and when to use each.
Think about the type of output your model predicts: numbers or categories.
You got /4 concepts.
Describe how CrossEntropyLoss works with model outputs and true labels.
Consider how the loss handles probabilities and class labels.
You got /4 concepts.