liveBook · Manning

Objective function

As explained in Applied Reinforcement Learning

A mathematical quantity that a learning or optimization procedure seeks to minimize or maximize.

An objective function expresses what a decision or learning procedure seeks to optimize. A retailer, for example, might minimize the combined cost of ordering, holding, and running out of inventory. The function gives the model a measurable goal; constraints specify the limits within which decisions must be made. section 1.3 section 1.4

In a business model, decision variables represent choices such as order quantities or prices. External factors, such as demand forecasts, supply inputs to the model. Objectives can be minimized or maximized, and a problem may have more than one objective, such as reducing cost while balancing workload. section 1.3 section 1.4

A bakery’s production objective

A bakery earns $5 per chocolate cake and $4 per vanilla cake. If x₁ and x₂ are the respective quantities, its objective is to maximize 5x₁ + 4x₂. Production is limited by 100 labor hours and 150 kg of flour: chocolate cakes require 2 hours and 3 kg each, while vanilla cakes require 1 hour and 2 kg each. The objective measures profit; the resource limits constrain the choices. section 1.6.1

Figure 1.6 Linear programming formulation of bakery shop problem.

See how the bakery’s objective and resource constraints fit together in a linear programming formulation. section 1.6.1

In policy-gradient reinforcement learning, the objective J(θ) is the expected discounted cumulative reward from following a policy with parameters θ. It averages returns over possible trajectories: sequences of states, actions, and rewards. Gradient ascent adjusts θ in the direction that increases this expected return; the learning rate controls the step size. section 9.2

Different learning algorithms turn their targets into objectives differently. DQN minimizes a regression loss between a prediction and its target. Policy-gradient methods instead use an objective based on the log-probability of actions, weighted by their advantage; PPO and GRPO use a clipped surrogate to limit updates. section 12.1

How Applied Reinforcement Learning covers it

How deep it goes
Develops business formulations and the expected-return objective, then compares algorithm objectives and gradient updates.
Examples
Uses retail inventory replenishment and a two-product bakery formulation to illustrate optimization goals.
What you can do after
Evaluate and understand how objectives express business goals and guide reinforcement learning updates.
How it connects
Connects objectives to decision variables, constraints, linear programming, policy gradients, and gradient ascent.

Also explained in

Compare how 42 books explain objective function →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Applied Reinforcement Learning. The section links point to the parts of the book it draws on.