Lecture 10: Policy Classes + Robust Optimization
2
No online Quizz today, just open-end questions
The Lecture will be recorded
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Course Plan
3
DTU Compute
24 May 2023
Agenda for today
4
DTU Compute
24 May 2023
Back to the Big Picture
5
Define
Design
Evaluate
MDP
Agent
Environment
Optimizing�Decisions
Designing Policies
DTU Compute
24 May 2023
Back to the Big Picture
6
Define
Design
Evaluate
MDP
Agent
Environment
Optimizing�Decisions
Designing Policies
DTU Compute
24 May 2023
Back to the Big Picture
7
Define
Design
Evaluate
MDP
Agent
Environment
*In this course, to avoid dealing with the modeling part, we have assumed that the real system and the model you have are the same thing. They are not. So, an optimal decision for the model, does not necessarily mean an optimal (or even good) decision for the real system.
DTU Compute
24 May 2023
Back to the Big Picture
8
Define
Design
Evaluate
MDP
Agent
Environment
Actually, we can often choose the time granularity, or even construct a hierarchical combination of policies.
DTU Compute
24 May 2023
Back to the Big Picture
9
Define
Design
Evaluate
MDP
Agent
Environment
We have been assuming that states are given and observable. Actually, you can choose what you model as state variables, including hidden state variables.
DTU Compute
24 May 2023
Back to the Big Picture
10
Define
Design
Evaluate
MDP
Agent
Environment
We have been assuming that decisions are given. Actually, sometimes you can choose what levers you pull.
DTU Compute
24 May 2023
Back to the Big Picture
11
Define
Design
Evaluate
MDP
Agent
Environment
We have been assuming that the dynamics are given. Actually, you need to model them and the choice of model is a strategic one: it should be co-designed with the policy.
DTU Compute
24 May 2023
Back to the Big Picture
12
Define
Design
Evaluate
MDP
Agent
Environment
We have been assuming that the cost function is given and conducive (e.g. linear). Actually, we are often given problems that are not rigorously defined, have complex metrics (think e.g. risk), or they even feature qualitative and/or multiple objectives.
DTU Compute
24 May 2023
Agent vs Environment
13
The environment is a simulator of the real system�i.e. the agent’s action is applied to it (input) and it returns the next state and the reward (output).
The agent may internally model the environment (namely, the state dynamics) to account for the future. But it does not have perfect foresight over the future nor does it have an accurate model necessarily.
DTU Compute
24 May 2023
Agent vs Environment
14
The environment is a simulator of the real system�i.e. the agent’s action is applied to it (input) and it returns the next state and the reward (output).
The agent may internally model the environment (namely, the state dynamics) to account for the future. But it does not have perfect foresight over the future nor does it have an accurate model necessarily.
Policies should be compared under the same experiments
DTU Compute
24 May 2023
Policy Classes
15
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Policy Classes
16
Policy Class | Description | Formulation |
Direct Lookahead | Optimize Decisions over a Lookahead horizon | |
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Policy Classes
17
Policy Class | Description | Formulation |
Direct Lookahead | Optimize Decisions over a Lookahead horizon | |
Value Function Approximation | Optimize the current reward + the Value of the next state | |
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Policy Classes
18
Policy Class | Description | Formulation |
Direct Lookahead | Optimize Decisions over a Lookahead horizon | |
Value Function Approximation | Optimize the current reward + the Value of the next state | |
Policy Function Approximation | | |
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Policy Classes
19
Policy Class | Description | Formulation |
Direct Lookahead | Optimize Decisions over a Lookahead horizon | |
Value Function Approximation | Optimize the current reward + the Value of the next state | |
Policy Function Approximation | | |
Cost Function Approximation | Greedy Deterministic Optimization but imposing a heuristic Slack, or a Penalty for aggressive actions | |
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Policy Classes
20
Policy Class | Description | Formulation | Strengths |
Direct Lookahead | Optimize Decisions over a Lookahead horizon | | |
Value Function Approximation | Optimize the current reward + the Value of the next state | | |
Policy Function Approximation | | | |
Cost Function Approximation | Greedy Deterministic Optimization but imposing a heuristic Slack, or a Penalty for aggressive actions | | |
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Policy Classes
21
Policy Class | Description | Formulation | Strengths |
Direct Lookahead | Optimize Decisions over a Lookahead horizon | | Directly simulates the future, handles constraints, conceptually simple / intuitive |
Value Function Approximation | Optimize the current reward + the Value of the next state | | |
Policy Function Approximation | | | |
Cost Function Approximation | Greedy Deterministic Optimization but imposing a heuristic Slack, or a Penalty for aggressive actions | | |
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Policy Classes
22
Policy Class | Description | Formulation | Strengths |
Direct Lookahead | Optimize Decisions over a Lookahead horizon | | Directly simulates the future, handles constraints, conceptually simple / intuitive |
Value Function Approximation | Optimize the current reward + the Value of the next state | | Fast, captures long-term effects / delayed rewards, can be trained arbitrarily well (offline) |
Policy Function Approximation | | | |
Cost Function Approximation | Greedy Deterministic Optimization but imposing a heuristic Slack, or a Penalty for aggressive actions | | |
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Policy Classes
23
Policy Class | Description | Formulation | Strengths |
Direct Lookahead | Optimize Decisions over a Lookahead horizon | | Directly simulates the future, handles constraints, conceptually simple / intuitive |
Value Function Approximation | Optimize the current reward + the Value of the next state | | Fast, captures long-term effects / delayed rewards, can be trained arbitrarily well (offline) |
Policy Function Approximation | | | Very fast, parametric policy form, capitalizes on expert knowledge, relatively easy to implement/maintain. |
Cost Function Approximation | Greedy Deterministic Optimization but imposing a heuristic Slack, or a Penalty for aggressive actions | | |
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Policy Classes
24
Policy Class | Description | Formulation | Strengths |
Direct Lookahead | Optimize Decisions over a Lookahead horizon | | Directly simulates the future, handles constraints, conceptually simple / intuitive |
Value Function Approximation | Optimize the current reward + the Value of the next state | | Fast, captures long-term effects / delayed rewards, can be trained arbitrarily well (offline) |
Policy Function Approximation | | | Very fast, parametric policy form, capitalizes on expert knowledge, relatively easy to implement/maintain. |
Cost Function Approximation | Greedy Deterministic Optimization but imposing a heuristic Slack, or a Penalty for aggressive actions | | Fast, very intuitive, capitalizes on domain experience, interpretable, easy to implement/ maintain, skips modelling |
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Considerations for designing a policy
25
First of all, remember to start simple and only introduce complexity gradually as needed.
The ultimate test is evaluating and comparing policies in a good simulation environment.
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Evaluating a policy
26
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Evaluating a policy
27
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Evaluating a policy
28
Value of perfect information
Value of stochastic solution
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Evaluating a policy
29
Value of perfect information
Value of stochastic solution
+ considerations about:
modularity, maintenance/adaptability, interpretability, resilience (e.g. under failed components), and more.
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Evaluating a policy
30
How many experiments are enough?
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Evaluating a policy
31
How many experiments are enough?
Up until the distributional properties of this empirical distribution stabilize between experiments
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Evaluating a policy
32
Should we also evaluate how often the policy violates the constraints?
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Evaluating a policy
33
Generally, critical systems have backup safety protocols. So, infeasible decisions are mapped back to the feasible set through some overrule.
Should we also evaluate how often the policy violates the constraints?
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Evaluating a policy
34
Generally, critical systems have backup safety protocols. So, infeasible decisions are mapped back to the feasible set through some overrule.
However, this is tricky for intertemporal constraints, which could call for an ex-post evaluation.
Should we also evaluate how often the policy violates the constraints?
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Evaluating a policy
35
What if the environment model is wrong?
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Robust Optimization
36
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
MPC
37
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
MPC
38
L
1 2 ... 22 23 24
Forecast
Realization
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
The student’s problem revisited
39
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
The student’s problem revisited
40
Under this policy, am I guaranteed to pass the course?
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
The student’s problem revisited
41
Under this stochastic policy, am I guaranteed to pass the course now?
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
The student’s Robust Optimization problem
42
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Robust Optimization: Box Uncertainty Sets
43
Can we solve this problem?
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Robust Optimization: Box Uncertainty Sets
44
Can we solve this problem?
We have infinitely many constraints.
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Robust Optimization: Box Uncertainty Sets
45
Can we solve this problem?
We have infinitely many constraints.
But, we know what the worst-case is…
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Robust Optimization: Box Uncertainty Sets
46
Can we solve this problem?
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Robust Optimization: Box Uncertainty Sets
47
Can we solve this problem?
This is way too conservative…
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Robust Optimization: Polyhedral Uncertainty Sets
48
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Robust Optimization: Polyhedral Uncertainty Sets
49
Again, we have infinitely many constraints.
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Robust Optimization: Polyhedral Uncertainty Sets
50
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Robust Optimization: Polyhedral Uncertainty Sets
51
Again, we have infinitely many constraints.
But now, the worst-case uncertainty realization is itself an optimization problem.
So, we can get rid of the infinitely many constraints, at the expense of having an inner optimization problem.
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Robust Optimization: Polyhedral Uncertainty Sets
52
Again, we have infinitely many constraints.
But now, the worst-case uncertainty realization is itself an optimization problem.
So, we can get rid of the infinitely many constraints, at the expense of having an inner optimization problem.
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Robust Optimization: Polyhedral Uncertainty Sets
53
Again, we have infinitely many constraints.
But now, the worst-case uncertainty realization is itself an optimization problem.
So, we can get rid of the infinitely many constraints, at the expense of having an inner optimization problem.
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Robust Optimization: Polyhedral Uncertainty Sets
54
Again, we have infinitely many constraints.
But now, the worst-case uncertainty realization is itself an optimization problem.
So, we can get rid of the infinitely many constraints, at the expense of having an inner optimization optimization problem.
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Robust Optimization: Polyhedral Uncertainty Sets
55
Again, we have infinitely many constraints.
But now, the worst-case uncertainty realization is itself an optimization problem.
So, we can get rid of the infinitely many constraints, at the expense of having an inner optimization optimization problem.
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Robust Optimization: Polyhedral Uncertainty Sets
56
Again, we have infinitely many constraints.
But now, the worst-case uncertainty realization is itself an optimization problem.
So, we can get rid of the infinitely many constraints, at the expense of having an inner optimization optimization problem.
Thus, we can drop the optimization operator and we have a standard MILP
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Examples of Robust Optimization with Polyhedral Uncertainty Sets
57
Power system operation
Wind generation is geographically correlated
Weather-driven applications (e.g. farming, water dam management)
Rain is uncertain, but “budgeted” throughout a year.
Logistics (incl. airlines, tracks, inventories)
Delay events are unpredictable but “rare”.
Group for course project
People can free-ride but (hopefully) not all group members.
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Next Week: Multiple decision-makers
58
DTU Compute
24 May 2023
Questions and Survey
59
DTU Compute
24 May 2023
Game Quiz
60
DTU Compute
24 May 2023