The goal of an MDP is to find a good policy.
MDP: Definition and terminologies
In 6.390,
Recall
Recall
1️⃣ V definition
\(\mathrm{V}_h^\pi(s) := \mathbb{E}\left[\sum_{t=0}^{h-1} \gamma^t \mathrm{R}\left(s_t, \pi\left(s_t\right)\right) \mid s_0=s\right]\)
2️⃣ Bellman recursion
\(\mathrm{V}_h^\pi(s) = \mathrm{R}(s, \pi(s)) + \gamma \sum_{s^{\prime}} \mathrm{T}\left(s, \pi(s), s^{\prime}\right) \mathrm{V}_{h-1}^\pi\left(s^{\prime}\right)\)
3️⃣ Bellman equation
\(\mathrm{V}_{\infty}^\pi(s) = \mathrm{R}(s, \pi(s)) + \gamma \sum_{s^{\prime}} \mathrm{T}\left(s, \pi(s), s^{\prime}\right) \mathrm{V}_{\infty}^\pi\left(s^{\prime}\right)\)
4️⃣ optimal values
\(\mathrm{V}_h^*(s) = \max_{a} \big[\mathrm{R}(s, a) + \gamma \sum_{s'} \mathrm{T}(s, a, s') \mathrm{V}_{h-1}^*(s') \big] = \max_{a} \mathrm{Q}^*_h(s, a)\)
5️⃣ Q value iteration
\(\mathrm{Q}^*_h(s, a) = \mathrm{R}(s, a) + \gamma \sum_{s'} \mathrm{T}(s, a, s') \max_{a'} \mathrm{Q}^*_{h-1}(s', a')\)
6️⃣ optimal policy
\(\pi^*_h(s) = \arg\max_a \mathrm{Q}^*_h(s, a)\)
Mario in a grid-world v1.0
(MDP version)
e.g., \(\mathrm{T}\left(7, \uparrow, 4\right) = 1\)
\(\mathrm{T}\left(9, \rightarrow, 9\right) = 1\)
\(\mathrm{T}\left(6, \uparrow, 3\right) = 0.8\)
\(\mathrm{T}\left(6, \uparrow, 2\right) = 0.2\)
Mario in a grid-world v2.0
(RL version)
e.g., \(\mathrm{T}\left(7, \uparrow, 4\right) = ?\)
\(\mathrm{T}\left(9, \rightarrow, 9\right) = ?\)
\(\mathrm{T}\left(6, \uparrow, 3\right) = ?\)
\(\mathrm{T}\left(6, \uparrow, 2\right) = ?\)
The goal of an MDP is to find a good policy.
MDP: Definition and terminologies
Reinforcement Learning
RL
Reinforcement learning is very general:
robotics
games
social sciences
chatbots (RLHF)
health care
...
chip design
Model-based RL: Learn the MDP tuple
1. Collect experiences \((s, a, r, s^{\prime})\)
2. Estimate \(\mathrm{\hat{T}}\), \(\mathrm{\hat{R}}\)
3. Solve \(\langle\mathcal{S}, \mathcal{A}, \mathrm{\hat{T}}, \mathrm{\hat{R}}, \gamma\rangle\) via e.g. Value Iteration
\(\frac{\text{observed} (6, \uparrow, 2) } {\text{total} (6,\uparrow)\text{ play count}}\)
e.g. \({\mathrm{\hat{T}}}(6,\uparrow, 2 ) \approx \)
observed reward received from (6, \(\uparrow\))
e.g. \({\mathrm{\hat{R}}}(6,\uparrow ) =\)
\(\gamma = 0.9\)
Unknown transition:
Unknown rewards
\(\dots\)
\((1,\uparrow)\)
0
1
\((3,\uparrow)\)
1
3
\((3,\downarrow)\)
1
6
\(\dots\)
\((6,\uparrow)\)
-10
3
\(\dots\)
\((6,\uparrow)\)
-10
2
\((s, a)\)
\(r \)
\(s^{\prime}\)
\((1,\downarrow)\)
\(0\)
\(4\)
learn \(\mathrm{T}\) and \(\mathrm{R}\) first, then plan as in an MDP
learn values (or policies) directly,
without learning \(\mathrm{T}\) and \(\mathrm{R}\)
[A non-exhaustive, but useful taxonomy of algorithms in modern RL. Source]
We'll focus on tabular Q-learning
then touch on fitted
Q-learning, e.g. DQN
Direct Policy-Based
Is it possible to get an optimal policy without using transition or rewards explicitly?
Yes! We know one way already:
(Recall, from the MDP lab)
Optimal policy \(\pi^*\) easily extracted from \(\mathrm{Q}^*\):
6️⃣
\(\mathrm{Q}_{\text {new }}(s, a) \leftarrow \mathrm{R}(s, a)+\gamma \sum_{s^{\prime}} \mathrm{T}\left(s, a, s^{\prime}\right) \max _{a^{\prime}} \mathrm{Q}_{\text {old }}\left(s^{\prime}, a^{\prime}\right)\)
Value Iteration
But… we got \(\mathrm{Q}^*\) by value iteration, which uses \(\mathrm{T}\) and \(\mathrm{R}\) explicitly.
(we'll see why this fails)
\(\mathrm{Q}_{\text {new }}(s, a) \leftarrow \mathrm{R}(s, a)+\gamma \sum_{s^{\prime}} \mathrm{T}\left(s, a, s^{\prime}\right) \max _{a^{\prime}} \mathrm{Q}_{\text {old }}\left(s^{\prime}, a^{\prime}\right)\)
immediate reward
future value from \(s'\)
expected over \(s'\)
target
\(\mathrm{Q}_{\text {new }}(s, a) \leftarrow ~ r +\gamma \max _{a^{\prime}} \mathrm{Q}_{\text {old }}\left(s^{\prime}, a^{\prime}\right)\)
observed reward
future value from the observed \(s'\)
\(\mathrm{Q}_\text{old}(s, a)\)
\(\mathrm{Q}_{\text{new}}(s, a)\)
\(\dots\)
\((s, a)\)
\(r \)
\(s^{\prime}\)
\((1,\uparrow)\)
0
1
\((3,\uparrow)\)
1
3
\((3,\downarrow)\)
1
6
\(\dots\)
\((6,\uparrow)\)
-10
3
\(\dots\)
\((6,\uparrow)\)
-10
2
\(\gamma = 0.9\)
\((1,\downarrow)\)
\(0\)
\(4\)
\(\mathrm{Q}_{\text {new }}(s, a) \leftarrow ~ r +\gamma \max _{a^{\prime}} \mathrm{Q}_{\text {old }}\left(s^{\prime}, a^{\prime}\right)\)
\((6,\uparrow)\)
-10
3
\((6,\uparrow)\)
-10
2
\(\mathrm{Q}_{\text{old}}\) is all zeros, so every update is just the reward:
\(\mathrm{Q}_{\text{new}}(s,a) \leftarrow r + \gamma \cdot 0 = r\)
e.g. \((3,\uparrow)\): \(1 + 0.9 \times 0 = 1\); \((6,\uparrow)\): \(-10 + 0.9 \times 0 = -10\)
\(\mathrm{Q}_\text{old}(s, a)\)
\(\mathrm{Q}_{\text{new}}(s, a)\)
\(\mathrm{Q}_{\text {new }}(s, a) \leftarrow ~ r +\gamma \max _{a^{\prime}} \mathrm{Q}_{\text {old }}\left(s^{\prime}, a^{\prime}\right)\)
\((6,\uparrow)\)
-10
3
\(\mathrm{Q}_{\text {new }}(6, \uparrow) \leftarrow\)
\(-10 +\gamma \max _{a^{\prime}} \mathrm{Q}_{\text {old }}\left(3, a^{\prime}\right)\)
\(=-10 + 0.9\mkern1.5mu{\times}\mkern1.5mu1 = -9.1 \)
\(\gamma = 0.9\)
\((s, a)\)
\(r \)
\(s^{\prime}\)
\(\dots\)
\((6,\uparrow)\)
-10
2
\(\dots\)
\((6,\uparrow)\)
-10
3
\((6,\uparrow)\)
-10
2
\((6,\uparrow)\)
-10
3
\(\mathrm{Q}_\text{old}(s, a)\)
\(\mathrm{Q}_{\text{new}}(s, a)\)
\((s, a)\)
\(r \)
\(s^{\prime}\)
\(\mathrm{Q}_{\text {new }}(s, a) \leftarrow ~ r +\gamma \max _{a^{\prime}} \mathrm{Q}_{\text {old }}\left(s^{\prime}, a^{\prime}\right)\)
\(\gamma = 0.9\)
\(\dots\)
\((6,\uparrow)\)
-10
2
\((6,\uparrow)\)
-10
2
\((6,\uparrow)\)
-10
3
\((6,\uparrow)\)
-10
2
\((6,\uparrow)\)
-10
3
\(\mathrm{Q}_{\text {new }}(6, \uparrow) \leftarrow\)
\(-10 +\gamma \max _{a^{\prime}} \mathrm{Q}_{\text {old }}\left(2, a^{\prime}\right)\)
\(=-10 + 0.9\mkern1.5mu{\times}\mkern1.5mu0 = -10 \)
\(\dots\)
\(\gamma = 0.9\)
\(\mathrm{Q}_{\text {new }}(6, \uparrow) \leftarrow\)
\(-10 +\gamma \max _{a^{\prime}} \mathrm{Q}_{\text {old }}\left(2, a^{\prime}\right)\)
\(=-10 + 0.9\mkern1.5mu{\times}\mkern1.5mu0 = -10 \)
🥺 Simply committing to the new keeps "washing away" the old belief
target
Whenever observe \((6, \uparrow),\) -10, 3:
Whenever observe \((6, \uparrow),\) -10, 2:
\(\mathrm{Q}_{\text {new }}(6, \uparrow) \leftarrow\)
\(-10 +\gamma \max _{a^{\prime}} \mathrm{Q}_{\text {old }}\left(3, a^{\prime}\right)\)
\(=-10 + 0.9\mkern1.5mu{\times}\mkern1.5mu1 = -9.1 \)
\(\mathrm{Q}_{\text {new }}(s, a) \leftarrow ~ r +\gamma \max _{a^{\prime}} \mathrm{Q}_{\text {old }}\left(s^{\prime}, a^{\prime}\right)\)
\(\mathrm{Q}_{\text {new }}(s, a) \leftarrow ~ r +\gamma \max _{a^{\prime}} \mathrm{Q}_{\text {old }}\left(s^{\prime}, a^{\prime}\right)\)
target
\((s, a)\)
\(r \)
\(s^{\prime}\)
\(\dots\)
\((6,\uparrow)\)
-10
2
\((6,\uparrow)\)
-10
3
\((6,\uparrow)\)
-10
2
\((6,\uparrow)\)
-10
3
\(\dots\)
😍 The core update rule of Q-learning: merge old belief and new evidence
\(r +\gamma \max _{a^{\prime}} \mathrm{Q}_{\text {old }}\left(s^{\prime}, a^{\prime}\right)\)
\(\mathrm{Q}_{\text {new }}(s, a) ~ \leftarrow ~ \)
\((1- \quad ) \)
\(\mathrm{Q}_{\text {old }}(s, a)\)
\(+\)
learning rate
target
old belief
\(+\)
learning rate
\((1- \qquad \qquad \qquad ) \)
\(\mathrm{Q}_\text{old}(s, a)\)
\(\mathrm{Q}_{\text{new}}(s, a)\)
\(\mathrm{Q}_{\text {new }}(s, a) \leftarrow\)
\((1-\phantom{\alpha})\)
\(\alpha\)
\(\mathrm{Q}_{\text {old }}(s, a)\)
\(+\)
\(\alpha\)
\((\)
\(r +\gamma \max _{a^{\prime}} \mathrm{Q}_{\text {old }}\left(s^{\prime}, a^{\prime}\right)\)
\()\)
\(\gamma = 0.9\)
\(\alpha = 0.7\)
\(\mathrm{Q}_{\text {new }}(3, \uparrow) \leftarrow (1-0.7) \mathrm{Q}_{\text {old }}(3, \uparrow)+0.7\left(1+ 0.9\max _{a^{\prime}} \mathrm{Q}_{\text {old }}\left(3, a^{\prime}\right)\right)\)
\(= (1-0.7)\mkern1.5mu{\times}\mkern1.5mu0 + 0.7\mkern1.5mu{\times}\mkern1.5mu( 1 + 0.9\mkern1.5mu{\times}\mkern1.5mu0) = 0.7\)
\((s, a)\)
\(r \)
\(s^{\prime}\)
\((1,\uparrow)\)
0
1
\((3,\uparrow)\)
1
3
\((6,\uparrow)\)
-10
3
\((6,\uparrow)\)
-10
2
\((6,\uparrow)\)
-10
3
\((6,\uparrow)\)
-10
2
\((s, a)\)
\(r \)
\(s^{\prime}\)
\(\mathrm{Q}_\text{old}(s, a)\)
\(\mathrm{Q}_{\text{new}}(s, a)\)
\(\mathrm{Q}_{\text {new }}(s, a) \leftarrow\)
\((1-\phantom{\alpha})\)
\(\alpha\)
\(\mathrm{Q}_{\text {old }}(s, a)\)
\(+\)
\(\alpha\)
\((\)
\(r +\gamma \max _{a^{\prime}} \mathrm{Q}_{\text {old }}\left(s^{\prime}, a^{\prime}\right)\)
\()\)
\(\alpha = 0.7\)
\(\gamma = 0.9\)
\(\mathrm{Q}_{\text {new }}(6, \uparrow) \leftarrow (1-0.7) \mathrm{Q}_{\text {old }}(6, \uparrow)+0.7\left(-10+ 0.9\max _{a^{\prime}} \mathrm{Q}_{\text {old }}\left(3, a^{\prime}\right)\right)\)
\(= (1-0.7)\mkern1.5mu{\times}\mkern1.5mu0 + 0.7\mkern1.5mu{\times}\mkern1.5mu( -10 + 0.9\mkern1.5mu{\times}\mkern1.5mu0.7) = -6.56\)
\((s, a)\)
\(r \)
\(s^{\prime}\)
\((1,\uparrow)\)
0
1
\((3,\uparrow)\)
1
3
\((6,\uparrow)\)
-10
3
\((6,\uparrow)\)
-10
2
\((6,\uparrow)\)
-10
3
\((6,\uparrow)\)
-10
2
\((s, a)\)
\(r \)
\(s^{\prime}\)
\(\mathrm{Q}_\text{old}(s, a)\)
\(\mathrm{Q}_{\text{new}}(s, a)\)
\(\mathrm{Q}_{\text {new }}(s, a) \leftarrow\)
\((1-\phantom{\alpha})\)
\(\alpha\)
\(\mathrm{Q}_{\text {old }}(s, a)\)
\(+\)
\(\alpha\)
\((\)
\(r +\gamma \max _{a^{\prime}} \mathrm{Q}_{\text {old }}\left(s^{\prime}, a^{\prime}\right)\)
\()\)
\(\gamma = 0.9\)
\(\alpha = 0.7\)
\(\mathrm{Q}_{\text {new }}(6, \uparrow) \leftarrow (1-0.7) \mathrm{Q}_{\text {old }}(6, \uparrow)+0.7\left(-10+ 0.9\max _{a^{\prime}} \mathrm{Q}_{\text {old }}\left(2, a^{\prime}\right)\right)\)
\(= (1-0.7)\mkern1.5mu{\times}\mkern1.5mu{-}6.56 + 0.7\mkern1.5mu{\times}\mkern1.5mu( -10 + 0.9\mkern1.5mu{\times}\mkern1.5mu0) = -8.97\)
\((s, a)\)
\(r \)
\(s^{\prime}\)
\((1,\uparrow)\)
0
1
\((3,\uparrow)\)
1
3
\((6,\uparrow)\)
-10
3
\((6,\uparrow)\)
-10
2
\((6,\uparrow)\)
-10
3
\((6,\uparrow)\)
-10
2
\((s, a)\)
\(r \)
\(s^{\prime}\)
\(\mathrm{Q}_\text{old}(s, a)\)
\(\mathrm{Q}_{\text{new}}(s, a)\)
\(\mathrm{Q}_{\text {new }}(s, a) \leftarrow\)
\((1-\phantom{\alpha})\)
\(\alpha\)
\(\mathrm{Q}_{\text {old }}(s, a)\)
\(+\)
\(\alpha\)
\((\)
\(r +\gamma \max _{a^{\prime}} \mathrm{Q}_{\text {old }}\left(s^{\prime}, a^{\prime}\right)\)
\()\)
\(\gamma = 0.9\)
\(\alpha = 0.7\)
\(\mathrm{Q}_{\text {new }}(6, \uparrow) \leftarrow (1-0.7) \mathrm{Q}_{\text {old }}(6, \uparrow)+0.7\left(-10+ 0.9\max _{a^{\prime}} \mathrm{Q}_{\text {old }}\left(3, a^{\prime}\right)\right)\)
\(= (1-0.7)\mkern1.5mu{\times}\mkern1.5mu{-}8.97 + 0.7\mkern1.5mu{\times}\mkern1.5mu( -10 + 0.9\mkern1.5mu{\times}\mkern1.5mu0.7) = -9.25\)
\((s, a)\)
\(r \)
\(s^{\prime}\)
\((1,\uparrow)\)
0
1
\((3,\uparrow)\)
1
3
\((6,\uparrow)\)
-10
3
\((6,\uparrow)\)
-10
2
\((6,\uparrow)\)
-10
3
\((6,\uparrow)\)
-10
2
\((s, a)\)
\(r \)
\(s^{\prime}\)
Check-in: which numbers go where?
\(\mathrm{Q}_{\text {new }}(s, a) \leftarrow (1-\alpha) \mathrm{Q}_{\text {old }}(s, a)+\alpha\left(r+\gamma \max _{a^{\prime}} \mathrm{Q}_{\text {old }}\left(s^{\prime}, a^{\prime}\right)\right)\)
It depends on the goal:
The fundamental dilemma in reinforcement learning... and in life!
\(\epsilon\) trades off exploration versus exploitation.
During learning, especially in early stages, we'd like to explore and observe diverse \((s,a\)) consequences.
During later stages, we can act more greedily w.r.t. the current estimated Q values
\(\epsilon\)-greedy action selection strategy
the name is flipped: \(\epsilon\)-greedy means greedy with probability \((1-\epsilon)\).
Value Iteration\((\mathcal{S}, \mathcal{A}, \mathrm{T}, \mathrm{R}, \gamma, \epsilon)\)
"calculating"
"learning" (estimating)
Q-Learning \(\left(\mathcal{S}, \mathcal{A}, \gamma, \alpha, s_0,\right. \text{max-iter})\)
1. \(i=0\)
2. for \(s \in \mathcal{S}, a \in \mathcal{A}:\)
3. \({\mathrm{Q}_\text{old}}(s, a) = 0\)
4. \(s \leftarrow s_0\)
5. while \(i < \text{max-iter}:\)
6. \(a \gets \text{select}\_\text{action}(s, {\mathrm{Q}_\text{old}}(s, a))\)
7. \(r,s' \gets \text{execute}(a)\)
8. \({\mathrm{Q}}_{\text{new}}(s, a) \leftarrow (1-\alpha){\mathrm{Q}}_{\text{old}}(s, a) + \alpha(r + \gamma \max_{a'}{\mathrm{Q}}_{\text{old}}(s', a'))\)
9. \(s \leftarrow s'\)
10. \(i \leftarrow (i+1)\)
11. \(\mathrm{Q}_{\text{old}} \leftarrow \mathrm{Q}_{\text{new}}\)
12. return \(\mathrm{Q}_{\text{new}}\)
"learning"
Q-Learning \(\left(\mathcal{S}, \mathcal{A}, \gamma, \alpha, s_0,\right. \text{max-iter})\)
1. \(i=0\)
2. for \(s \in \mathcal{S}, a \in \mathcal{A}:\)
3. \({\mathrm{Q}_\text{old}}(s, a) = 0\)
4. \(s \leftarrow s_0\)
5. while \(i < \text{max-iter}:\)
6. \(a \gets \text{select}\_\text{action}(s, {\mathrm{Q}_\text{old}}(s, a))\)
7. \(r,s' \gets \text{execute}(a)\)
8. \({\mathrm{Q}}_{\text{new}}(s, a) \leftarrow (1-\alpha){\mathrm{Q}}_{\text{old}}(s, a) + \alpha(r + \gamma \max_{a'}{\mathrm{Q}}_{\text{old}}(s', a'))\)
9. \(s \leftarrow s'\)
10. \(i \leftarrow (i+1)\)
11. \(\mathrm{Q}_{\text{old}} \leftarrow \mathrm{Q}_{\text{new}}\)
12. return \(\mathrm{Q}_{\text{new}}\)
given that we visit all \(s,a\) infinitely often, and decay the learning rate \(\alpha\) as in SGD.
Continuous state and action space
\(10^{16992}\) (pixels) states
Fitted Q-learning: from table to functions
What changes: the table becomes a function
tabular: look up \(\mathrm{Q}(s,a)\)
⟹
scale up:
large/continuous \(\mathcal{S}\), \(\mathcal{A}\)
fitted: compute \(\mathrm{Q}_\theta(s,a)\)
\(\mathrm{Q}_\theta\)
features
\(\mathrm{Q}_\theta(s,a) =\)
parameters
raw numbers
\(\theta^\top [\,s,\ a\,]\)
\(2\)
one-hot of \(s\), one-hot of \(a\)
\(\theta^\top [\,\text{onehot}(s),\ \text{onehot}(a)\,]\)
\(9 + 4 = 13\)
one-hot of the \((s,a)\) pair
\(\theta^\top \text{onehot}(s,a)\)
\(9 \times 4 = 36\)
learned, from \((s,a)\)
\(\text{network}(s,a;\,\theta)\)
our choice
If \(\mathrm{Q}^*\) were given, fitting \(\mathrm{Q}_\theta\) is plain regression
⟹
target
\(= \; r + \gamma \max_{a'} \mathrm{Q}_\theta(s', a')\)
plane: the best fit with raw-number features, \(\theta^\top[\,s,\ a\,]\)
is equivalent to:
\(\mathrm{Q}_{\text {new}}(s, a) \leftarrow \mathrm{Q}_{\text {old }}(s, a)+\alpha\,\big(\,\text{target} - \mathrm{Q}_{\text {old }}(s, a)\,\big)\)
\(\theta_{\text{new}} \leftarrow \theta_{\text{old}} + \eta (\text{target} - \text{guess}_{\theta})\nabla_{\theta}\text{guess}\)
One experience, \((s,a,r,s') = (6,\uparrow,-10,3)\), two methods
before
tabular \((\alpha = 1)\)
\(\mathrm{Q}(6,\uparrow) \leftarrow \mathrm{Q}(6,\uparrow) + \alpha\,\big(\text{target} - \mathrm{Q}(6,\uparrow)\big)\)
36 numbers; green: the entry we update
fitted \((\eta = 0.01)\)
\(\theta \leftarrow \theta + \eta\,\big(\text{target} - \mathrm{Q}_\theta(6,\uparrow)\big)\,\nabla_\theta \mathrm{Q}_\theta(6,\uparrow)\)
plane: \(\mathrm{Q}_\theta = \theta^\top[\,s,\ a\,]\) dots: targets
green: the one we regress onto
What does one update change?
One experience, \((s,a,r,s') = (6,\uparrow,-10,3)\), two methods
after one update
tabular \((\alpha = 1)\)
\(\mathrm{Q}(6,\uparrow) \leftarrow \mathrm{Q}(6,\uparrow) + \alpha\,\big(\text{target} - \mathrm{Q}(6,\uparrow)\big)\)
one number changed
fitted \((\eta = 0.01)\)
\(\theta \leftarrow \theta + \eta\,\big(\text{target} - \mathrm{Q}_\theta(6,\uparrow)\big)\,\nabla_\theta \mathrm{Q}_\theta(6,\uparrow)\)
the plane tilted, and every dot moved,
not just the one we meant to fit
(faint dashed plane and dots: before the update)
With shared \(\theta\), one update moves every value, and so every target.
No convergence guarantee.
[DQN Breakout, Google DeepMind]
No guarantee, yet it can work: DQN, with a replay memory to steady the chase.
[Slide Credit: Yann LeCun]
🌭
current prediction \(g=\text{softmax}(\cdot)\)
To reduce the loss, \(\theta\) needs to change so \(g_{\text{hotdog}}\) can go up.
This signal (from the true label \(y\)) backprop to \(\theta\) through \(-\!\log\) and softmax, so we can optimize via gradient descent.
Policy gradient, another model-free RL algorithm, is also similar to supervised learning. E.g., recall:
🤷 ↑ ? ↓
[image edited from: Andrej Karpathy]
2. Run \(\pi_\theta\) for a while. Keep track of the return.
Policy gradients:
1. Parametrize the policy \(\pi\) with \(\theta.\)
3. Update \(\theta\) so "good" trajectories more likely to happen.