FastFlow 등 Anomaly Detection 모델에 사용되는 coupling layer 구조 중 Affine Coupling Layer를 잘 이해하기 위해 정리함.
✔️Affine Coupling Layer
Affine Transformation: z = Ax+b의 형태로 (scaling과 shifting)바꿔주는 것.
이와 같은 affine transformation을 이용하여 것이 Affine Coupling Layer.
전체 D Dimension을
- 1~d dimension과
- d+1~D dimension으로
나눠서 진행 (절반으로 나눠서 (coupling) 진행한다고 이해하기)
1~d dimension은 y=x 형태의 연산(입력 그대로를 출력으로) 진행
d+1~D dimension은 affine transformation 연산을 수행해줌
왜 invertible f를 만들기 위해 이렇게 복잡한 연산을 해주는가?
- invertible하기 때문 (첫번째 식은 당연히/두번째도 이항연산을 통해서 역함수 구하기가 쉬움)
- Jacobian Determinant 연산이 쉽기 때문. (Jacobian이 lower triangular matrix모양)
처음 1~d dimension이 안변하는 문제(모델이 layer의 order를 보존해버림)
⇒ 다음 layer는 1~d dimension을 affine transformation해주는 형태로 변형 (아래 그림 참고)