#separator:tab
#html:true
#notetype:Cloze
#tags column:3
{{c1::Supervised learning}} learns from labeled examples provided by an external supervisor. It's powerful, but in interactive settings you often can't get correct labeled examples for every situation the agent might face.	Section: Reinforcement Learning › How RL Differs from Other ML Paradigms	rl ch01 reinforcement_learning how_rl_differs_from_other_ml_paradigms
{{c1::Unsupervised learning}} finds hidden structure in unlabeled data. RL isn't trying to find structure, instead it's trying to maximize a reward signal. The two are genuinely different objectives.	Section: Reinforcement Learning › How RL Differs from Other ML Paradigms	rl ch01 reinforcement_learning how_rl_differs_from_other_ml_paradigms
RL is therefore a {{c1::third paradigm}}, distinct from both: no supervisor and no labels, only a reward signal from the environment.	Section: Reinforcement Learning › How RL Differs from Other ML Paradigms	rl ch01 reinforcement_learning how_rl_differs_from_other_ml_paradigms
{{c1::Exploitation}}: doing what you already know works, to rack up reward now.	Section: Reinforcement Learning › The Exploration-Exploitation Tradeoff	rl ch01 reinforcement_learning the_exploration_exploitation_tradeoff
{{c1::Exploration}}: trying new things, to potentially discover something better.	Section: Reinforcement Learning › The Exploration-Exploitation Tradeoff	rl ch01 reinforcement_learning the_exploration_exploitation_tradeoff
It addresses the classical {{c1::curse of dimensionality}} from operations research and control theory through function approximation.	Section: Reinforcement Learning › Connections Beyond Engineering	rl ch01 reinforcement_learning connections_beyond_engineering
It has deep ties to {{c1::psychology and neuroscience}}: many core RL algorithms were inspired by biological learning, and RL has in turn produced influential models of animal learning and the brain's reward system (covered in Chapters 14 &amp; 15).	Section: Reinforcement Learning › Connections Beyond Engineering	rl ch01 reinforcement_learning connections_beyond_engineering
More broadly, RL is part of a trend in AI focusing back towards {{c1::simple, general principles}} (search, learning, decision making) rather than the "vast bag of special-case tricks" view that dominated parts of the field in earlier decades.	Section: Reinforcement Learning › Connections Beyond Engineering	rl ch01 reinforcement_learning connections_beyond_engineering
A {{c1::chess player}} decides on a move, weighing plans, counterplans, and immediate intuitions about which positions look promising.	Section: Examples	rl ch01 examples
An {{c1::adaptive controller}} tunes a petroleum refinery's parameters in real time, optimizing the yield/cost/quality tradeoff without rigidly following engineer-set points.	Section: Examples	rl ch01 examples
A {{c1::gazelle calf}} struggles to stand minutes after birth and is running at 20 mph half an hour later.	Section: Examples	rl ch01 examples
A {{c1::mobile robot}} decides whether to keep searching for trash or head back to its recharging station, based on battery level and past experience finding the charger.	Section: Examples	rl ch01 examples
{{c1::Phil makes breakfast}}. Even this mundane task involves a complex web of subgoals, conditional actions, eye movements, object manipulation, and real-time judgment calls; all in service of a goal Phil may not even be consciously tracking.	Section: Examples	rl ch01 examples
There's always an {{c1::active agent}} making decisions in an environment, under uncertainty, toward a goal.	Section: Examples	rl ch01 examples
Actions have {{c1::consequences that extend into the future}}, they change the state of the environment, which changes what options are available later.	Section: Examples	rl ch01 examples
Good decisions require {{c1::foresight}}: accounting for indirect and delayed effects, not just immediate outcomes.	Section: Examples	rl ch01 examples
The environment can't be fully predicted, so the agent has to {{c1::keep sensing and adapting}}. Phil has to watch the milk as he pours it.	Section: Examples	rl ch01 examples
Goals are {{c1::explicit and measurable}}: the chess player knows if they won, the robot knows when the battery dies, Phil knows if breakfast was good.	Section: Examples	rl ch01 examples
Critically, all these agents {{c1::improve with experience}}: the chess player sharpens intuition, the gazelle gets more efficient, Phil streamlines his morning routine.	Section: Examples	rl ch01 examples
{{c1::Minimax}} (game theory): assumes the opponent plays optimally. If our opponent is imperfect, minimax leaves wins on the table.	Section: An Extended Example: Tic-Tac-Toe › Why Classical Methods Fall Short	rl ch01 an_extended_example_tic_tac_toe why_classical_methods_fall_short
{{c1::Dynamic programming}}: can find an optimal strategy against any opponent, but requires a complete model of that opponent upfront (probabilities for every move in every state). We usually don't have that.	Section: An Extended Example: Tic-Tac-Toe › Why Classical Methods Fall Short	rl ch01 an_extended_example_tic_tac_toe why_classical_methods_fall_short
{{c1::Learning the opponent model first, then applying DP}}: closer, but now you're essentially doing RL anyway.	Section: An Extended Example: Tic-Tac-Toe › Why Classical Methods Fall Short	rl ch01 an_extended_example_tic_tac_toe why_classical_methods_fall_short
{{c1::Value function methods beat evolutionary methods}} at exploiting what happens during a game. Individual states and moves can be evaluated and credited, not just the final outcome.	Section: An Extended Example: Tic-Tac-Toe › What This Example Shows	rl ch01 an_extended_example_tic_tac_toe what_this_example_shows
The RL player naturally develops {{c1::multi-step planning}} behavior (setting traps for shortsighted opponents) without an explicit search or a model of the opponent. Foresight emerges from learning.	Section: An Extended Example: Tic-Tac-Toe › What This Example Shows	rl ch01 an_extended_example_tic_tac_toe what_this_example_shows
{{c1::Exploration vs. exploitation}} is built in: mostly greedy, occasionally random.	Section: An Extended Example: Tic-Tac-Toe › What This Example Shows	rl ch01 an_extended_example_tic_tac_toe what_this_example_shows
{{c1::Continuous problems}}: no discrete episodes, rewards can come at any time.	Section: An Extended Example: Tic-Tac-Toe › What Tic-Tac-Toe Doesn't Capture (But RL Handles Anyway)	rl ch01 an_extended_example_tic_tac_toe what_tic_tac_toe_doesn_t_capture_but_rl_
{{c1::Huge or infinite state spaces}}: Tesauro's TD-Gammon combined this exact algorithm with a neural network to master backgammon (~\(10^{20}\) states), eventually surpassing the world's best human players (Section 16.1). Generalization from experience through function approximation is what makes this possible.	Section: An Extended Example: Tic-Tac-Toe › What Tic-Tac-Toe Doesn't Capture (But RL Handles Anyway)	rl ch01 an_extended_example_tic_tac_toe what_tic_tac_toe_doesn_t_capture_but_rl_
{{c1::Partial observability}}: RL works even when the agent can't see the full state.	Section: An Extended Example: Tic-Tac-Toe › What Tic-Tac-Toe Doesn't Capture (But RL Handles Anyway)	rl ch01 an_extended_example_tic_tac_toe what_tic_tac_toe_doesn_t_capture_but_rl_
{{c1::No model required}}: the tic-tac-toe player has no model of its opponent whatsoever and still learns to beat it. Model-free methods are often simpler, more robust when accurate models are hard to build, and important building blocks for model-based methods.	Section: An Extended Example: Tic-Tac-Toe › What Tic-Tac-Toe Doesn't Capture (But RL Handles Anyway)	rl ch01 an_extended_example_tic_tac_toe what_tic_tac_toe_doesn_t_capture_but_rl_
{{c1::Prior knowledge}}: RL doesn't require starting from scratch, prior information can be incorporated in many ways (Sections 9.5, 13.1, 17.4).	Section: An Extended Example: Tic-Tac-Toe › What Tic-Tac-Toe Doesn't Capture (But RL Handles Anyway)	rl ch01 an_extended_example_tic_tac_toe what_tic_tac_toe_doesn_t_capture_but_rl_
{{c1::Hierarchical learning}}: RL can operate at multiple levels simultaneously, where each "action" at a higher level is itself a complex problem-solving procedure.	Section: An Extended Example: Tic-Tac-Toe › What Tic-Tac-Toe Doesn't Capture (But RL Handles Anyway)	rl ch01 an_extended_example_tic_tac_toe what_tic_tac_toe_doesn_t_capture_but_rl_
{{c1::Agent}} learns from interaction, not supervision.	Section: Summary	rl ch01 summary
{{c1::MDP}} formalizes the problem.	Section: Summary	rl ch01 summary
{{c1::Value functions}} make the search tractable.	Section: Summary	rl ch01 summary
The {{c1::Bellman equation}}: a functional equation defining optimal value	Section: Early History of Reinforcement Learning › Thread 2: Optimal Control and Dynamic Programming	rl ch01 early_history_of_reinforcement_learning thread_2_optimal_control_and_dynamic_pro
{{c1::Dynamic programming (DP)}}: the class of methods for solving it	Section: Early History of Reinforcement Learning › Thread 2: Optimal Control and Dynamic Programming	rl ch01 early_history_of_reinforcement_learning thread_2_optimal_control_and_dynamic_pro
{{c1::Markov Decision Processes (MDPs)}}: the discrete stochastic version of optimal control	Section: Early History of Reinforcement Learning › Thread 2: Optimal Control and Dynamic Programming	rl ch01 early_history_of_reinforcement_learning thread_2_optimal_control_and_dynamic_pro
{{c1::Arthur Samuel}} (1959) was the first to implement a TD-like idea computationally, in his checkers-playing program, though he didn't connect it to animal learning or to Bellman's work.	Section: Early History of Reinforcement Learning › Thread 3: Temporal-Difference Learning	rl ch01 early_history_of_reinforcement_learning thread_3_temporal_difference_learning
{{c1::Minsky}} (1961) later drew the connection to secondary reinforcement.	Section: Early History of Reinforcement Learning › Thread 3: Temporal-Difference Learning	rl ch01 early_history_of_reinforcement_learning thread_3_temporal_difference_learning
{{c1::Sutton}} (1978) formalized TD learning and linked it to animal conditioning models.	Section: Early History of Reinforcement Learning › Thread 3: Temporal-Difference Learning	rl ch01 early_history_of_reinforcement_learning thread_3_temporal_difference_learning
{{c1::Sutton and Barto}} (1981) produced an influential psychological model of classical conditioning based on TD.	Section: Early History of Reinforcement Learning › Thread 3: Temporal-Difference Learning	rl ch01 early_history_of_reinforcement_learning thread_3_temporal_difference_learning
{{c1::TD-Gammon}} (Tesauro, 1992), backgammon at superhuman level using TD + neural networks, brought wide attention to RL.	Section: Early History of Reinforcement Learning › Convergence	rl ch01 early_history_of_reinforcement_learning convergence
Neuroscience found a striking parallel between TD algorithms and the behavior of {{c1::dopamine-producing neurons}} in the brain (Montague, Dayan &amp; Sejnowski, 1996; Schultz, Dayan &amp; Montague, 1997), launching a productive dialogue between RL and neuroscience covered in Chapter 15.	Section: Early History of Reinforcement Learning › Convergence	rl ch01 early_history_of_reinforcement_learning convergence
{{c1::Exploitation}}: always selecting the greedy actions (actions with highest estimated value)	Section: The \(k\)-armed Bandit Problem	rl ch02 the_armed_bandit_problem
{{c1::Exploration}}: selecting one of the nongreedy actions	Section: The \(k\)-armed Bandit Problem	rl ch02 the_armed_bandit_problem
There exists an {{c1::Exploration-Exploitation tradeoff}}	Section: The \(k\)-armed Bandit Problem	rl ch02 the_armed_bandit_problem
Let's go through how we can estimate our action-value, \(Q_t(a)\). One method is by averaging the rewards that have been received ({{c1::Sample average}})	Section: Action-value Methods	rl ch02 action_value_methods
Instead of storing all the \(R\) values and recomputing the sum at every time step, we can derive an {{c1::incremental update rule}}: \(Q_n\) estimate can be updated efficiently without storing the full history.	Section: Incremental Implementation	rl ch02 incremental_implementation
This is a {{c1::weighted average}} , which gives priority/higher value to more recently acquired rewards.	Section: Tracking a Nonstationary Problem › Exponential recency-weighted average	rl ch02 tracking_a_nonstationary_problem exponential_recency_weighted_average
The weighted average is more specifically called an {{c1::exponential recency-weighted average}} because the weight decays exponentially into the past according to the exponent on \((1 - \alpha)\), \((n - i)\).	Section: Tracking a Nonstationary Problem › Exponential recency-weighted average	rl ch02 tracking_a_nonstationary_problem exponential_recency_weighted_average
(+) It is {{c1::effective on stationary problems}}, but not a general approach	Section: Optimistic Initial Values › Pros &amp; Cons	rl ch02 optimistic_initial_values pros_cons
(-) It is {{c1::not good for nonstationary problems}} because its drive for exploration is inherently temporary.	Section: Optimistic Initial Values › Pros &amp; Cons	rl ch02 optimistic_initial_values pros_cons
A smarter approach is {{c1::Upper Confidence Bound (UCB)}} action selection, which favors non-greedy actions based on both how close their value estimates are to the maximum and how uncertain those estimates are.	Section: Upper-Confidence-Bound (UCB) Action Selection	rl ch02 upper_confidence_bound_ucb_action_select
(-) UCB is more difficult than \(\varepsilon\)-greedy to {{c1::extend beyond bandits}} to the more general RL settings	Section: Upper-Confidence-Bound (UCB) Action Selection › Pros &amp; Cons	rl ch02 upper_confidence_bound_ucb_action_select pros_cons
(-) Difficulty in dealing with {{c1::nonstationary problems}}	Section: Upper-Confidence-Bound (UCB) Action Selection › Pros &amp; Cons	rl ch02 upper_confidence_bound_ucb_action_select pros_cons
(-) Difficulty in dealing with {{c1::large state spaces}} (especially function approximation)	Section: Upper-Confidence-Bound (UCB) Action Selection › Pros &amp; Cons	rl ch02 upper_confidence_bound_ucb_action_select pros_cons
Another action selection method, which isn't based on action-value estimation, entails learning a numerical {{c1::preference}} for each action \(a\), which is denoted as \(H_t(a)\).	Section: Gradient Bandit Algorithms	rl ch02 gradient_bandit_algorithms
The relative preference of one action over another is more important, hence why we define the action probabilities by a {{c1::soft-max distribution}} (i.e., Gibbs or Boltzmann):	Section: Gradient Bandit Algorithms	rl ch02 gradient_bandit_algorithms
The action preferences are updated via {{c1::stochastic gradient ascent}}:	Section: Gradient Bandit Algorithms	rl ch02 gradient_bandit_algorithms
{{c1::Nonassociative tasks}}: tasks where there is no need to associate different actions with different situations.	Section: Associative Search (Contextual Bandits)	rl ch02 associative_search_contextual_bandits
{{c1::Associative Search}}: extend nonassociative tasks to the associative setting.	Section: Associative Search (Contextual Bandits)<br>• Consider a setting where the bandit task changes from step to step, but the value distributions of the arms within each task remain fixed.<br>• These are called associative search tasks, or contextual bandits, where the agent must learn to associate different policies with different task contexts.	rl ch02 associative_search_contextual_bandits
These tasks involve both trial &amp; error learning to search for the best actions &amp; {{c1::association}} of these actions with the situations in which they are best	Section: Associative Search (Contextual Bandits)	rl ch02 associative_search_contextual_bandits
{{c1::Full RL problem}}: Actions are allowed to affect the next situation as well as the reward.	Section: Associative Search (Contextual Bandits)	rl ch02 associative_search_contextual_bandits
Action values \(Q_t(a)\) can be estimated online via {{c1::incremental updates}}, keeping memory and per-step computation constant rather than storing every historical reward.	Section: Summary	rl ch02 summary
Stationary tasks suit decaying \(1/n\) step sizes, whereas {{c1::nonstationary tasks}} call for constant step sizes \(\alpha\) that exponentially down-weight older returns.	Section: Summary	rl ch02 summary
Comparing algorithms cleanly across hyperparameter choices requires {{c1::parameter studies}} (plotting average reward over a wide log-spaced parameter sweep), which typically reveal an inverted-U sweet spot for every method.	Section: Summary	rl ch02 summary
Bayesian methods such as {{c1::Gittins indices}} and Thompson (posterior) sampling formulate optimal exploration over belief states, connecting single-state bandit problems directly to full sequential RL (see Sutton &amp; Barto, 2018, §2.10).	Section: Summary	rl ch02 summary
To build the full reinforcement learning (RL) problem's mathematical structure, key elements are introduced: {{c1::returns, value functions, &amp; Bellman equations}}.		rl ch03
The MDP and agent together yield a recurring sequence of \(S_t, A_t, R_{t+1}, S_{t+1}\) or a {{c1::trajectory}} when expanded out for all the time steps	Section: The Agent-Environment Interface	rl ch03 the_agent_environment_interface
In a {{c1::finite}} MDP, the sets of states \(S\), actions \(A\), and rewards \(R\) are all finite. The random variables \(S_t\) and \(R_t\) have well-defined discrete probability distributions dependent only on the preceding state and action, this is the Markov property.	Section: The Agent-Environment Interface › Dynamics function	rl ch03 the_agent_environment_interface dynamics_function
This idea was formalized by the {{c1::reward hypothesis}}.	Section: Goals &amp; Rewards	rl ch03 goals_rewards
The formal definition of the maximization of the cumulative reward received by the agent in the long run leads to the {{c1::expected return}}, \(G_t\) we want to maximize:	Section: Returns &amp; Episodes	rl ch03 returns_episodes
{{c1::Episodic tasks}}: Tasks with episodes that have a terminal state, \(S_T\)	Section: Returns &amp; Episodes	rl ch03 returns_episodes
{{c1::Continuing tasks}}: Tasks with no terminal state (\(T_{\text{final}} = \infty\))	Section: Returns &amp; Episodes	rl ch03 returns_episodes
We can unify the notations for expected return for episodic and continuing tasks into a single notation by considering episode termination to be the entering of a {{c1::special absorbing state}} that transitions only to itself and that generates only rewards of \(0\). For example, lets consider the state transtion diagram:	Section: Unified Notation for Episodic &amp; Continuing Tasks	rl ch03 unified_notation_for_episodic_continuing
Value functions are defined w.r.t. particular ways of acting, called {{c1::policies}}.	Section: Policies, Value Functions &amp; Bellman Equations	rl ch03 policies_value_functions_bellman_equatio
A {{c1::Policy}} is a mapping from states to probabilities of selecting each possible action.	Section: Policies, Value Functions &amp; Bellman Equations	rl ch03 policies_value_functions_bellman_equatio
Recursive self-consistency conditions that must be satisfied by value functions for any policy and state in reinforcement learning and dynamic programming (DP) are called {{c1::Bellman equations}}.	Section: Policies, Value Functions &amp; Bellman Equations › Bellman Equation for \(v_\pi\)	rl ch03 policies_value_functions_bellman_equatio bellman_equation_for
This is the {{c1::Bellman Equation for \(v_\pi\)}}. It expresses the relationship between the value of a state and the value of its successor states.	Section: Policies, Value Functions &amp; Bellman Equations › Bellman Equation for \(v_\pi\)	rl ch03 policies_value_functions_bellman_equatio bellman_equation_for
We visualize this relationship between a state and its possible successor states with a {{c1::backup diagram}}.	Section: Policies, Value Functions &amp; Bellman Equations › Bellman Equation for \(v_\pi\)	rl ch03 policies_value_functions_bellman_equatio bellman_equation_for
It is called a backup diagram because it looks at how value is transferred {{c1::back up}} the tree from the possible successor states of a specific state at the bottom of the tree to that specific state at the top of the tree.	Section: Policies, Value Functions &amp; Bellman Equations › Bellman Equation for \(v_\pi\)	rl ch03 policies_value_functions_bellman_equatio bellman_equation_for
There always exists at least one {{c1::optimal policy}} \(\pi_{*}\), which is better than or equal to all other policies. All optimal policies share the same optimal state-value function \(v_{*}\), defined as:	Section: Optimal Policies &amp; Optimal Value Functions	rl ch03 optimal_policies_optimal_value_functions
All optimal policies also share the same {{c1::optimal action-value function}} \(q_{*}\), defined as:	Section: Optimal Policies &amp; Optimal Value Functions	rl ch03 optimal_policies_optimal_value_functions
For finite MDPs, the Bellman optimality equation has a {{c1::unique solution}}, a system of \(n\) equations in \(n\) unknowns (one per state) solvable if the dynamics \(p\) are known.	Section: Optimal Policies &amp; Optimal Value Functions › Takeaways	rl ch03 optimal_policies_optimal_value_functions takeaways
Any policy that is {{c1::greedy with respect to}} \(v_{*}\) is an optimal policy: since \(v_{*}\) already accounts for all future rewards, a one-step-ahead search is sufficient to identify optimal actions.	Section: Optimal Policies &amp; Optimal Value Functions › Takeaways	rl ch03 optimal_policies_optimal_value_functions takeaways
In practice, RL methods settle for {{c1::approximate solutions}} to the Bellman optimality equation, using actual experienced transitions in place of full knowledge of expected transitions.	Section: Optimal Policies &amp; Optimal Value Functions › Takeaways	rl ch03 optimal_policies_optimal_value_functions takeaways
The agent is always constrained by available {{c1::computational power}} (per time step) and memory, both of which limit how well value functions, policies, and models can be approximated.	Section: Optimality &amp; Approximation	rl ch03 optimality_approximation
When the state space is small and finite, exact {{c1::tabular methods}} suffice; for larger state spaces, function approximation with compact parameterized representations is necessary.	Section: Optimality &amp; Approximation	rl ch03 optimality_approximation
RL's {{c1::online nature}} allows approximations to focus more effort on frequently encountered states, at the expense of rarely visited ones. This makes useful approximate solutions achievable even when optimal ones are not.	Section: Optimality &amp; Approximation	rl ch03 optimality_approximation
RL is about learning from interaction to maximize cumulative reward over time, with the agent-environment interface defined by {{c1::actions, states, and rewards}}.	Section: Summary	rl ch03 summary
A {{c1::finite MDP}} formalizes this with well-defined transition probabilities over finite state, action, and reward sets.	Section: Summary	rl ch03 summary
The {{c1::return}} is the (expected) function of future rewards the agent seeks to maximize (undiscounted for episodic tasks, discounted for tabular continuing tasks).	Section: Summary	rl ch03 summary
{{c1::Value functions}} assign expected returns to states or state-action pairs; optimal value functions give the maximum achievable return, and any policy greedy w.r.t. them is optimal.	Section: Summary	rl ch03 summary
Problems vary by knowledge level: {{c1::complete knowledge}} gives the agent full dynamics \(p\); incomplete knowledge does not.	Section: Summary	rl ch03 summary
In practice, optimal solutions are rarely computable, therefore memory and computation constraints force agents to {{c1::approximate}} value functions, policies, and models.	Section: Summary	rl ch03 summary
{{c1::Reinforcement Learning}}: learning from interaction how to behave in order to achieve a goal	Section: Glossary	rl ch03 glossary
{{c1::Agent}}: known &amp; controllable; the RL agent &amp; its environment interact over a sequence of discrete time steps	Section: Glossary	rl ch03 glossary
{{c1::Environment}}: incompletely controllable &amp; may/may not be completely known	Section: Glossary	rl ch03 glossary
{{c1::Actions}}: choices made by the agent	Section: Glossary	rl ch03 glossary
{{c1::States}}: the basis/foundation for making the choices/actions	Section: Glossary	rl ch03 glossary
{{c1::Rewards}}: the basis for evaluating the choices/actions	Section: Glossary	rl ch03 glossary
{{c1::Policy}}: a stochastic rule by which the agent selects actions as a function of states (<em>agent's brain</em>) \(\boxed{\pi(a|s) = \mathbb{P}[A_t = a | S_t = s]}\)	Section: Glossary	rl ch03 glossary
{{c1::MDP}}: the variables formulated above within a RL setup with well-defined transition probabilities	Section: Glossary	rl ch03 glossary
A {{c1::finite MDP}}: an MDP with finite state, action &amp; reward sets.	Section: Glossary	rl ch03 glossary
{{c1::MRP}}: Markov Reward Process	Section: Glossary	rl ch03 glossary
{{c1::Return}}: function of future rewards that the agent seeks to maximize (in expected value)	Section: Glossary	rl ch03 glossary
{{c1::Discount factor, \(\gamma\)}}: determines the present value of future rewards	Section: Glossary	rl ch03 glossary
{{c1::Value functions}} (\(v_\pi, q_\pi\)): a policy's value functions assign to each state/state-action pair, the expected return from that state/state-action pair, given that the agent uses the policy.	Section: Glossary	rl ch03 glossary
{{c1::Optimal value functions}} (\(v_*, q_*\)): assign to each state/state-action pair the largest expected return achievable by any policy.	Section: Glossary	rl ch03 glossary
{{c1::Optimal policy}} (\(\pi_*\)): a policy whose value functions are optimal \(\left[v_*(s) = \max_\pi v_\pi(s)\right]\)	Section: Glossary<br>• \(\pi_* &gt; \pi,\ \forall \pi\) (\(\pi \geq \pi'\) iff \(v_\pi(s) \geq v_{\pi'}(s)\ \forall s \in S\))<br>• \(v_*\) &amp; \(q_*\) are unique for a given MDP, but there can be many optimal policies (\(\pi_*\))<br>• Any policy that is greedy w.r.t. the optimal value functions \((q_*, v_*)\) must be an optimal policy \((\pi_*)\)	rl ch03 glossary
{{c1::Bellman Optimality Equations}}: special consistency conditions that \(q_*, v_*\) must satisfy &amp; that can, in principle, be solved for \(q_*, v_*\), from which an optimal policy \((\pi_*)\) can be determined with relative ease.	Section: Glossary	rl ch03 glossary
\(v_*\) or \(q_*\) that satisfy the {{c1::Bellman Optimality Equations}} can then be used to easily obtain optimal policies \(\pi_*\)		rl ch04
Eventually \(\{v_k\}\) sequence converges to \(v_\pi\) as \(k \to \infty\) under the same conditions that guarantee the existence of \(v_\pi\). This is {{c1::iterative policy evaluation}}.	Section: Policy Evaluation (Prediction) › Iterative Policy Evaluation	rl ch04 policy_evaluation_prediction iterative_policy_evaluation
This update is called an {{c1::expected update}} because it is based on the expectation over all possible next states, rather than a sample of reward/value from the next state.	Section: Policy Evaluation (Prediction) › Iterative Policy Evaluation	rl ch04 policy_evaluation_prediction iterative_policy_evaluation
We think of the updates occurring through {{c1::sweeps}} of state space.	Section: Policy Evaluation (Prediction) › Iterative Policy Evaluation	rl ch04 policy_evaluation_prediction iterative_policy_evaluation
This improves the value from any state over one step ({{c1::monotonic policy improvement}}):	Section: Policy Improvement	rl ch04 policy_improvement
Policy improvement thus must give a {{c1::strictly better}} policy except when the original policy is already optimal.	Section: Policy Improvement	rl ch04 policy_improvement
This involves a sequence of {{c1::monotonically improving}} policies &amp; value functions.	Section: Policy Iteration	rl ch04 policy_iteration
Policy iteration requires full policy evaluation at each iteration step, which is a computationally expensive process that (formally) requires {{c1::infinite}} sweeps of the state space to approach the true value function.	Section: Value Iteration	rl ch04 value_iteration
In Value Iteration, policy evaluation is stopped after just {{c1::one sweep of the state space}} (one update of each state).	Section: Value Iteration	rl ch04 value_iteration
Async DP updates the values of states {{c1::individually}} in any order whatsoever, using whatever values of other states happen to be available. (arbitrary order)	Section: Asynchronous Dynamic Programming	rl ch04 asynchronous_dynamic_programming
{{c1::Policy evaluation}} solves for a fixed policy's value function iteratively, while policy improvement produces a strictly better (or already optimal) policy by acting greedily over those values.	Section: Summary	rl ch04 summary
Interleaving evaluation and improvement yields {{c1::policy iteration}} and value iteration, both of which compute exact optimal values and policies when full finite-MDP dynamics are available.	Section: Summary	rl ch04 summary
Standard DP runs full state-space sweeps using {{c1::expected updates}}, weighting every possible next state by its transition probability until the corresponding Bellman equations (\(v_\pi, v_*, q_\pi, q_*\)) hold to convergence.	Section: Summary	rl ch04 summary
{{c1::Generalized Policy Iteration (GPI)}} unifies DP and nearly all later RL algorithms as a continuous push-and-pull between improving value estimates and making policies greedier with respect to them.	Section: Summary	rl ch04 summary
{{c1::Asynchronous DP}} drops full sweeps altogether, updating states in place in arbitrary or priority-driven order while still converging as long as all states continue to be visited.	Section: Summary	rl ch04 summary
Every DP algorithm relies on {{c1::bootstrapping}} (revising estimates using other estimates). Chapter 5 removes both the model requirement and bootstrapping via Monte Carlo sampling.	Section: Summary	rl ch04 summary
Learning from {{c1::actual}} experience is striking because it requires no prior knowledge of the environment's dynamics, yet can still attain optimal behavior.		rl ch05
{{c1::Experience}}: sample sequences of states, actions, and rewards from actual/simulated interaction with an environment.		rl ch05
Monte Carlo methods are only applied to {{c1::episodic}} tasks.		rl ch05
MC methods estimate the value function of an {{c1::unknown}} MDP by learning the value function from samples instead of computing from knowledge of the MDP.		rl ch05
We use Generalized Policy Iteration ({{c1::GPI}}), developed in Ch. 4, to handle the nonstationarity.		rl ch05
MC uses the simplest possible idea: {{c1::Value = mean return}}	Section: Monte Carlo Prediction	rl ch05 monte_carlo_prediction
MC learns from {{c1::complete}} episodes: no bootstrapping	Section: Monte Carlo Prediction	rl ch05 monte_carlo_prediction
MC is {{c1::model-free}}: no knowledge of MDP transitions/rewards	Section: Monte Carlo Prediction	rl ch05 monte_carlo_prediction
The 2 Monte Carlo methods are {{c1::First-Visit}} &amp; Every-Visit MC:	Section: Monte Carlo Prediction<br>• First-Visit: estimates \(v_\pi(s)\) as the average of the returns following first visits to \(s\)<br>• Every-Visit: estimates \(v_\pi(s)\) by averaging the returns following all visits to \(s\)<br>• Both methods converge to \(v_\pi(s)\) as the number of visits (or first visits) to \(s\) goes to \(\infty\)<br>• Every-visit MC extends more naturally to function approximation &amp; eligibility traces	rl ch05 monte_carlo_prediction
Value is estimated by {{c1::mean return}}: \(V(s) = S(s) / N(s)\)	Section: Monte Carlo Prediction › First-Visit or Every-Visit Monte Carlo Policy Evaluation	rl ch05 monte_carlo_prediction first_visit_or_every_visit_monte_carlo_p
The idea of GPI is to avoid the infinite number of episodes nominally required for policy evaluation. This is {{c1::value iteration}}.	Section: Monte Carlo Control › Policy Improvement<br>• Only one iteration of iterative policy evaluation is performed between each step of policy improvement.	rl ch05 monte_carlo_control policy_improvement
For a deterministic policy for control, it's essential we use exploring starts to ensure sufficient exploration. This creates the {{c1::Monte Carlo ES Algorithm}}.	Section: Monte Carlo Control › Policy Improvement<br>• This is inefficient because, for each state-action pair, it maintains a list of all returns &amp; repeatedly calculates their mean.<br>• More efficient would be to maintain just the mean &amp; count for each state-action pair and update them incrementally.	rl ch05 monte_carlo_control policy_improvement
To avoid having to use exploring starts, we can use two approaches, {{c1::on-policy}} and off-policy methods. These are the only ways to ensure that all actions are selected infinitely often by the agent continuing to select them.	Section: Monte Carlo Control Without Exploring Starts<br>• On-policy: Evaluate/improve the policy that is used to make the decisions<br>• Learn about policy \(\pi\) from experience sampled from \(\pi\)<br>• Uses \(\varepsilon\)-greedy policy; generally soft policy (assign nonzero probability to each possible action): \(\pi(a|s) &gt; 0\ \quad \forall s \in S,\ a \in A(s)\)<br>• Off-policy: Evaluate/improve a policy different from that used to generate the data<br>• Learn about target policy \(\pi\) from experience sampled from behavior policy \(\mu\)	rl ch05 monte_carlo_control_without_exploring_st
An {{c1::off-policy}} learning uses 2 policies:	Section: Off-Policy Prediction via Importance Sampling<br>• A behavior policy (used to generate the data; action)<br>• A target policy (for control; becomes the optimal policy)	rl ch05 off_policy_prediction_via_importance_sam
This is called the {{c1::assumption of coverage}}.	Section: Off-Policy Prediction via Importance Sampling	rl ch05 off_policy_prediction_via_importance_sam
Almost all off-policy methods use {{c1::importance sampling}}, a general technique for estimating expected values under one distribution given samples from another.	Section: Off-Policy Prediction via Importance Sampling	rl ch05 off_policy_prediction_via_importance_sam
The relative probability of the trajectory under the target and behavior policies (the {{c1::importance-sampling ratio}}) is:	Section: Off-Policy Prediction via Importance Sampling	rl ch05 off_policy_prediction_via_importance_sam
To explore all possibilities, we require that the behavior policy be {{c1::soft}} (i.e., that it selects all actions in all states with nonzero probability).	Section: Off-Policy Monte Carlo Control	rl ch05 off_policy_monte_carlo_control
Both estimators are called {{c1::"discounting-aware"}} importance sampling estimators.	Section: Discounting-aware Importance Sampling	rl ch05 discounting_aware_importance_sampling
{{c1::Monte Carlo (MC) methods}} covered so far learn value functions and optimal policies from experience in the form of sample episodes, which lead to at least 3 kinds of advantages over DP methods for MC methods:	Section: Summary<br>• Learn optimal behavior directly from interaction with the environment (model-free)<br>• Can be used with simulation or sample models<br>• Are easier and more efficient to focus on a small subset of the states<br>• Are less harmed by violations of the Markov property (no bootstrapping)	rl ch05 summary
Maintaining {{c1::sufficient exploration}} is an issue in MC control methods.	Section: Summary<br>• One fix is by assuming that episodes begin with state-action pairs randomly selected to cover all possibilities. These are called exploring starts.	rl ch05 summary
{{c1::On-policy methods}} utilize one policy for both action and target selection.	Section: Summary	rl ch05 summary
{{c1::Off-policy methods}} use a different behavior policy from the deterministic target policy.	Section: Summary	rl ch05 summary
{{c1::Off-policy prediction}} refers to learning the value function of a target policy from data generated by a different behavior policy.	Section: Summary<br>• These learning methods are based on some form of importance sampling, i.e., on weighting returns by the ratio of the probabilities of taking the observed actions under the 2 different policies, thereby transforming their expectations from the behavior policy to the target policy.<br>• Ordinary importance sampling uses a simple average of the weighted returns (unbiased estimates)<br>• Weighted importance sampling uses a weighted average (biased estimates)	rl ch05 summary
TD is {{c1::model-free}} (no model of the environment's dynamics).		rl ch06
TD methods update estimates based on other learned estimates; in other words TD learns from {{c1::incomplete}} episodes. This is called bootstrapping.		rl ch06
The simplest TD method, {{c1::TD(0)}}, makes the update:	Section: TD Prediction	rl ch06 td_prediction
TD methods {{c1::combine}} the sampling of MC with the bootstrapping of DP.	Section: TD Prediction › Pseudocode: Tabular TD(0) for Estimating \(v_\pi\)	rl ch06 td_prediction pseudocode_tabular_td_0_for_estimating
TD methods can learn {{c1::before}} knowing the final outcome &amp; without the final outcome, unlike MC:	Section: Advantages of TD Prediction Methods<br>• before: TD can learn online, incrementally, while MC must wait until the episode ends when the return is known.<br>• without: TD can learn from incomplete sequences/episodes while MC only learns from complete sequences.<br>• TD works in continuing (non-terminating) environments while MC only works for episodic/terminating environments.	rl ch06 advantages_of_td_prediction_methods
TD methods are usually {{c1::more efficient}} than MC methods (constant \(\alpha\)) on stochastic tasks; they converge faster.	Section: Advantages of TD Prediction Methods	rl ch06 advantages_of_td_prediction_methods
TD methods have {{c1::low variance}}, while MC methods have high variance.	Section: Advantages of TD Prediction Methods	rl ch06 advantages_of_td_prediction_methods
This is called {{c1::batch updating}} because updates are made only after processing each complete batch of training data / finite number of episodes.	Section: Optimality of TD(0)	rl ch06 optimality_of_td_0
Under batch updating, {{c1::TD(0) &amp; constant-\(\alpha\) MC methods}} converge deterministically to a single answer independent of \(\alpha\), as long as \(\alpha\) is chosen to be sufficiently small.	Section: Optimality of TD(0)	rl ch06 optimality_of_td_0
In general, batch MC methods always find the estimates that {{c1::minimize mean square error}} on the training set, whereas batch TD(0) always finds the estimates that would be exactly correct for the maximum-likelihood model of the Markov process.	Section: Optimality of TD(0)<br>• Given this model, we can compute the estimate of the value function that would be exactly correct if the model were exactly correct.<br>• This is called the certainty-equivalence estimate because it is equivalent to assuming that the estimate of the underlying process was known with certainty rather than being approximated.<br>• In general, batch TD(0) converges to the certainty-equivalence estimate.	rl ch06 optimality_of_td_0
This update rule uses a quintuple of events \((S_t, A_t, R_{t+1}, S_{t+1}, A_{t+1})\). Hence, the name {{c1::SARSA}}. The backup diagram is shown below:	Section: Sarsa: On-policy TD Control	rl ch06 sarsa_on_policy_td_control
Here, the learned action-value function \(Q\) directly approximates \(q_*\), the optimal value function, independent of the policy being followed (off-policy). \(v_*\) can be learned with a {{c1::1-step lookahead}}.	Section: Q-learning: Off-Policy TD Control	rl ch06 q_learning_off_policy_td_control
Q-learning is off-policy so it updates the value function {{c1::greedily}} directly while updating/exploring the other actions with the \(\varepsilon\)-greedy policy.	Section: Q-learning: Off-Policy TD Control<br>• This simplifies the analysis of the algorithm &amp; enables early convergence proofs.<br>• Under the GLIE assumption (all state-action pairs continue to be updated) and following a stochastic approximation theory variant on the sequence of \(\alpha\), \(Q\) has been shown to converge with probability 1 to \(q_*\):	rl ch06 q_learning_off_policy_td_control
Instead of updating \(Q(S,A)\) with the value maximising action at \(S_{t+1}\), \(\max_a Q(S_{t+1}, a)\) as used in Q-learning, or the \(\varepsilon\)-greedy exploratory action as in SARSA, we can use the {{c1::expected value}} of \(Q\) at \(S_{t+1}\), taking into account how likely each action is under the current policy. The update rule is:	Section: Expected Sarsa	rl ch06 expected_sarsa
Given the next state \(S_{t+1}\), this algorithm moves {{c1::deterministically}} in the same direction as SARSA moves in expectation, hence the name Expected SARSA.	Section: Expected Sarsa	rl ch06 expected_sarsa
All the control algorithms discussed so far utilize {{c1::maximization operations}} in target policy constructions (\(\varepsilon\)-greedy or greedy action selection).	Section: Maximization Bias &amp; Double Learning	rl ch06 maximization_bias_double_learning
This implicitly {{c1::favors positive numbers}} (significant positive bias).	Section: Maximization Bias &amp; Double Learning	rl ch06 maximization_bias_double_learning
This is called the {{c1::maximization bias}}:	Section: Maximization Bias &amp; Double Learning	rl ch06 maximization_bias_double_learning
This idea is called {{c1::Double Learning}}.	Section: Maximization Bias &amp; Double Learning<br>• It doubles the memory requirements, but does not increase the amount of computation per step.	rl ch06 maximization_bias_double_learning
Double Learning for Q-learning is called {{c1::Double Q-learning}}.	Section: Maximization Bias &amp; Double Learning	rl ch06 maximization_bias_double_learning
Our general approach so far revolves around learning an action-value function, where the value of an action in a given state is quantified/evaluated {{c1::before}} the action is taken.	Section: Games, Afterstates &amp; Other Special Cases	rl ch06 games_afterstates_other_special_cases
In some specialized cases, it is expedient to evaluate the value function {{c1::after}} an action.	Section: Games, Afterstates &amp; Other Special Cases<br>• The state-value function that evaluates states after the action are referred to as afterstates &amp; the value functions over these afterstates are called the afterstate value functions.<br>• This is the case in Tic-tac-toe and chess (evaluate board position after agent has made its move).	rl ch06 games_afterstates_other_special_cases
{{c1::TD methods}} learn from incomplete episodes and are alternatives to MC methods for solving the prediction part of the RL problem.	Section: Summary	rl ch06 summary
The TD methods used here in this chapter should be rightly called {{c1::one-step, tabular, model-free}} TD methods.	Section: Summary	rl ch06 summary
{{c1::MC target}} is the return.	Section: \(n\)-step TD Prediction, \(\text{TD}(\lambda)\)	rl ch07 step_td_prediction
{{c1::TD(0) target}} is the one-step return, the first reward plus the discounted next state estimated value (\(V_t: S \to \mathbb{R}\) is the estimate at time \(t\) of \(v_\pi\)).	Section: \(n\)-step TD Prediction, \(\text{TD}(\lambda)\)	rl ch07 step_td_prediction
The \(n\)-step return uses the value function \(V_{t+n-1}\) to correct for the missing rewards beyond \(R_{t+n}\). An important property of \(n\)-step returns is that their expectation is guaranteed to be a better estimate of \(v_\pi\) than \(V_{t+n-1}\) is in a worst-state sense. This is called the {{c1::error reduction property}}. Using this property, all \(n\)-step TD methods converge to the correct predictions:	Section: \(n\)-step TD Prediction, \(\text{TD}(\lambda)\)	rl ch07 step_td_prediction
This algorithm is called {{c1::\(n\)-step Sarsa}}:	Section: \(n\)-step Sarsa, \(\text{Sarsa}(\lambda)\)	rl ch07 step_sarsa
\(\bar{V}_t(s)\) is the {{c1::expected approximate value}} of state \(s\) using the estimated action values at time \(t\), under the target policy:	Section: \(n\)-step Sarsa, \(\text{Sarsa}(\lambda)\) › Expected Sarsa	rl ch07 step_sarsa expected_sarsa
In order to use the data from \(b\), we must account for the {{c1::difference between the two policies}}, using their relative probability of taking the actions that were taken.	Section: \(n\)-step Off-policy Learning	rl ch07 step_off_policy_learning
The additional term \((1 - \rho_t) V_{h-1}(S_t)\) is called a {{c1::control variate}} and essentially ensures we ignore the sample when the importance sampling ratio is zero, thereby leaving the estimate unchanged.	Section: Per-decision Methods with Control Variates<br>• The control variate does not change the expected update.<br>• The importance sampling ratio has an expected value of 1 and is uncorrelated with the estimate, so the expected value of the control variate is zero.	rl ch07 per_decision_methods_with_control_variat
{{c1::Unification Algorithm}} \(\Rightarrow\) <em>One Idea</em>: Decide on a step-by-step basis whether we want to sample, as in Sarsa, or consider the expectation over all actions instead, as in tree-backup update.	Section: A Unifying Algorithm: \(n\)-step \(Q(\sigma)\)	rl ch07 a_unifying_algorithm_step
This algorithm is called {{c1::\(n\)-step \(Q(\sigma)\)}}.	Section: A Unifying Algorithm: \(n\)-step \(Q(\sigma)\)	rl ch07 a_unifying_algorithm_step
There exist a range of TD learning methods that lie in between the one-step TD (TD(0)) methods and Monte Carlo methods. These are {{c1::\(n\)-step methods}}.	Section: Summary	rl ch07 summary
The two {{c1::4-step backup diagrams}} below together summarize most of the methods introduced:	Section: Summary<br>• \(n\)-step TD with importance sampling<br>• \(n\)-step \(Q(\sigma)\) which generalizes Expected Sarsa &amp; Q-learning.	rl ch07 summary
In Chapter 12, we'll learn how multi-step TD methods can be implemented with minimal memory and computational complexity using {{c1::eligibility traces}}.	Section: Summary	rl ch07 summary
{{c1::Model-Based RL methods}} require a model of the environment and rely on planning as their primary component.	• Dynamic Programming (DP), Heuristic Search	rl ch08
{{c1::Model-Free RL methods}} don't require a model of the environment and primarily rely on learning.	• Monte Carlo (MC), Temporal-Difference (TD)	rl ch08
A {{c1::model}} is anything the agent can use to predict the environment's behavior.	Section: Models &amp; Planning<br>• Given a state and an action, a model predicts the next state and the next reward.<br>• If the model is stochastic, then there are several possible next states and next rewards. The model produces:<br>• All the possibilities and probabilities; these are distribution models.<br>• One of the possibilities, sampled according to the probabilities; these are sample models.	rl ch08 models_planning
Models are used to simulate the environment and thus produce {{c1::simulated experiences}}.	Section: Models &amp; Planning	rl ch08 models_planning
{{c1::Planning}} refers to any computational process that takes a model as input and produces or improves a policy for interacting with the modelled environment.	Section: Models &amp; Planning	rl ch08 models_planning
Planning in very small, incremental steps may be the most {{c1::efficient}} approach especially in large scale problems.	Section: Models &amp; Planning › Pseudocode: Random-sample One-step Tabular Q-Learning	rl ch08 models_planning pseudocode_random_sample_one_step_tabula
{{c1::Dyna-Q}}: a simple architecture integrating the major functions needed in an online planning agent.	Section: Dyna: Integrated Planning, Acting, and Learning	rl ch08 dyna_integrated_planning_acting_and_lear
Learning and planning share almost all the {{c1::same}} machinery, differing only in the source of their experience.	Section: Dyna: Integrated Planning, Acting, and Learning	rl ch08 dyna_integrated_planning_acting_and_lear
The agent keeps track of the number of timesteps elapsed \(\tau\) since a state-action pair had been selected, and if sufficient time has elapsed, it is presumed that the dynamics of the environment from that state has {{c1::changed}} and the model of it is incorrect.	Section: When the Model is Wrong › Dyna-Q+	rl ch08 when_the_model_is_wrong dyna_q
A special bonus reward is added to simulated experience involving these actions to encourage {{c1::exploratory behavior}} towards long-untried actions (\(k\sqrt{\tau}\)).	Section: When the Model is Wrong › Dyna-Q+	rl ch08 when_the_model_is_wrong dyna_q
This encourages the agent to be more exploratory to all accessible state transitions, and even though this may be costly computationally, it's {{c1::well worth it}}.	Section: When the Model is Wrong › Dyna-Q+	rl ch08 when_the_model_is_wrong dyna_q
{{c1::Prioritized sweeping}} optimizes Dyna-style planning by selectively updating state-action pairs based on expected magnitude of value change, rather than uniform random selection.	Section: Prioritized Sweeping<br>• Steps:<br>• Mechanism:<br>• Key advantages:	rl ch08 prioritized_sweeping
Extensions of prioritized sweeping to {{c1::stochastic environments}} are straightforward:	Section: Prioritized Sweeping<br>• Expected updates: enumerate all \(s'\) with transition probabilities, which is comprehensive but computationally expensive on low-probability transitions.<br>• Sample updates: lower variance per computation, better granularity enables selective focus on high-impact transitions.<br>• Essentially, when outcomes are random, one can either update based on all possibilities (slow but thorough) or sample specific outcomes (faster, focuses effort).	rl ch08 prioritized_sweeping
Tasks with these properties are usually called {{c1::stochastic optimal path problems}}.	Section: Real-Time Dynamic Programming (RTDP)<br>• RTDP can find optimal policies for these tasks with approximately 50% of the computation required by traditional sweep-based value iteration (i.e. dynamic programming).<br>• These kinds of problems are usually expressed in cost minimization not reward maximization.	rl ch08 real_time_dynamic_programming_rtdp
Decision-time planning is {{c1::memoryless}} (discards updates after selection of action), but background planning is persistent (permanently stores and accumulates learned values).	Section: Planning at Decision Time	rl ch08 planning_at_decision_time
The classical state-space planning methods are decision-time planning methods collectively known as {{c1::heuristic search}}.	Section: Heuristic Search	rl ch08 heuristic_search
Rollout algorithms follow the {{c1::policy improvement theorem}} by acting greedily w.r.t. \(\hat{Q}(s,a)\):	Section: Rollout Algorithms<br>• If \(q_\pi(s,a) \geq v_\pi(s)\) for any 2 policies \(\pi\) and \(\pi'\), then \(\pi' \geq \pi\).	rl ch08 rollout_algorithms
Traverse tree using tree policy (typically Upper Confidence bounds for Trees, {{c1::UCT}}):	Section: Monte Carlo Tree Search (MCTS) › 1. Selection	rl ch08 monte_carlo_tree_search_mcts 1_selection
{{c1::Real-time DP (RTDP)}}, an on-policy trajectory sampling version of value iteration, illustrates some of the advantages that focusing on the relevant regions of the state-space has over conventional sweep-based policy iteration (exhaustive).	Section: Summary	rl ch08 summary
Planning can also focus forward from pertinent states, such as states actually encountered during an agent-environment interaction, and the most important form of this is when {{c1::planning is done at decision time}} as part of the action-selection process.	Section: Summary<br>• Another example of this is classical heuristic search.<br>• Other examples are rollout algorithms &amp; Monte Carlo Tree Search (MCTS) that both benefit from online, incremental, sample-based value estimation and policy improvement.	rl ch08 summary
3 important {{c1::dimensions}} along which RL methods vary:	Section: Summary of Part I: Dimensions<br>• Width of updates: sample updates (based on a sample trajectory) vs expected updates (based on a distribution of possible trajectories).<br>• Depth of updates: degree of bootstrapping (\(\lambda\)).<br>• On-policy vs off-policy methods.	rl ch08 summary_of_part_i_dimensions
These dimensions are {{c1::neither exhaustive nor mutually exclusive}}. e.g. Dyna methods use both real and simulated experience to affect the same value function.	Section: Summary of Part I: Dimensions	rl ch08 summary_of_part_i_dimensions
The most important dimension not mentioned or covered yet is that of {{c1::function approximation}}:	Section: Summary of Part I: Dimensions<br>• Function approximation can be viewed as an orthogonal spectrum of possibilities ranging from tabular methods at one extreme through state aggregation, a variety of linear methods, and then a diverse set of non-linear methods.	rl ch08 summary_of_part_i_dimensions
Study of {{c1::function approximation}} in RL by considering its use in estimating the state-value function from on-policy data, i.e. in approximating \(v_\pi\) from experience generated using a known policy \(\pi\).		rl ch09
The approximate value function is represented as a parameterized functional form with {{c1::weight vector}} \(\mathbf{w} \in \mathbb{R}^d\):		rl ch09
Extending RL to function approximation makes it applicable to {{c1::partially observable problems}}, in which the full state is unavailable to the agent.		rl ch09
Therefore, it is necessary to define which states we care most about, based on a {{c1::state distribution}}, \(\mu(s)\), that represents how much we care about the error in each state \(s\).	Section: The Prediction Objective (\(\overline{\text{VE}}\))	rl ch09 the_prediction_objective
Weighting the error in a state \(s\), the difference between the approximate value \(\hat{v}(s, \mathbf{w})\) and the true value \(v_\pi(s)\), over the state space by \(\mu\) leads to obtaining a natural objective function called the {{c1::mean squared value error}}, denoted by \(\overline{\text{VE}}\):	Section: The Prediction Objective (\(\overline{\text{VE}}\))	rl ch09 the_prediction_objective
Often \(\mu\) is chosen to be the fraction of time spent in \(s\), called the {{c1::on-policy distribution}} under on-policy training.	Section: The Prediction Objective (\(\overline{\text{VE}}\))	rl ch09 the_prediction_objective
The {{c1::ultimate goal}} (reason for learning a value function) is to find a better policy.	Section: The Prediction Objective (\(\overline{\text{VE}}\)) › Performance Objective	rl ch09 the_prediction_objective performance_objective
If we use \(\overline{\text{VE}}\), the goal is to find a {{c1::global optimum}} (optimal weight vector, \(\mathbf{w}^*\)):	Section: The Prediction Objective (\(\overline{\text{VE}}\)) › Performance Objective	rl ch09 the_prediction_objective performance_objective
Complex function approximators may converge to a {{c1::local optimum}}:	Section: The Prediction Objective (\(\overline{\text{VE}}\)) › Performance Objective	rl ch09 the_prediction_objective performance_objective
SGD methods are {{c1::"gradient descent"}} methods because the overall step in \(\mathbf{w}_t\) is proportional to the negative gradient of the example's squared error (\(\mathbf{w}_{t+1}\)). This is the direction in which the error falls most rapidly.	Section: Stochastic-Gradient &amp; Semi-Gradient Methods › Stochastic Gradient Descent (SGD)	rl ch09 stochastic_gradient_semi_gradient_method stochastic_gradient_descent_sgd
Gradient descent methods are called {{c1::"stochastic"}} because the update is done on only a single example, which might have been selected stochastically.	Section: Stochastic-Gradient &amp; Semi-Gradient Methods › Stochastic Gradient Descent (SGD)	rl ch09 stochastic_gradient_semi_gradient_method stochastic_gradient_descent_sgd
If \(U_t\) is an {{c1::unbiased}} estimate, that is, if \(\mathbb{E}[U_t \vert S_t = s] = v_\pi(s)\) for each \(t\), then \(\mathbf{w}_t\) is guaranteed to converge to a local optimum under the usual stochastic approximation conditions for decreasing \(\alpha\).	Section: Stochastic-Gradient &amp; Semi-Gradient Methods › True Value Estimates	rl ch09 stochastic_gradient_semi_gradient_method true_value_estimates
An example of an unbiased estimator is the {{c1::Monte Carlo}} estimate for state \(S_t\):	Section: Stochastic-Gradient &amp; Semi-Gradient Methods › True Value Estimates	rl ch09 stochastic_gradient_semi_gradient_method true_value_estimates
{{c1::Bootstrapping methods}} are biased in that their target is dependent on the current value of the weights \(\mathbf{w}\).	Section: Stochastic-Gradient &amp; Semi-Gradient Methods › True Value Estimates<br>• Semi-gradient (bootstrapping) methods converge reliably in linear cases.<br>• Bootstrapping targets could be \(n\)-step returns or dynamic programming (DP) targets.	rl ch09 stochastic_gradient_semi_gradient_method true_value_estimates
One of the simplest cases for function approximation is when the approximate value function is a {{c1::linear combination}} of the weight vector.	Section: Linear Methods	rl ch09 linear_methods
For linear methods, features are {{c1::basis functions}} because they form a linear basis for the set of approximate functions.	Section: Linear Methods	rl ch09 linear_methods
\(\mathbf{w}_\text{TD}\) is called the {{c1::TD fixed point}}. It is the point that linear semi-gradient TD(0) converges to.	Section: Linear Methods	rl ch09 linear_methods
\(\mathbf{A}\) needs to be {{c1::positive definite}} to ensure that \(\mathbf{A}^{-1}\) exists:	Section: Linear Methods	rl ch09 linear_methods
One-step {{c1::action-value}} methods such as semi-gradient Sarsa(0) converge to an analogous fixed point and an analogous bound.	Section: Linear Methods › Bounded Expansion	rl ch09 linear_methods bounded_expansion
For {{c1::episodic}} tasks, there exists a bound [Bertsekas &amp; Tsitsiklis, 1996].	Section: Linear Methods › Bounded Expansion	rl ch09 linear_methods bounded_expansion
In the diagram above, if the state is inside a circle, then the corresponding feature has the value of 1 and is said to be {{c1::present}}; otherwise the feature is 0 and is said to be absent.	Section: Feature Construction for Linear Methods › Coarse Coding	rl ch09 feature_construction_for_linear_methods coarse_coding
This kind of 1-0 valued feature is called a {{c1::binary feature}}.	Section: Feature Construction for Linear Methods › Coarse Coding	rl ch09 feature_construction_for_linear_methods coarse_coding
Representing a state with features that overlap in this way is known as {{c1::coarse coding}}.	Section: Feature Construction for Linear Methods › Coarse Coding	rl ch09 feature_construction_for_linear_methods coarse_coding
Generalization in linear function approximation methods is determined by the {{c1::sizes}} and shapes of the features' receptive fields.	Section: Feature Construction for Linear Methods › Coarse Coding	rl ch09 feature_construction_for_linear_methods coarse_coding
Each such partition is called a {{c1::tiling}}, and each element of the partition is called a tile.	Section: Feature Construction for Linear Methods › Tile Coding	rl ch09 feature_construction_for_linear_methods tile_coding
Generalization extends to states sharing tiles with the trained state, proportional to {{c1::tiles in common}}.	Section: Feature Construction for Linear Methods › Tile Coding<br>• Uniform offsets can introduce directional artifacts (e.g. diagonal bias).<br>• Asymmetric offsets produce better-centered patterns.	rl ch09 feature_construction_for_linear_methods tile_coding
Miller &amp; Glanz (1996) recommend displacement vectors of {{c1::first odd integers}} \((1, 3, 5, \ldots, 2k-1)\) for \(k\) dimensions, with \(n\) set to a power of 2 \(\geq 4k\).	Section: Feature Construction for Linear Methods › Tile Coding	rl ch09 feature_construction_for_linear_methods tile_coding
Tile {{c1::number &amp; size}} determine resolution, while tile shape determines generalization.	Section: Feature Construction for Linear Methods › Tile Coding<br>• Square tiles generalize equally.<br>• Elongated tiles generalize along their longer dimension.<br>• Diagonal tiles generalize along a diagonal.	rl ch09 feature_construction_for_linear_methods tile_coding
{{c1::Mixed tile shapes}} (horizontal, vertical, conjunctive) allow per-dimension generalization while still learning values for specific conjunctions. Tile choice fully determines generalization behavior.	Section: Feature Construction for Linear Methods › Tile Coding	rl ch09 feature_construction_for_linear_methods tile_coding
{{c1::Hashing}} pseudorandomly collapses a large tiling into a much smaller set of tiles (each consisting of noncontiguous, disjoint regions), drastically reducing memory requirements with little performance loss.	Section: Feature Construction for Linear Methods › Tile Coding<br>• This sidesteps the curse of dimensionality since memory need only match the task's real demands rather than grow exponentially with dimensions.	rl ch09 feature_construction_for_linear_methods tile_coding
An {{c1::RBF network}} is a linear function approximator using RBFs for its features.	Section: Feature Construction for Linear Methods › Radial Basis Functions (RBF)	rl ch09 feature_construction_for_linear_methods radial_basis_functions_rbf
Nonlinear methods are much more precise in fitting the target functions, but (nonlinear) RBF networks are {{c1::much more computationally complex}} and require more manual tuning before learning.	Section: Feature Construction for Linear Methods › Radial Basis Functions (RBF)	rl ch09 feature_construction_for_linear_methods radial_basis_functions_rbf
The units (circles in the figure above) compute a weighted sum of their input signals, and then apply a nonlinear function, called the {{c1::activation function}}, to the result.	Section: Nonlinear Function Approximation: Artificial Neural Networks (ANNs)	rl ch09 nonlinear_function_approximation_artific
Overfitting in ANNs is a problem for function approximation that can be reduced through the {{c1::dropout}} method [Srivastava, Hinton, Krizhevsky, Sutskever &amp; Salakhutdinov, 2014].	Section: Nonlinear Function Approximation: Artificial Neural Networks (ANNs)	rl ch09 nonlinear_function_approximation_artific
{{c1::Deep belief networks}} presented a major step towards solving the training problem of deep layers of a deep ANN [Hinton, Osindero &amp; Teh, 2006].	Section: Nonlinear Function Approximation: Artificial Neural Networks (ANNs)	rl ch09 nonlinear_function_approximation_artific
{{c1::Batch normalization}} makes it easier to train deep ANNs by normalizing the output of deep layers before they feed into the following layer. This improves the learning rate of deep ANNs [Ioffe &amp; Szegedy, 2015].	Section: Nonlinear Function Approximation: Artificial Neural Networks (ANNs)	rl ch09 nonlinear_function_approximation_artific
{{c1::Deep residual learning}} is another technique useful for training deep ANNs [He, Zhang, Ren &amp; Sun, 2016].	Section: Nonlinear Function Approximation: Artificial Neural Networks (ANNs)	rl ch09 nonlinear_function_approximation_artific
{{c1::Deep Convolutional Networks}} have proven to be very successful in impressive RL algorithms [LeCun, Bottou, Bengio &amp; Haffner, 1998].	Section: Nonlinear Function Approximation: Artificial Neural Networks (ANNs)	rl ch09 nonlinear_function_approximation_artific
Instead of computing \(\mathbf{w}_\text{TD}\) iteratively, let's compute estimates of \(\mathbf{A}\) and \(\mathbf{b}\) and then directly compute the TD fixed point. This is what {{c1::Least-Squares TD (LSTD)}} does exactly. It forms the natural estimates:	Section: Least-Squares TD (LSTD)	rl ch09 least_squares_td_lstd
The inverse of \(\mathbf{\hat{A}_t}\) computation costs \(O(d^3)\), but this can be reduced to \(O(d^2)\) using the {{c1::Sherman-Morrison}} formula:	Section: Least-Squares TD (LSTD) › Computational Complexity	rl ch09 least_squares_td_lstd computational_complexity
So far we have been parametrising functions that approximate our value function, and these parameters are updated as we see more data. This is called the {{c1::parametric}} approach.	Section: Memory-based Function Approximation	rl ch09 memory_based_function_approximation
Memory-based function approximators are examples of {{c1::non-parametric}} methods.	Section: Memory-based Function Approximation	rl ch09 memory_based_function_approximation
Memory-based function approximation is sometimes called {{c1::lazy learning}} because processing training examples is postponed until the system is queried to provide an output.	Section: Memory-based Function Approximation	rl ch09 memory_based_function_approximation
There are different memory-based methods, but let's focus on {{c1::local learning}}:	Section: Memory-based Function Approximation<br>• Local learning methods approximate a value function only locally in the neighborhood of the current query state by retrieving states in memory via a distance metric between the query state and training example states.<br>• Local learning methods discard the local approximation after the query state is assigned a value.	rl ch09 memory_based_function_approximation
The function that assigns these weights is called a {{c1::kernel function}} or simply a kernel.	Section: Kernel-based Function Approximation	rl ch09 kernel_based_function_approximation
Kernel functions numerically express {{c1::how relevant}} knowledge about any state is to any other state.	Section: Kernel-based Function Approximation	rl ch09 kernel_based_function_approximation
{{c1::Kernel regression}} is the memory-based method that computes a kernel weighted average of the targets of all examples stored in memory:	Section: Kernel-based Function Approximation	rl ch09 kernel_based_function_approximation
Kernel methods allow evaluation in high-dimensional feature spaces, only using stored examples, and without the need for a complicated, parametric model. This is the so-called {{c1::kernel trick}} that forms the basis for many machine learning methods.	Section: Kernel-based Function Approximation	rl ch09 kernel_based_function_approximation
For this scenario, we introduce 2 new concepts: {{c1::Interest}} and Emphasis.	Section: Looking Deeper at On-Policy Learning: Interest &amp; Emphasis	rl ch09 looking_deeper_at_on_policy_learning_int
{{c1::Generalization}} is a must for RL systems for AI applications and supervised-learning function approximation helps achieve this.	Section: Summary	rl ch09 summary
The prediction objective \(\overline{\text{VE}}(\mathbf{w})\), called the {{c1::mean squared value error}}, gives us a clear way to rank different value-function approximations in the on-policy case.	Section: Summary	rl ch09 summary
Features constructed for linear function approximations could be represented as: {{c1::polynomials, Fouriers, coarse codings, tile codings, and radial basis functions (RBFs)}}.	Section: Summary	rl ch09 summary
Non-parametric models help us {{c1::avoid the curse of dimensionality}}.	Section: Summary	rl ch09 summary
{{c1::Interest and Emphasis}} enable us to focus the function approximation on the states we're more interested in.	Section: Summary	rl ch09 summary
Let's dive into the control problem now with parametric approximation of the action-value function \(\hat{q}(s, a, \mathbf{w}) \approx q_{*}(s, a)\), where \(\mathbf{w} \in \mathbb{R}^d\) is a {{c1::finite-dimensional weight vector}}.		rl ch10
We'll focus on {{c1::semi-gradient Sarsa}}, the natural extension of semi-gradient TD(0) to action values and to on-policy control.		rl ch10
This method is called {{c1::episodic semi-gradient one-step Sarsa}}. For a constant policy, this method converges in the same way that TD(0) does with the same kind of error bound.	Section: Episodic Semi-gradient Control	rl ch10 episodic_semi_gradient_control
{{c1::Control}} = action-value prediction + policy improvement &amp; action selection:	Section: Episodic Semi-gradient Control	rl ch10 episodic_semi_gradient_control
Average reward uses {{c1::no discounting}}; the agent has the same level of care for immediate and delayed rewards.	Section: Average Reward: A New Problem Setting for Continuing Tasks	rl ch10 average_reward_a_new_problem_setting_for
In the average-reward setting, the quality of a policy \(\pi\) is defined as the average rate of reward, or simply {{c1::average reward}}, while following that policy, denoted as \(r(\pi)\):	Section: Average Reward: A New Problem Setting for Continuing Tasks	rl ch10 average_reward_a_new_problem_setting_for
The 2nd and 3rd equations above hold if the MDP is {{c1::ergodic}}, i.e., if the steady-state distribution exists and is independent of the starting state \(S_0\):	Section: Average Reward: A New Problem Setting for Continuing Tasks	rl ch10 average_reward_a_new_problem_setting_for
It may be adequate practically to simply order policies according to their average reward per time step, otherwise called the {{c1::return rate}}.	Section: Average Reward: A New Problem Setting for Continuing Tasks	rl ch10 average_reward_a_new_problem_setting_for
In the average-reward setting, returns are defined in terms of differences between rewards and the average reward; this is called the {{c1::differential return}}:	Section: Average Reward: A New Problem Setting for Continuing Tasks	rl ch10 average_reward_a_new_problem_setting_for
The corresponding value functions for the differential return are known as {{c1::differential value functions}}:	Section: Average Reward: A New Problem Setting for Continuing Tasks	rl ch10 average_reward_a_new_problem_setting_for
This idea of the {{c1::futility of discounting in continuing problems}} can be proven by the symmetry argument.	Section: Deprecating the Discounted Setting<br>• Let's choose an objective that saves discounting by summing discounted values over the distribution with which states occur under the policy (where \(v^\gamma_\pi \equiv\) discounted value function):<br>• <em>The proposed discounted objective orders policies identically to the undiscounted (average reward) objective.</em><br>• <em>The discount rate \(\gamma\) does not influence the ordering.</em>	rl ch10 deprecating_the_discounted_setting
Optimizing the {{c1::average reward}} \(r(\pi)\) per time step resolves this cleanly, giving every policy a single scalar performance score.	Section: Summary	rl ch10 summary
The average-reward framework introduces {{c1::differential}} returns, value functions, Bellman equations, and TD errors that closely mirror their discounted counterparts and yield parallel differential control algorithms.	Section: Summary	rl ch10 summary
The off-policy, semi-gradient {{c1::TD(0)}} is same as that of the on-policy TD(0) except for the addition of the \(\rho_t\) term:	Section: Semi-gradient Methods	rl ch11 semi_gradient_methods
For action values, the off-policy, semi-gradient {{c1::Expected Sarsa}} update rule is (no importance sampling):	Section: Semi-gradient Methods	rl ch11 semi_gradient_methods
The lack of use of importance sampling in Expected Sarsa is an unclear choice since we might want to weight different state-action pairs {{c1::differently}} once they all contribute to the same overall approximation. This issue can only be properly resolved by more thorough understanding of the theory of function approximation in RL.	Section: Semi-gradient Methods	rl ch11 semi_gradient_methods
In the multi-step generalizations of the algorithms, both the state-value and action-value algorithms involve importance sampling. For example, the off-policy, semi-gradient \(\mathbf{n}\){{c1::-step Sarsa}} update is:	Section: Semi-gradient Methods	rl ch11 semi_gradient_methods
The off-policy, semi-gradient \(\mathbf{n}\){{c1::-step backup tree}} (no importance sampling) algorithm is:	Section: Semi-gradient Methods	rl ch11 semi_gradient_methods
These special methods guarantee stability because they do not extrapolate from the observed targets. They are called {{c1::averagers}}.	Section: Examples of Off-Policy Divergence › Takeaways	rl ch11 examples_of_off_policy_divergence takeaways
The danger of instability and divergence arises when we combine these 3 elements, which make up the {{c1::deadly triad}}:	Section: The Deadly Triad<br>• Function approximation<br>• Bootstrapping<br>• Off-policy training	rl ch11 the_deadly_triad
To better understand the stability challenge of off-policy learning, let's think about value-function approximation {{c1::more abstractly and independently}} of how learning is done.	Section: Linear Value-Function Geometry	rl ch11 linear_value_function_geometry
{{c1::Projection matrix}}: with \(\mathbf{D} \equiv \vert S \vert \times \vert S \vert\) diagonal matrix with \(\mu(s)\) on the diagonal and \(\mathbf{X} \equiv \vert S \vert \times d\) matrix whose rows are the feature vectors \(\mathbf{x}(s)^T\):	Section: Linear Value-Function Geometry › Projection Operation	rl ch11 linear_value_function_geometry projection_operation
The {{c1::Bellman error}} shows how far off \(v_\mathbf{w}\) is from \(v_\pi\). The Bellman error at state \(s\) is:	Section: Linear Value-Function Geometry › TD Solutions	rl ch11 linear_value_function_geometry td_solutions
The vector of all the Bellman errors, at all states, \(\bar{\delta}_\mathbf{w} \in \mathbb{R}^{\vert S \vert}\), is called the {{c1::Bellman error vector}} (\(\text{BE}\)).	Section: Linear Value-Function Geometry › TD Solutions	rl ch11 linear_value_function_geometry td_solutions
The overall size of \(\text{BE}\) is the {{c1::Mean Squared Bellman Error}}, \(\overline{\text{BE}}\):	Section: Linear Value-Function Geometry › TD Solutions	rl ch11 linear_value_function_geometry td_solutions
The {{c1::Bellman operator}} \(B_\pi : \mathbb{R}^{\vert S \vert} \to \mathbb{R}^{\vert S \vert}\) is defined by:	Section: Linear Value-Function Geometry › TD Solutions	rl ch11 linear_value_function_geometry td_solutions
The projection of the Bellman error vector back into the representable space creates the {{c1::Projected Bellman Error \((\text{PBE})\)}} vector:	Section: Linear Value-Function Geometry › TD Solutions	rl ch11 linear_value_function_geometry td_solutions
The size of \(\text{PBE}\), in the norm, is another measure of error in the approximate value function, called the {{c1::Mean Square Projected Bellman Error}}, \(\overline{\text{PBE}}\):	Section: Linear Value-Function Geometry › TD Solutions	rl ch11 linear_value_function_geometry td_solutions
This method is {{c1::naive}} because it achieves temporal smoothing-like behavior rather than accurate prediction by penalizing all TD errors.	Section: Gradient Descent in the Bellman Error › TD Error (Naive Residual-Gradient Algorithm)	rl ch11 gradient_descent_in_the_bellman_error td_error_naive_residual_gradient_algorit
This yields the {{c1::residual gradient algorithm}}:	Section: Gradient Descent in the Bellman Error › Bellman Error (Residual-Gradient Algorithm)	rl ch11 gradient_descent_in_the_bellman_error bellman_error_residual_gradient_algorith
We introduce a learnable natural objective function that is always observable. This is the error between the value estimate at each time and the return from that time, called the {{c1::return error}}. The Mean Square Return Error \((\overline{\text{RE}})\) is the expectation, under \(\mu\), of the square of this return error.	Section: The Bellman Error is Not Learnable › Example 1	rl ch11 the_bellman_error_is_not_learnable example_1
True SGD methods, {{c1::Gradient-TD methods}}, have robust convergence properties even under off-policy training and nonlinear function approximation.	Section: Gradient-TD Methods	rl ch11 gradient_td_methods
This solution via {{c1::least-squares}} methods yields a \(O(d^2)\) complexity; however, we want an SGD method with \(O(d)\) that converges robustly.	Section: Gradient-TD Methods	rl ch11 gradient_td_methods
Let's turn this into an SGD method via converting the 3 factors above into {{c1::expectations}} under this distribution:	Section: Gradient-TD Methods	rl ch11 gradient_td_methods
The 1st and last terms are not independent ({{c1::biased gradient estimate}}).	Section: Gradient-TD Methods	rl ch11 gradient_td_methods
Could estimate all 3 terms separately and combine ({{c1::unbiased gradient estimate}}) but too computationally expensive.	Section: Gradient-TD Methods	rl ch11 gradient_td_methods
The standard SGD method for incrementally finding \(\mathbf{v}\) that minimizes the expected squared error \(\left(\mathbf{v}^T \mathbf{x}_t - \rho_t\, \delta_t\right)^2\) is known as the {{c1::Least Mean Square (LMS)}} rule:	Section: Gradient-TD Methods › Gradient-TD	rl ch11 gradient_td_methods gradient_td
Let's look at another analytical algorithm called TD(0) with gradient correction, {{c1::TDC}}:	Section: Gradient-TD Methods › TD(0) with Gradient Correction (GTD(0) or TDC)	rl ch11 gradient_td_methods td_0_with_gradient_correction_gtd_0_or_t
Asymmetrical dependence (\(\mathbf{w}\) depends on \(\mathbf{v}\) but \(\mathbf{v}\) does not depend on \(\mathbf{w}\)) is referred to as a {{c1::cascade}}.	Section: Gradient-TD Methods › Takeaways	rl ch11 gradient_td_methods takeaways
The {{c1::one-step Emphatic-TD algorithm}} for learning episodic state values is defined by:	Section: Emphatic-TD Methods	rl ch11 emphatic_td_methods
Combining {{c1::function approximation, off-policy learning, and bootstrapping}} forms the deadly triad, where parameter weights can diverge even on tiny MDPs.	Section: Summary	rl ch11 summary
{{c1::Gradient-TD}} methods instead minimize the learnable projected Bellman error (\(\overline{\text{PBE}}\)) in \(O(d)\) time per step, while Emphatic-TD re-weights updates to recover an on-policy-like state distribution.	Section: Summary	rl ch11 summary
{{c1::Forward view}} algorithms are based on looking forward from the updated state, and the updated state depends on all the future rewards.		rl ch12
{{c1::Backward view}} algorithms use the current TD error, looking backward to recently visited states, to achieve nearly the same updates as forward view.		rl ch12
An update that averages simpler component updates is called a {{c1::compound update}} or the \(\lambda\)-return.	Section: The \(\lambda\)-return	rl ch12 the_return
Our first learning algorithm based on the \(\lambda\)-return is the {{c1::off-line \(\lambda\)-return algorithm}}, which waits until the end of an episode to make updates. Its semi-gradient, \(\lambda\)-return, target update for \(t = 0, 1, 2, \ldots, T-1\) is:	Section: The \(\lambda\)-return › TD(\(\lambda\)) Weighting	rl ch12 the_return td_weighting
Let's focus on the {{c1::semi-gradient version of TD(\(\lambda\))}} with function approximation:	Section: TD(\(\lambda\))<br>• The eligibility trace \(\mathbf{z}_t\) has the same number of components as \(\mathbf{w}_t\).<br>• \(\mathbf{z}\) is initialized to \(\mathbf{0}\), incremented on each time step by the value gradient, and then fades away by \(\gamma\lambda\):	rl ch12 td
This is the {{c1::recency heuristic}} used for credit assignment, where more credit is assigned to the most recent states. Recent is defined in terms of \(\gamma\lambda\).	Section: TD(\(\lambda\))	rl ch12 td
The off-line \(\lambda\)-return approximation is to truncate the sequence after a {{c1::fixed}} number of steps.	Section: \(n\)-step Truncated \(\lambda\)-return Methods	rl ch12 step_truncated_return_methods
Here the {{c1::residual weighting}} is given to the longest available \(n\)-step return \(G_{t:h}\).	Section: \(n\)-step Truncated \(\lambda\)-return Methods	rl ch12 step_truncated_return_methods
The truncated \(\lambda\)-return gives rise to a family of \(n\)-step \(\lambda\)-return algorithms, known in the state-value case as {{c1::Truncated TD(\(\lambda\))}} or TTD(\(\lambda\)).	Section: \(n\)-step Truncated \(\lambda\)-return Methods	rl ch12 step_truncated_return_methods
In principle, we can achieve both cases via the {{c1::online \(\lambda\)-return algorithm}}, but at the cost of computational complexity.	Section: Redoing Updates: Online \(\lambda\)-return Algorithm	rl ch12 redoing_updates_online_return_algorithm
The general form of the {{c1::online \(\lambda\)-return update}} for \(0 \leq t &lt; h \leq T\) is:	Section: Redoing Updates: Online \(\lambda\)-return Algorithm	rl ch12 redoing_updates_online_return_algorithm
We'll use eligibility trace to invert the forward view, online \(\lambda\)-return to an efficient backward view algorithm. This is called the {{c1::True Online TD(\(\lambda\))}}.	Section: True Online TD(\(\lambda\))	rl ch12 true_online_td
\(\mathbf{z}_t\) used in true online TD(\(\lambda\)) is called a {{c1::dutch trace}}, unlike that of TD(\(\lambda\)) which is called an accumulating trace.	Section: True Online TD(\(\lambda\))	rl ch12 true_online_td
Earlier work used a 3rd kind of trace called the {{c1::replacing trace}}, defined only for the tabular case or for binary feature vectors (tile coding). It is defined:	Section: True Online TD(\(\lambda\))	rl ch12 true_online_td
This is known as the {{c1::Least Mean Square (LMS)}} rule.	Section: Dutch Traces in Monte Carlo Learning	rl ch12 dutch_traces_in_monte_carlo_learning
We introduce an additional vector memory, the {{c1::eligibility trace}}, that keeps in it a summary of all the feature vectors seen so far. The overall update will be the same as the MC updates' sequence shown above and is:	Section: Dutch Traces in Monte Carlo Learning	rl ch12 dutch_traces_in_monte_carlo_learning
First, let's recall the action-value form of the {{c1::\(n\)-step}} return:	Section: Sarsa(\(\lambda\))	rl ch12 sarsa
With this, for \(t = 0, \ldots, T-1\), let's form the action-value form of the {{c1::off-line \(\lambda\)-return}} algorithm which uses \(\hat{q}\) rather than \(\hat{v}\):	Section: Sarsa(\(\lambda\))	rl ch12 sarsa
There is also a truncated version of Sarsa(\(\lambda\)), called {{c1::Forward Sarsa(\(\lambda\))}}, which appears to be a model-free, control method for use in conjunction with multi-layer ANNs.	Section: Sarsa(\(\lambda\))	rl ch12 sarsa
Action-based \(\lambda\)-return is either the {{c1::Sarsa form}}:	Section: Variable \(\lambda\) and \(\gamma\)	rl ch12 variable_and
If we change the index from \(k\) to \(t\) of the \(\mathbf{z}_k\) equation above, we get the {{c1::general accumulating trace}} update for state values:	Section: Off-Policy Traces with Control Variates	rl ch12 off_policy_traces_with_control_variates
This eligibility trace combined with the usual semi-gradient TD(\(\lambda\)) parameter-update rule (Section 12.2) forms a {{c1::general TD(\(\lambda\))}} algorithm that can be applied to either on-policy or off-policy data:	Section: Off-Policy Traces with Control Variates<br>• In on-policy, the algorithm is exactly TD(\(\lambda\)) because \(\rho_t = 1\) always and the ET above becomes the usual accumulating trace for variable \(\lambda\) and \(\gamma\):<br>• In off-policy, the algorithm stays as it is, although not guaranteed to be stable as a semi-gradient method.<br>• For off-policy, we'll consider extensions that guarantee stability in the next few sections.	rl ch12 off_policy_traces_with_control_variates
Let's derive the off-policy ET for {{c1::action-value}} methods and corresponding general Sarsa(\(\lambda\)) algorithms.	Section: Off-Policy Traces with Control Variates<br>• Starting with either recursive general action-based \(\lambda\)-return of Sarsa or Expected Sarsa, \(G_t^{\lambda a}\), in Section 12.8 (Expected Sarsa works out to be simpler), we can extend the Expected Sarsa \(G_t^{\lambda a}\) to the off-policy case after the off-policy model of action-based, off-policy, control variate, \(n\)-step return:	rl ch12 off_policy_traces_with_control_variates
This ET combined with the action-based, expected TD error \(\delta_t^a\) and the usual semi-gradient TD(\(\lambda\)) parameter-update rule (Section 12.2) forms an elegant, efficient {{c1::Expected Sarsa(\(\lambda\))}} algorithm that can be applied to either on-policy or off-policy data:	Section: Off-Policy Traces with Control Variates<br>• On-policy case: The algorithm becomes the Sarsa(\(\lambda\)) algorithm given constant \(\lambda\) and \(\gamma\), and the usual state-action TD error:	rl ch12 off_policy_traces_with_control_variates
If \(\lambda &lt; 1\), then all these off-policy algorithms involve bootstrapping and {{c1::the deadly triad}} applies, meaning that they can be guaranteed stable only for the tabular case, state aggregation and other limited forms of function approximation.	Section: Off-Policy Traces with Control Variates	rl ch12 off_policy_traces_with_control_variates
Let's look at the eligibility trace version of Tree Backup, which is called {{c1::Tree-Backup(\(\lambda\))}} or TB(\(\lambda\)).	Section: Watkins's Q(\(\lambda\)) to Tree-Backup(\(\lambda\)) › Tree-Backup(\(\lambda\))	rl ch12 watkins_s_q_to_tree_backup tree_backup
TB(\(\lambda\)) is the {{c1::true successor}} to Q-learning because it has no importance sampling.	Section: Watkins's Q(\(\lambda\)) to Tree-Backup(\(\lambda\)) › Tree-Backup(\(\lambda\))	rl ch12 watkins_s_q_to_tree_backup tree_backup
Like all semi-gradient algorithms, TB(\(\lambda\)) is not guaranteed to be stable when used with off-policy data and a powerful function approximator {{c1::(the deadly triad)}}.	Section: Watkins's Q(\(\lambda\)) to Tree-Backup(\(\lambda\)) › Tree-Backup(\(\lambda\))	rl ch12 watkins_s_q_to_tree_backup tree_backup
All 4 are based on either the {{c1::Gradient-TD or Emphatic TD}} and linear function approximation.	Section: Stable Off-Policy Methods with Traces	rl ch12 stable_off_policy_methods_with_traces
{{c1::Naive implementation seems expensive}}: Updating eligibility traces for every state at every time step appears computationally costly on serial computers.	Section: Implementation Issues	rl ch12 implementation_issues
{{c1::Practical optimization}}: Most ET are nearly 0; only recently visited states have significant traces, so implementations can track and update only these few states.	Section: Implementation Issues	rl ch12 implementation_issues
{{c1::Computational cost}}: With this optimization, tabular methods with traces are only a few times more expensive than one-step methods.	Section: Implementation Issues	rl ch12 implementation_issues
{{c1::Function approximation reduces overhead}}: When using neural networks, ET typically only double memory and computation per step (much less overhead than in tabular case).	Section: Implementation Issues	rl ch12 implementation_issues
{{c1::Tabular is the worst case}}: The tabular setting represents the highest computational complexity for ET relative to simpler methods.	Section: Implementation Issues	rl ch12 implementation_issues
{{c1::Eligibility traces}} provide an efficient, incremental way to interpolate between TD and MC methods.	Section: Conclusions	rl ch12 conclusions
ET offer advantages over \(n\)-step methods in terms of {{c1::generality and computational trade-offs}}.	Section: Conclusions	rl ch12 conclusions
Empirically, {{c1::an intermediate mix works best}}: ET should move towards MC but not all the way since pure MC performance degrades sharply.	Section: Conclusions	rl ch12 conclusions
ET are the {{c1::first defense against long-delayed rewards and non-Markov tasks}}, used with TD methods to make them behave more like MC methods without full bootstrapping.	Section: Conclusions	rl ch12 conclusions
Use traces {{c1::when data is scarce and online learning is required}}, as they provide faster learning per sample despite higher computational cost per step.	Section: Conclusions	rl ch12 conclusions
{{c1::Avoid traces in offline settings}} with cheap abundant data (maximum data processing speed matters more than learning efficiency per sample).	Section: Conclusions	rl ch12 conclusions
{{c1::True online methods}} achieve ideal \(\lambda\)-return performance while maintaining \(O(d)\) computational efficiency.	Section: Conclusions	rl ch12 conclusions
Forward-to-backward view derivations provide {{c1::computationally efficient, mechanistic}}, practical implementations of theory.	Section: Conclusions	rl ch12 conclusions
Almost all the algorithms/methods covered so far have been {{c1::action-value methods}} (except gradient-bandit algorithms, Section 2.8).		rl ch13
Here, we explicitly learn a {{c1::parametrized policy}} that can select actions without consulting a value function.		rl ch13
We will consider methods for learning \(\boldsymbol{\theta}\) based on the gradient of some scalar performance measure \(J(\boldsymbol{\theta})\) w.r.t. \(\boldsymbol{\theta}\). The goal is to {{c1::maximize}} performance, hence the use of gradient ascent:		rl ch13
This general methodology applies to {{c1::policy gradient methods}}.		rl ch13
Methods that learn approximations to both policy &amp; value functions are often called {{c1::Actor-Critic methods}}:	• Actor refers to the learned policy.<br>• Critic refers to the learned value function (state-value function).	rl ch13
If the action-space is {{c1::discrete}} and not too large, then a natural &amp; common kind of parametrization is to form parametrized numerical preferences \(h(s, a, \boldsymbol{\theta}) \in \mathbb{R}\) for each \((s, a)\) pair.	Section: Policy Approximation &amp; Its Advantages	rl ch13 policy_approximation_its_advantages
This kind of policy parametrization is called {{c1::softmax in action preferences}}.	Section: Policy Approximation &amp; Its Advantages	rl ch13 policy_approximation_its_advantages
The action preferences can be parametrized arbitrarily, they can be computed by a deep artificial neural network (ANN) or could simply be {{c1::linear}} in features:	Section: Policy Approximation &amp; Its Advantages	rl ch13 policy_approximation_its_advantages
The approx. policy can approach a {{c1::deterministic policy}}, unlike \(\varepsilon\)-greedy action selection.	Section: Policy Approximation &amp; Its Advantages	rl ch13 policy_approximation_its_advantages
It enables the selection of actions with {{c1::arbitrary probabilities}}, which is useful for cases that require near-optimal stochastic policy (e.g. significant function approximation).	Section: Policy Approximation &amp; Its Advantages<br>• E.g. useful in environments with imperfect information (e.g., card games) where it is optimal to act stochastically, such as when bluffing in Poker; it is important to do so randomly to unnerve/confuse an opponent.	rl ch13 policy_approximation_its_advantages
The policy from policy parametrization may be a {{c1::simpler function to approximate}} than the action-value function.	Section: Policy Approximation &amp; Its Advantages	rl ch13 policy_approximation_its_advantages
Often the most important reason for using a policy-based learning method is that it is a good way to {{c1::inject prior knowledge}} about the desired form of the policy into the RL system.	Section: Policy Approximation &amp; Its Advantages	rl ch13 policy_approximation_its_advantages
Policy-gradient methods have stronger convergence guarantees compared to action-value methods due to {{c1::smooth continuity}} in change of action probabilities as a function of the learned parameter (gradient ascent).	Section: The Policy Gradient Theorem	rl ch13 the_policy_gradient_theorem
Let's consider the {{c1::episodic}} performance measure, which is the value of the start state of the episode:	Section: The Policy Gradient Theorem	rl ch13 the_policy_gradient_theorem
The policy gradient theorem gives {{c1::an exact expression proportional to the gradient}}; so all that is needed is a way of sampling whose expectation equals or approximates this expression.	Section: REINFORCE: Monte Carlo Policy Gradient	rl ch13 reinforce_monte_carlo_policy_gradient
The last expression is the required expression; a quantity that can be sampled on each time step whose expectation is proportional to the gradient. This leads to the {{c1::REINFORCE update}}:	Section: REINFORCE: Monte Carlo Policy Gradient	rl ch13 reinforce_monte_carlo_policy_gradient
The policy gradient theorem can be generalized to include a comparison of the action value to an arbitrary {{c1::baseline}} \(b(s)\):	Section: REINFORCE with Baseline	rl ch13 reinforce_with_baseline
The Baseline REINFORCE update {{c1::reduces the variance}} despite leaving the expected update value unchanged, which speeds up learning.	Section: REINFORCE with Baseline	rl ch13 reinforce_with_baseline
REINFORCE with baseline cannot be used to evaluate actions because its state-value function {{c1::only estimates the value of the 1st state}} of each state transition (1st state to 2nd state), which serves as a baseline of what to expect for the subsequent return to be, prior to the actual transition's action.	Section: Actor-Critic Methods	rl ch13 actor_critic_methods
{{c1::Actor-critic methods, however, apply the state-value function to the 2nd state}} of the transition thereby estimating its value and thus evaluating the action.	Section: Actor-Critic Methods	rl ch13 actor_critic_methods
The policy is the {{c1::actor}} that maps states to actions, while the state-value function used to assess actions in this way is the critic.	Section: Actor-Critic Methods	rl ch13 actor_critic_methods
The estimated value of the 2nd state, when discounted &amp; added to the reward, yields the {{c1::one-step return}}, \(G_{t:t+1}\).	Section: Actor-Critic Methods	rl ch13 actor_critic_methods
The backward view of the \(\lambda\)-return algorithm uses {{c1::eligibility traces}} for the actor and the critic.	Section: Actor-Critic Methods › Actor-Critic with Eligibility Traces	rl ch13 actor_critic_methods actor_critic_with_eligibility_traces
From Section 10.3 on continuing problems, lack of episode boundaries requires a new performance measure definition in terms of the {{c1::average rate of reward per time step}}:	Section: Policy Gradient for Continuing Problems	rl ch13 policy_gradient_for_continuing_problems
In the continuing case, we define values \(v_\pi(s) \doteq \mathbb{E}_\pi[G_t \vert S_t = s]\) and \(q_\pi(s,a) \doteq \mathbb{E}_\pi[G_t \vert S_t = s, A_t = a]\) w.r.t. the {{c1::differential return}}:	Section: Policy Gradient for Continuing Problems	rl ch13 policy_gradient_for_continuing_problems
\(p(x)\) is the {{c1::density}} of the probability at \(x\), and not the probability. It can be greater than 1; it is the total area under the graph that must sum to 1.	Section: Policy Parametrization for Continuous Actions	rl ch13 policy_parametrization_for_continuous_ac
{{c1::Parametrized policy methods}} select actions directly from \(\pi(a \mid s, \boldsymbol{\theta})\) rather than deriving a policy indirectly from action-value estimates, adjusting \(\boldsymbol{\theta}\) along estimated ascent directions of performance \(J(\boldsymbol{\theta})\).	Section: Summary	rl ch13 summary
Key advantages over \(\varepsilon\)-greedy value-based control include representing genuinely stochastic optimal policies, smoothly annealing toward deterministic behavior, handling continuous action spaces naturally, and enjoying stronger convergence guarantees via the {{c1::policy gradient theorem}}.	Section: Summary	rl ch13 summary
{{c1::REINFORCE}} pairs the policy gradient theorem with full Monte Carlo returns; subtracting a learned state-value baseline cuts gradient variance substantially without adding bias.	Section: Summary	rl ch13 summary
When a learned value function bootstraps to evaluate transitions directly, it acts as a {{c1::critic}} guiding the policy actor (actor-critic methods). Bootstrapping adds some bias, but the sharp drop in variance typically accelerates learning much as TD improves upon Monte Carlo.	Section: Summary	rl ch13 summary
