7月28日深度学习笔记——GAN


前言

本文为7月28日深度学习笔记,分为两个章节:

  • Feature Extraction:InfoGAN、VAE-GAN、BiGAN;
  • Intelligent Photo Editing:GAN + Autoencoder.

一、Feature Extraction

The colors represents the characteristics.

1

1、InfoGAN

2

2、VAE-GAN

3

(1)、Algorithm

  • Intialize Encoder, Decoder, and Discriminator;
  • In each iteration:
    • Sample M images { x 1 , x 2 , … , x M } \{x^1, x^2, …, x^M\} {x1,x2,,xM} from database;
    • Generate M codes { z ~ 1 , z ~ 2 , … , z ~ M } \{\tilde{z}^1, \tilde{z}^2, …, \tilde{z}^M \} {z~1,z~2,,z~M} from encoder: z ~ i = E n ( x i ) \tilde{z}^i = En(x^i) z~i=En(xi);
    • Generate M images { x ^ 1 , x ^ 2 , … , x ^ M } \{\hat{x}^1, \hat{x}^2, …, \hat{x}^M \} {x^1,x^2,,x^M} from decoder: x ^ i = D e ( z ~ i ) \hat{x}^i = De(\tilde{z}^i) x^i=De(z~i);
    • Sample M codes { z 1 , z 2 , … , z M } \{z^1, z^2, …, z^M \} {z1,z2,,zM} from prior P ( z ) P(z) P(z);
    • Generate M images { x ^ 1 , x ^ 2 , … , x ^ M } \{\hat{x}^1, \hat{x}^2, …, \hat{x}^M \} {x^1,x^2,,x^M} from decoder: x ^ i = D e ( z i ) \hat{x}^i = De(z^i) x^i=De(zi);
    • Update En to decrese ∣ ∣ x ~ i − x i ∣ ∣ ||\tilde{x}^i - x^i|| ∣∣x~ixi∣∣, decrease K L ( P ( z ^ i ∣ x i ) ) ∣ ∣ P ( z ) KL(P(\hat{z}^i|x^i)) || P(z) KL(P(z^ixi))∣∣P(z);
    • Update De to decrese ∣ ∣ x ~ i − x i ∣ ∣ ||\tilde{x}^i - x^i|| ∣∣x~ixi∣∣, increse D i s ( x ~ i ) Dis(\tilde{x}^i) Dis(x~i) and D i s ( x ^ i ) Dis(\hat{x}^i) Dis(x^i);
    • Update Dis to increase D i s ( x i ) Dis(x^i) Dis(xi), decrese D i s ( x ~ i ) Dis(\tilde{x}^i) Dis(x~i) and D i s ( x ^ i ) Dis(\hat{x}^i) Dis(x^i).

3、BiGAN

4

(1)、Algorithm

  • Intialize Encoder, Decoder, and Discriminator;
  • In each iteration:
    • Sample M images { x 1 , x 2 , … , x M } \{x^1, x^2, …, x^M\} {x1,x2,,xM} from database;
    • Generate M codes { z ~ 1 , z ~ 2 , … , z ~ M } \{\tilde{z}^1, \tilde{z}^2, …, \tilde{z}^M \} {z~1,z~2,,z~M} from encoder: z ~ i = E n ( x i ) \tilde{z}^i = En(x^i) z~i=En(xi);
    • Generate M images { x ^ 1 , x ^ 2 , … , x ^ M } \{\hat{x}^1, \hat{x}^2, …, \hat{x}^M \} {x^1,x^2,,x^M} from decoder: x ^ i = D e ( z ~ i ) \hat{x}^i = De(\tilde{z}^i) x^i=De(z~i);
    • Sample M codes { z 1 , z 2 , … , z M } \{z^1, z^2, …, z^M \} {z1,z2,,zM} from prior P ( z ) P(z) P(z);
    • Generate M codes { x ~ 1 , x ~ 2 , … , x ~ M } \{\tilde{x}^1, \tilde{x}^2, …, \tilde{x}^M \} {x~1,x~2,,x~M} from decoder: x ~ i = D e ( z i ) \tilde{x}^i = De(z^i) x~i=De(zi);
    • Update Dis to increase D i s ( x i , z ~ i ) Dis(x^i, \tilde{z}^i) Dis(xi,z~i), decrease D i s ( x i , z i ) Dis(x^i, z^i) Dis(xi,zi);
    • Update En and De to decrease D i s ( x i , z ~ i ) Dis(x^i, \tilde{z}^i) Dis(xi,z~i), increse D i s ( x ~ i , z i ) Dis(\tilde{x}^i, z^i) Dis(x~i,zi).

二、Intelligent Photo Editing

1、GAN + Autoencoder

5

(1)、Attribute Representation

6
z l o n g 1 N 1 ∑ x ∈ l o n g E n ( x ) − 1 N 2 ∑ x ′ ∉ l o n g E n ( x ′ ) z_{long} \frac{1}{N_1}\sum_{x\in long}En(x) - \frac{1}{N_2}\sum_{x'\notin long}En(x') zlongN11xlongEn(x)N21x/longEn(x)
7

(2)、Basic Idea

8

(3)、Back to z

  • Methode 1:
    z ∗ = a r g   m i n   L ( G ( z ) , x T ) z^* = arg\ min\ L(G(z), x^T) z=arg min L(G(z),xT)

  • Methode 2:
    9

  • Methode 3:
    Using the results from method 2 as the initialization of method 1.

(4)、Editing Photos

z 0 z_0 z0 is the code of the input image.
z ∗ = a r g   m i n   U ( G ( z ) ) + λ 1 ∣ ∣ z − z 0 ∣ ∣ 2 − λ 2 D ( G ( z ) ) z^* = arg\ min\ U(G(z)) + \lambda_1 ||z - z_0||^2 - \lambda_2 D(G(z)) z=arg min U(G(z))+λ1∣∣zz02λ2D(G(z))


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值