Zum Inhalt

Loss Function

Eine Loss Function (Verlustfunktion) misst, wie "falsch" die Vorhersage eines Modells ist. Das Ziel des Trainings: Loss minimieren.


Wichtige Loss Functions

Mean Squared Error (MSE)

\[ L = \frac{1}{n} \sum_i (y_i - \hat{y}_i)^2 \]
  • Für Regression
  • Bestraft große Fehler stark

Cross-Entropy Loss

\[ L = -\sum_i y_i \log(\hat{y}_i) \]
  • Für Klassifikation
  • Standard für LLMs (Next-Token-Prediction)

Binary Cross-Entropy

\[ L = -[y \log(\hat{y}) + (1-y) \log(1-\hat{y})] \]
  • Für Ja/Nein-Entscheidungen

Loss-Landschaft

Die Loss Function definiert eine "Landschaft" über alle möglichen Parameter. Training = Wanderung zum Minimum.


Siehe auch