AI Terms Dictionary

A comprehensive multilingual AI terminology dictionary

Definition

Also known as the cost or error function, the loss function provides a scalar value indicating how well the model is performing. During training, optimization algorithms use this value to compute gradients and update model weights via backpropagation. Common examples include Mean Squared Error for regression tasks and Cross-Entropy for classification. The choice of loss function significantly impacts the model’s ability to learn the underlying patterns in the data.

Summary

A mathematical function that quantifies the difference between predicted values and actual target values during training.

Key Concepts

Use Cases

Code Example

1
2
import torch.nn as nn
criterion = nn.CrossEntropyLoss()