AI Terms Dictionary

A comprehensive multilingual AI terminology dictionary

Definition

Loss functions, also known as cost functions, measure how well a machine learning model’s predictions match the ground truth during training. The goal of the optimization algorithm is to minimize this loss value. Different tasks require different loss functions; for example, Mean Squared Error (MSE) is common for regression, while Cross-Entropy is standard for classification. Monitoring loss helps diagnose issues like underfitting or overfitting.

Summary

A numerical value that quantifies the error between a model’s predictions and the actual target values.

Key Concepts

Use Cases

Code Example

1
2
3
import torch.nn as nn
criterion = nn.CrossEntropyLoss()
loss = criterion(outputs, targets)