ICLR 2022 Poster
paper
一篇关于RelayBuffer中sample ratio的文章,可以结合到model-free以及model-based的方法中提升算法的sample efficiency。
Intro
以往基于优先回访机制的Buffer均是基于Q函数的TD-erro展开,而这所能捕获到的样本信息还是较少。作者观察到奖励模型、状态转移模型以及Q函数都是在同一个Domian中进行特征表达(输入均为
S
,
A
S,A
S,A),因此在TD-error的基准上,加上奖励模型以及状态转移模型的model-erro,构造一种新的采样频率计算方法MaPER。
Method
对于从Buffer中sample 出的N个数据
B
i
=
(
s
κ
(
i
)
,
a
κ
(
i
)
,
r
κ
(
i
)
,
s
κ
(
i
)
+
1
)
\mathcal{B}_i=\begin{pmatrix}s_{\kappa(i)},a_{\kappa(i)},r_{\kappa(i)},s_{\kappa(i)+1}\end{pmatrix}
Bi=(sκ(i),aκ(i),rκ(i),sκ(i)+1)首先TD-erro采用Q bellman迭代误差, 其中使用奖励模型代替环境给出的奖励:
L
Q
θ
=
E
(
s
t
,
a
t
,
s
t
+
1
)
∼
B
[
∥
δ
t
Q
θ
π
Θ
(
s
t
,
a
t
,
s
t
+
1
)
∥
M
S
E
]
,
δ
Q
θ
π
Θ
(
s
t
,
a
t
,
s
t
+
1
)
=
Q
θ
(
s
t
,
a
t
)
−
(
R
θ
(
s
t
,
a
t
)
+
γ
E
a
′
∼
π
Θ
(
⋅
,
s
t
+
1
)
[
Q
θ
(
s
t
+
1
,
a
′
)
]
)
.
L_{\mathcal{Q}_\theta}=\mathbb{E}_{(s_t,a_t,s_{t+1})\sim\mathcal{B}}\left[\|\delta_t\mathcal{Q}_\theta^{\pi_\Theta}(s_t,a_t,s_{t+1})\|_{\mathrm{MSE}}\right],\\\text{}\\\delta\mathcal{Q}_\theta^{\pi_\Theta}(s_t,a_t,s_{t+1})=\mathcal{Q}_\theta(s_t,a_t)-\left(\mathcal{R}_\theta(s_t,a_t)+\gamma\mathbb{E}_{a^{\prime}\sim\pi_\Theta(\cdot,s_{t+1})}\left[\mathcal{Q}_\theta(s_{t+1},a^{\prime})\right]\right).
LQθ=E(st,at,st+1)∼B[∥δtQθπΘ(st,at,st+1)∥MSE],δQθπΘ(st,at,st+1)=Qθ(st,at)−(Rθ(st,at)+γEa′∼πΘ(⋅,st+1)[Qθ(st+1,a′)]).
model-erro的一部分是奖励模型误差
L
R
θ
=
E
(
s
t
,
a
t
,
r
t
,
s
t
+
1
)
∼
B
[
∥
δ
t
R
θ
∥
M
S
E
]
δ
t
R
θ
=
R
θ
(
s
t
,
a
t
)
−
r
t
L_{\mathcal{R}_\theta}=\mathbb{E}_{(s_t,a_t,r_t,s_{t+1})\thicksim\mathcal{B}}\left[\|\delta_t\mathcal{R}_\theta\|_{\mathrm{MSE}}\right] \\\text{}\\\delta_t\mathcal{R}_\theta=\mathcal{R}_\theta(s_t,a_t)-r_t
LRθ=E(st,at,rt,st+1)∼B[∥δtRθ∥MSE]δtRθ=Rθ(st,at)−rt
另一部分是
状态转移模型误差
L
T
θ
=
E
(
s
t
,
a
t
,
r
t
,
s
t
+
1
)
∼
B
[
∥
δ
t
T
θ
∥
M
S
E
]
δ
t
T
θ
=
T
θ
(
s
t
,
a
t
)
−
s
t
+
1
L_{\mathcal{T}\theta}=\mathbb{E}_{(s_t,a_t,r_t,s_{t+1})\thicksim\mathcal{B}}\left[\|\delta_t\mathcal{T}_\theta\|_{\mathrm{MSE}}\right] \\\text{}\\\delta_t\mathcal{T}_\theta=\mathcal{T}_\theta(s_t,a_t)-s_{t+1}
LTθ=E(st,at,rt,st+1)∼B[∥δtTθ∥MSE]δtTθ=Tθ(st,at)−st+1
三个误差加权融合得到
L
C
θ
=
ξ
1
L
Q
θ
+
ξ
2
L
R
θ
+
ξ
3
L
T
θ
L_{\mathcal{C}_\theta}=\xi_1L_{\mathcal{Q}_\theta}+\xi_2L_{\mathcal{R}_\theta}+\xi_3L_{\mathcal{T}_\theta}
LCθ=ξ1LQθ+ξ2LRθ+ξ3LTθ
对模型参数的训练通过最小化联合损失函数,同时三项均方误差构造每一个被采样样本的权重为:
σ
i
=
ξ
1
∥
δ
κ
(
i
)
Q
θ
π
Θ
∥
M
S
E
+
ξ
2
∥
δ
κ
(
i
)
R
θ
∥
M
S
E
+
ξ
3
∥
δ
κ
(
i
)
T
θ
∥
M
S
E
p
i
=
σ
i
α
∑
k
∈
[
∣
B
∣
]
σ
k
α
,
w
i
=
(
1
∣
B
∣
p
i
)
β
\sigma_{i}=\xi_{1}\|\delta_{\kappa(i)}\mathcal{Q}_{\theta}^{\pi_{\Theta}}\|_{\mathrm{MSE}}+\xi_{2}\|\delta_{\kappa(i)}\mathcal{R}_{\theta}\|_{\mathrm{MSE}}+\xi_{3}\|\delta_{\kappa(i)}\mathcal{T}_{\theta}\|_{\mathrm{MSE}} \\\text{}\\p_i=\frac{\sigma_i^\alpha}{\sum_{k\in[|\mathcal{B}|]}\sigma_k^\alpha}, w_i=\left(\frac{1}{|\mathcal{B}|p_i}\right)^\beta
σi=ξ1∥δκ(i)QθπΘ∥MSE+ξ2∥δκ(i)Rθ∥MSE+ξ3∥δκ(i)Tθ∥MSEpi=∑k∈[∣B∣]σkασiα,wi=(∣B∣pi1)β