liveBook · Manning

Objective function

As explained in Introduction to Generative AI, Second Edition

A loss function is a mathematical function that quantifies prediction error or undesired behavior for optimization during model training.

An objective function is a mathematical statement of a model’s goal. It can require minimizing task errors or reducing the difference between predictions and actual values. section 1.1

Training algorithms adjust neural-network weights and bias terms repeatedly to improve performance against that objective. The precise mathematics is left aside, keeping the idea at an intuitive level. section 1.1

The objective changes with the learning setting:

  • Supervised learning aims to predict outputs for unseen inputs. section 1.1
  • Unsupervised learning aims to discover patterns such as clusters. section 1.1
  • Reinforcement learning seeks an optimal strategy through rewards and penalties rather than a static dataset. section 1.1
  • In mixture-of-experts models, selecting the loss function carefully helps balance training across experts. section 2.6
Table 1.1 Types of machine learning

Supervised learning

Unsupervised learning

Reinforcement learning

Description

The model learns by mapping labeled inputs to known outputs.

The model is trained without labels and without a specific reward.

The model learns from its environment based on rewards and penalties.

Data

Labeled data

Unlabeled data

No static dataset

Objective

To predict the output of unseen inputs

To discover underlying patterns in the data, such as clusters

To determine the optimal strategy via trial and error

Compare learning types by their data sources and objectives. section 1.1

How Introduction to Generative AI, Second Edition covers it

How deep it goes
Defines objectives and training intuition but defers the precise mathematics of updating neural-network parameters.
Examples
Uses minimizing errors, reducing prediction differences, maximizing rewards, and balancing mixture-of-experts training as examples.
What it assumes
Introduces objectives alongside data, learning types, and neural networks without requiring prior mathematical treatment.
What you can do after
Evaluate/understand how learning settings define goals and how those goals guide parameter updates and expert balancing.
How it connects
Connects objective functions with loss functions, neural networks, reinforcement learning, supervised learning, and mixture-of-experts models.

Also explained in

Compare how 30 books explain objective function →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Introduction to Generative AI, Second Edition. The section links point to the parts of the book it draws on.