Briefly distinguish reward from return, state value from action value, and max from argmax. Finally distinguish the iteration counter k from environment time t and the learning rate α from the exploration parameter ε. [5 points]
下面跟着题目逐步算
五组概念,每组 1 分
① Reward 是一次转移收到的即时数值;return 是从某时刻开始的未来折扣奖励和。② V(s) 尚未指定第一动作,按策略平均;Q(s,a) 指定第一步做 a,之后再按相应策略继续。
③ max 返回最大的数,argmax 返回达到该数的动作或下标。④ k 表示算法更新轮数,t 表示真实/采样轨迹的时间。⑤ α 控制估计向目标移动多少,ε 控制 ε-greedy 选动作时的探索概率。
Explain first-visit versus every-visit MC. Distinguish sample-mean and constant-step-size estimation. Explain why online TD must specify the order of transitions when a state repeats. [5 points]
下面跟着题目逐步算
不要把“访问次数”与“步长形式”混在一起
① First-visit 每回合每个状态只使用首次访问的回报。② Every-visit 每次访问对应的回报都使用。
③ Sample mean 以已有回报的算术平均估计,递推步长是 1/N。④ Constant α 用 V←V+α(G−V),一般更重视近期样本,并非普通算术平均。
Match each mechanism to its main purpose and give one useful detail: (i) replay buffer, (ii) target network, (iii) Double DQN, (iv) prioritized replay, (v) dueling network. [5 points]
In a one-state two-action bandit, πθ(a₁)=σ(θ) and πθ(a₂)=1−σ(θ), where σ is the logistic function. An episode consists of one action. At θ=0 the sampled action is a₁ and its reward is 4. Use baseline b=2 and learning rate α=0.1. Compute ∂logπθ(a₁)/∂θ, the REINFORCE parameter update, and the direction of the probability change. Explain the role of the baseline. [5 points]
下面跟着题目逐步算
从公式到数值,一步步走
① θ=0 时 σ(0)=1/2。(1 分)② d logσ(θ)/dθ=σ′/σ=1−σ,因此梯度为 0.5。(1 分)
Distinguish model-free learning from planning. Outline the real-experience and simulated-experience parts of Dyna. Why can additional planning be harmful when the learned model is inaccurate? [5 points]
下面跟着题目逐步算
先区分数据从哪里来
① Model-free 价值/策略学习直接用实际交互样本更新,不要求显式环境转移模型。② Planning 使用模型推演结果来改进价值或策略。
③ Dyna 接到真实 (s,a,r,s′) 后,可以直接进行一次学习更新,同时更新模型。④ 再抽取状态动作,通过模型生成模拟转移,进行额外学习更新。
γ=1. States A and B are nonterminal. Each transition from either state has reward -1. A moves to A or B with probability 0.5 each. B moves to A with probability 0.25 and to terminal T with probability 0.75. T is absorbing with zero reward.
(a) Write the transition matrix and the Bellman equations. [2]
(b) Solve for v(A),v(B). [2]
(c) For the observed episode A → A → B → T, compute all three returns. [2]
(d) Interpret -v(A) and -v(B), and explain why finite values are possible even though γ=1. [2]
γ=0.5. At S, a gives reward 2 and goes to U; b gives reward 1 and terminates. At U, c gives reward 0 and goes to S; d gives reward 3 and terminates. The initial deterministic policy is π=(a,c).
(a) Write its Bellman equations. [2]
(b) Solve for vπ(S),vπ(U). [2]
(c) Compute all four qπ values and give a greedy improvement. [2]
(d) Evaluate the improved policy and test whether it is optimal. [2]
下面跟着题目逐步算
确定性策略无需再写 1/2 平均
策略 (a,c) 表示 S 必做 a、U 必做 c。环境动作也确定,整个旧策略是循环。
(a) 两式(2 分)
(b) 联立(2 分)
代入 vS=2+0.25vS,得 vS=8/3,vU=4/3。
(c) 四动作比较(2 分)
S 的 a=2+0.5×4/3=8/3,b=1,仍选 a;U 的 c=0.5×8/3=4/3,d=3,改选 d。新策略 (a,d)。
(d) 新价值与检查(2 分)
U 直接终止得 3;S 得 2+0.5×3=3.5。重新比较 U 的 c=0.5×3.5=1.75<3,S 的 a=3.5>1,策略稳定且最优。
C3. Expectation backups versus optimality backups [9 points]
γ=0.5. At S, a gives reward 0 and returns to S; b gives reward 1 and goes to U. At U, c gives reward 2 and terminates; d gives reward -1 and goes to S. Let Vₖ be random-policy evaluation with probability 0.5 per action. Let Wₖ be value iteration. Start both at zero.
(a) Write the update formulas for V and W at S. [1]
(b) Compute V₁,V₂ for (S,U). [2]
(c) Compute W₁,W₂ for (S,U). [2]
(d) Using V₂ as successor values, calculate all four one-step action values and the greedy policy. [2]
(e) Explain why the two sequences differ even though they use the same environment. [2]
An episode is A --1→ A --2→ B --3→ T. γ=0.5. Initialize V(A)=2,V(B)=1 and use constant α=0.5. Reset to these initial values for each method. Every-visit MC updates are applied in chronological visit order after the episode has ended.
(a) Compute G₀,G₁,G₂. [2]
(b) Apply first-visit constant-step MC. [2]
(c) Apply every-visit constant-step MC, showing both A updates. [2]
(d) Apply online TD(0), showing all three updates. [3]
(e) Why is the every-visit result not simply the arithmetic mean of A’s two returns? [1]
下面跟着题目逐步算
本题 every-visit 明确使用常数步长
和其他卷的 fresh sample mean 不同,这里 α 固定为 0.5,还保留了初始值的影响。读题时先圈出这些约定。
(a) 回报(2 分)
G₂=3,G₁=2+0.5×3=3.5,G₀=1+0.5×3.5=2.75。
(b) 首次访问(2 分)
A=2+0.5(2.75-2)=2.375,B=1+0.5(3-1)=2。
(c) 每次访问(2 分)
A 第一次到 2.375;第二次用回报 3.5,A=2.375+0.5(3.5-2.375)=2.9375。B 仍为 2。
Q(S,A)=3, r=0, γ=0.9, α=0.1. The transition is nonterminal. Online next-state values for (a₁,a₂) are (2,6), target-network values are (7,4), and the actual next action is a₁. Behaviour is ε-greedy with ε=0.2. Run each algorithm independently.
(a) Compute behaviour action probabilities. [2]
(b) Compute the SARSA target and tabular update. [2]
(c) Compute the Q-learning target and tabular update. [2]
(d) Compute DQN and Double DQN targets; state which network selects and which evaluates the next action. [3]
(e) If this transition is terminal, compute its target and tabular update. [1]
γ=0.5. At S, short gives reward 4 and terminates; long gives reward 0 and moves to U; wait gives reward 1 and returns to S. At U, collect gives reward 6 and terminates; back gives reward 0 and moves to S. Start with π₀=(wait,back).
(a) Evaluate π₀. [2]
(b) Compute all five qπ₀ values and obtain π₁ by greedy improvement. [3]
(c) Evaluate π₁ and prove it is optimal by checking every action. [3]
(d) From V₀=(0,0), compute V₁,V₂ with synchronous value iteration. [2]