9.2 Background

random variable xx p(x;θ) p(x;\theta)의 분포를 따른때 다음과 같이 표현합니다. xp(x;θ)x \sim p(x;\theta)

그리고 ffxx에 의한 함수일 때, θEx[f(x)]\nabla_\theta\mathbb{E}_x[f(x)]를 계산해 보겠습니다. 이 때, θf\nabla_{\theta}f analytical gradients는 구할 수 없거나 존재하지 않을 때, 다음과 같은 score function estimator를 유도할 수 있습니다.

θEx[f(x)]=Ex[f(x)θlog(p(x;θ))]\nabla_\theta\mathbb{E}_x[f(x)] = \mathbb{E}_x[f(x)\nabla_{\theta}\log(p(x;\theta))]

그 이후의 내용은 기본 아이디어를 따온 다음 Gradient Estimation Using Stochastic Computation Graph를 읽으시면 도움이 될 수 있습니다.

만약 xxθ\theta의 값에 deterministic function이고, 다른 random variable zz로 이루어진다면 이는 x(z,θ)x(z,\theta)로 표현가능하고, 모든 zz에 대해 θ\theta의 연속 함수일 때 필요충분조건으로 다음이 성립합니다.

θEz[f(x(z,θ)]=Ez[θf(x(z,θ))]\nabla_\theta\mathbb{E}_z[f(x(z,\theta)] = \mathbb{E}_z[\nabla_\theta f(x(z,\theta))]

이는 다음과 같이 나타낼 수 있습니다.

θEzp(;θ)[f(x(z,θ))]=θp(;θ)f(x(z,θ))dz\frac{\partial}{\partial \theta}\mathbb{E}_{z\sim p(\cdot;\theta)}[f(x(z,\theta))] = \frac{\partial}{\partial \theta}\int p(\cdot;\theta)f(x(z,\theta))dz

=p(;θ)θf(x(z,θ))+p(;θ)f(x(z,θ))θdz= \int \frac{\partial p(\cdot;\theta)}{\partial \theta}f(x(z,\theta)) + p(\cdot;\theta)\frac{\partial f(x(z,\theta))}{\partial \theta} dz

=p(;θ)θf(x(z,θ))+p(;θ)f(x(z,θ))θdz= \int \frac{\partial p(\cdot;\theta)}{\partial \theta}f(x(z,\theta)) + p(\cdot;\theta)\frac{\partial f(x(z,\theta))}{\partial \theta} dz

=Ezp(;θ)[(θlogp(z;θ))f(x(z,θ))+f(x(z,θ))θ] = \mathbb{E}_{z\sim p(\cdot;\theta)}[(\frac{\partial}{\partial \theta}\log{p(z;\theta)})f(x(z,\theta))+\frac{\partial f(x(z,\theta))}{\partial \theta}]

이러한 테크닉은 뒤에서 계속 사용되는 테크닉이므로 보고가면 좋습니다.

Last updated

Was this helpful?