前言
你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Markdown编辑器, 可以仔细阅读这篇文章,了解一下Markdown的基本语法知识。
Analysis
Q1.
分析:给出的条件实际上是Lecture2里提到的General Analysis的弱化版本,在Lecture中,实际上规定了在每一个时间步t,对当前时间步任意状态 s t s_t st都有 π θ ( a t ≠ π ∗ ( s t ) ∣ s t ) ≤ ϵ \pi_\theta(a_t\neq \pi^*(s_t)|s_t)\leq\epsilon πθ(at=π∗(st)∣st)≤ϵ,而在这个问题中,该条件若化为了对任意时间步、任意状态的期望,这实际上是两个期望,一个是对时间的期望,另一个是对每个时间下状态的期望。根据下面的Hint,提示我们大概要构造期望,并用到一个和概率有关的union bound不等式,下面我们来求解。
首先我们模仿Lecture的内容,对于一个时间步骤
t
t
t,我们任取一个状态
s
t
s_t
st,为了方便后面的书写,我们先定义一个概率,即截至t时间步内,策略
π
θ
\pi_\theta
πθ与最优策略完全相同的概率:
p
c
o
r
r
e
c
t
=
(
1
−
P
r
(
⋃
t
=
1
t
π
θ
(
a
t
)
≠
π
∗
(
a
t
)
)
)
(1)
p_{correct}=(1-Pr(\bigcup_{t=1}^t\pi_\theta(a_t)\neq\pi^* (a_t)))\tag{1}
pcorrect=(1−Pr(t=1⋃tπθ(at)=π∗(at)))(1)
从而得到以下概率表示,这实际上是Lecture的公式的变形。
p
π
θ
(
s
t
)
=
p
c
o
r
r
e
c
t
p
π
∗
(
s
t
)
+
(
1
−
p
c
o
r
r
e
c
t
)
p
w
r
o
n
g
(
s
t
)
(2)
p_{\pi_\theta}(s_t)=p_{correct}p_{\pi^*}(s_t) + (1-p_{correct})p_{wrong}(s_t)\tag{2}
pπθ(st)=pcorrectpπ∗(st)+(1−pcorrect)pwrong(st)(2)
因此,采用与Lecture中相同的方式,我们可以得到:
∣
p
π
θ
(
s
t
)
−
p
π
∗
(
s
t
)
∣
=
(
1
−
p
c
o
r
r
e
c
t
)
∣
p
w
r
o
n
g
(
s
t
)
−
p
π
∗
(
s
t
)
∣
(3)
|p_{\pi_\theta}(s_t)-p_{\pi^*}(s_t)|=(1-p_{correct})|p_{wrong}(s_t)-p_{\pi^*}(s_t)|\tag{3}
∣pπθ(st)−pπ∗(st)∣=(1−pcorrect)∣pwrong(st)−pπ∗(st)∣(3)
这里我们就已经得到了一个初步的表达式了,根据绝对值的性质,证明里的2已经凑出来了,这里我们先尝试分析
p
c
o
r
r
e
c
t
p_{correct}
pcorrect有
p
c
o
r
r
e
c
t
≥
1
−
∑
t
=
1
t
P
r
(
π
θ
(
a
t
)
≠
π
∗
(
a
t
)
)
=
1
−
∑
t
=
1
t
π
θ
(
a
t
≠
π
∗
(
s
)
∣
s
)
(4)
p_{correct}\geq1-\sum_{t=1}^tPr(\pi_\theta(a_t)\neq\pi^* (a_t))=1-\sum_{t=1}^t\pi_\theta(a_t\neq\pi^*(s)|s)\tag{4}
pcorrect≥1−t=1∑tPr(πθ(at)=π∗(at))=1−t=1∑tπθ(at=π∗(s)∣s)(4)
从而我们就得到:
∣
p
π
θ
(
s
t
)
−
p
π
∗
(
s
t
)
∣
≤
(
∑
t
=
1
t
π
θ
(
a
t
≠
π
∗
(
s
)
∣
s
)
)
∣
p
w
r
o
n
g
(
s
t
)
−
p
π
∗
(
s
t
)
∣
(5)
|p_{\pi_\theta}(s_t)-p_{\pi^*}(s_t)|\leq(\sum_{t=1}^t\pi_\theta(a_t\neq\pi^*(s)|s))|p_{wrong}(s_t)-p_{\pi^*}(s_t)|\tag{5}
∣pπθ(st)−pπ∗(st)∣≤(t=1∑tπθ(at=π∗(s)∣s))∣pwrong(st)−pπ∗(st)∣(5)
这里实际上就已经化简完了,最后直接套用前面的公式即可。但是我还是想问一个问题,这个问题当时看Lecture没有发现,即,我们能证明:
∣
p
π
θ
(
s
t
)
−
p
π
∗
(
s
t
)
∣
≤
2
ϵ
T
|p_{\pi_\theta}(s_t)-p_{\pi^*}(s_t)|\leq2\epsilon T
∣pπθ(st)−pπ∗(st)∣≤2ϵT但是我们怎么证明:
∑
s
t
∣
p
π
θ
(
s
t
)
−
p
π
∗
(
s
t
)
∣
≤
2
ϵ
T
(6)
\sum_{s_t}|p_{\pi_\theta}(s_t)-p_{\pi^*}(s_t)|\leq2\epsilon T\tag{6}
st∑∣pπθ(st)−pπ∗(st)∣≤2ϵT(6)
这里很奇怪的一点是,课件上的证明是直接用了这一点?很莫名其妙。
Q2.
(1)如果reward只取决于
s
t
s_t
st,则可以化简为:
J
(
π
)
=
∑
i
=
1
T
E
p
π
(
s
t
)
r
(
s
t
)
=
E
p
π
(
s
T
)
r
(
s
T
)
J(\pi)=\sum_{i=1}^TE_{p_{\pi(s_t)}}r(s_t)=E_{p_{\pi(s_T)} }r(s_T)
J(π)=i=1∑TEpπ(st)r(st)=Epπ(sT)r(sT)
因此,有:
J
(
π
∗
)
−
J
(
π
θ
)
=
E
p
π
∗
(
s
T
)
r
(
s
T
)
−
E
p
π
θ
(
s
T
)
r
(
s
T
)
≤
2
ϵ
T
R
m
a
x
=
O
(
T
ϵ
)
J(\pi^*)-J(\pi_\theta)=E_{p_{\pi^*(s_T)} }r(s_T)-E_{p_{\pi_\theta(s_T)} }r(s_T)\leq2\epsilon TR_{max}=\mathcal{O}(T\epsilon)
J(π∗)−J(πθ)=Epπ∗(sT)r(sT)−Epπθ(sT)r(sT)≤2ϵTRmax=O(Tϵ)
(2)同理,因为有求和,所以是
O
(
T
2
ϵ
)
\mathcal{O}(T^2\epsilon)
O(T2ϵ)
Code
待更新