ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Amortized Inference란?
    카테고리 없음 2019. 8. 2. 16:52

    https://www.quora.com/What-is-amortized-variational-inference

     

    What is amortized variational inference?

    Answer: Let me briefly describe the setting first, as the best way to understand amortized variational inference (in my opinion) is in the context of regular variational inference (VI). Quick background on VI Let’s assume that we have some latent variable

    www.quora.com

    http://ruishu.io/2017/11/07/amortized-optimization/

     

    Amortized Optimization - Rui Shu

    PrologueOver the summer, I made it a goal to use the phrase “amortized optimization” as often as my friends would dar...

    ruishu.io

    Bayesian neural network를 variational inference 사용하여 학습하는 상황을 가정해보자.

     

    관찰 포인트가 여러 개라고 하더라도 상응되는 global latent variable은 하나만 존재하도록 모델링할 수도 있다.

    (일반적으로 weight의 approximate posterior에 사용되는 variational parameter는 모든 데이터에 대해 공통)

     

    그런데 만약 Observable variables $x_i$에 대응하는 local latent variable $z_i$이 각각 존재한다고 한다면?

    (VAE가 대표적인 케이스)

     

    두 가지 문제가 생긴다.

    1. 데이터가 늘어날 수록 그에 대응하는 latent variable이 계속해서 선형적으로 늘어나야 한다.

    2. 새로운 데이터 $x^*$가 들어오면 $z^*$에 대하여 다시 피팅을 해야한다.

     

    이 문제를 해결하기 위한 방법이 amortized inference이다.

    결론부터 말하면 네트워크가 $x_i$를 입력받아 $z_i$를 만들어내도록 하는 방법이다.

    VAE에서 encoder가 데이터 포인트마다 다른 latent code를 만들어 내는 것과 같다.

     

    (a) Standard Variational Inferecne (b) Amortized Vritional Inference (그림 출처: https://arxiv.org/pdf/1711.05597)

     

    문제 해결 전과 후를 Graphical model의 예시를 가지고 비교해보자. 
    위 그림에서 (a)는 일반적인 stochatic variational inference 상황이다. 

    $\xi_i$는 plate 위에 있기 때문에 $z_i$의 갯수만큼 매번 optimize되어야 한다. 

    반면에 (b)는 Amortized variational inference의 대표적인 예(VAE)이다.

    이전 상황과는 다르게 $\phi$는 plate 바깥에 한개만 존재한다. 

    결국 새로운 $z^*$를 만들고 싶으면 기존에 학습된 $\phi$를 사용해 inference를 하면 그만이다. 

     

    이게 더 좋은 expressive power를 준다고 생각할 수 있지만, 오히려 반대라고 한다.

    (참조: https://arxiv.org/abs/1801.03558)

     

    남는 의문은 도대체 여기서 "Amortized"가 무슨 뜻이냐는 것이다(terminology는 항상 불친절하다).

    무엇에 대해 분할 상환을 했다는 것인지 그 의미를 생각해보면 된다.

     

    위 문제점 중 2번을 생각해보면,

    그 전에는 새로운 데이터 $x^*$가 들어올때마다 새로운 최적화를 re-run해야 했지만,

    amortized inference를 사용하고 나서는 추가적인 비용이 들지 않았다.

    왜냐하면 이전에 기존 데이터 $x_{1,2,...,n}$을 학습하면서 해당 비용을 이미 나누어 지불(Amortize) 했기 때문이다.

    (사실 완전이 공짜는 아니라, 학습된 네트워크에 대해서 한번의 feed-forward가 필요하다.)

     

    이하는 관련 내용을 찾아볼 수 있는 논문들.

     

    https://arxiv.org/abs/1610.05735

    To alleviate this problem, one could try to learn from past inferences, so that future inferences run faster.

    This strategy is known as amortized inference.

     

    https://arxiv.org/pdf/1711.05597

     

    amortized inference employs complex functions such as neural networks to predict variational distributions conditioned on data points, rendering VI an important component of modern Bayesian deep learning architectures such as variational autoencoders.

     

    The basic idea behind amortized inference is to use a powerful predictor to predict the optimal zi based on the features of xi , i.e., zi = f(xi). This way, the local variational ξi zi θ xi i ∈ [1,M] (a) SVI φ zi θ xi i ∈ [1,M] (b) VAE Fig. 2. The graphical representation of stochastic variational inference (a) and the variational autoencoder (b). Dashed lines indicate variational approximations. parameters are replaced by a function of the data whose parameters are shared across all data points, i.e. inference is amortized.

     

    댓글

Designed by Tistory.