Normalizing flow의 normalizing은 invertible transformations을 거치면 normalized density를 얻는 다는 것을 나타내며, flow는 invertible transformations들이 결합되어 연속적으로 수행된다는 것을 나타낸다.
- zm=fθm∘⋯f1θ(z0)=fθm(fθm−1(⋯(fθ1(z0))))≜fθ(z0)
위 식의 맨 마지막 f는 모든 fm을 합친 것을 의미하며, 각각의 fm에 대한 θ는 다 다르다. normalizing flow models의 경우 zm=x가 되며 change of variables를 적용하면 아래와 같은 식을 얻는다.
- PX(x;θ)=PZ(fθ−1(x))m=1∏M∣det(∂(zm)∂(fθm)−1(zm))∣ (product의 determinant는 determinant의 product와 같다. det∏=∏det)
Learning and Inference
앞서 살펴본 식으로 maximum likelihood를 적용하면 다음과 같은 식을 얻는다.
- θmaxlogPX(D;θ)=x∈D∑logPZ(fθ−1(x))+log∣det(∂x∂fθ−1(x))∣
정확한 likelihood eavluation은 inverse transformation x↦z를 통해 가능하다. 반면 sampling은 forward transformation z↦x를 통해 가능하다.
- x=fθ(z)
- z=fθ−1(x)
학습과 추론을 효율적으로 하기 위해서는 다음 세 가지 연산이 쉬워야 한다.
- Likelihood evaluation: efficient x↦z
- Sampling: efficient z↦x
- Determinant of Jacobian
Jacobian matrix는 variable의 dimension이 n인 경우, n×n matrix가 된다. 이는 determinant 계산에 매우 많은 연산량을 필요로 한다. 만약 determinant를 triangular matrix로 변환 할 수 있으면 determinant 계산에 필요한 연산량을 크게 줄일 수 있다. triangular matrix의 determinant는 diagonal elements의 곱이기 때문이다. 많은 normalizing flow models 가 determinant가 diagonal이 되도록 하는 trick을 사용한다.
Reference
cs236 Lecture 8