Autoencoder

‍이세현·2024년 4월 13일
1

Autoencoder

  • Label 되지 않은 데이터의 효율적인 코딩을 학습하기 위한 neural network
    • output이 입력과 동일한 feedforward network이기 때문에 label이 필요 없다.
    • 데이터로부터 자동으로 label을 학습한다.
    • xx → autoencoder → xx'
    • Self-supervised learning: 입력으로 output 스스로 배울 수 있다.(빈칸 채우기와 동일)
    • Unsupervised learning
  • Priciple Component Analysis의 비선형적인 일반화라고 할 수 있다.
  • input을 낮은 차원의 code(기계가 이해할 수 있는representation)으로 표현하고 code로부터 재구조화한다.
    • xx → encoder → zz →decoder → xx'
    • xx: input
    • zz: xx에 대한 representation or code(latent)
      • 옳은 representation인지 판단하기 위해 x==xx == x'인지 확인해야 한다.
    • xx': zz로부터 복원 된 output

Encoder

  • Encoder는 input을 받아 상응하는 latent code로 encoding 한다.
    • xx → encoder → zz
  • z=Eθ(x)\mathbf{z} = E_\theta(\mathbf{x})
    • EE: neural network로 구현된 function, encoding model
      • θ\theta: network parameter
    • x\mathbf{x}: input tensor
    • z\mathbf{z}: output tensor

Decoder

  • Decoder는 latent code를 받아 output으로 decoding 한다.
    • zz →decoder → xx'
  • x=Dϕ(z)\mathbf{x'}=D_\phi(\mathbf{z)}
    • DD: neural network로 구현된 function, decoding model
      • ϕ\phi: network parameter
    • z\mathbf{z}: input tensor
    • x\mathbf{x'}: output tensor

End-to-End Learning

  • Autoencoder는 입력으로 출력이 지도되기 때문에 self-supervised이다.
  • x=Dϕ(Eθ(x))=DϕEθ(x)\mathbf{x'}=D_\phi(E_\theta(\mathbf{x}))=D_\phi \circ E_\theta(\mathbf{x})
    • DϕEθ(x)D_\phi \circ E_\theta(\mathbf{x}): neural network로 구현된 autoencoder
      • θ\theta, ϕ\phi: network parameter
    • x\mathbf{x}: input
    • x\mathbf{x'}: output prediction
  • Performance measurement
    l(x,x)=xxl(\mathbf{x}, \mathbf{x'})=\|\mathbf{x}-\mathbf{x'}\|
  • Learning objective
    minkl(xk,xk)\min\sum_{k}l(\mathbf{x}_k, \mathbf{x'}_k)
    • 최적의 parameter를 찾는 방법
      arg minθ,ϕkl(xk,xk)\argmin_{\theta, \phi}\sum_{k}l(\mathbf{x}_k, \mathbf{x'}_k)
      x\mathbf{x'}에 parameter θ{\theta}, ϕ{\phi}가 포함되어 있다.
      l(x,x)=xx =xDϕEθ(x)l(\mathbf{x}, \mathbf{x'})=\|\mathbf{x}-\mathbf{x'}\| \ = \|\mathbf{x}- D_\phi \circ E_\theta(\mathbf{x})\|
  • gradient θ,ϕl\nabla_{\theta, \phi}l back propagation을 통해 최적의 θ\theta, ϕ\phi를 찾을 수 있다.

Example

28 * 28 image가 있을 때 256차원으로 linear operation
numpy는 row major

  • 입력 x784\mathbf{x}_{784}: 784×1784 \times 1
  • 출력 y256\mathbf{y}_{256}: 256×1256 \times 1
    y=W×x\mathbf{y} = \mathbf{W} \times \mathbf{x}
  • parameter WW: 256×784256 \times 784
    WT\mathbf{W}^T: 784×256784 \times 256
profile
Hi, there 👋

0개의 댓글

관련 채용 정보