Study Notes GAN003: GAN, DCGAN, CGAN, InfoGAN, gan003dcgan

Source: Internet
Author: User

Study Notes GAN003: GAN, DCGAN, CGAN, InfoGAN, gan003dcgan

GAN applications are concentrated on image generation, and NLP and Robt Learning are also expanded. Similar to Actor-Critic in NLP. Https://arxiv.org/pdf/1610.01945.pdf.

Generative Adversarial Nets. Build two networks, one G to generate the network, and one d to divide the network. Training, GNET loss log (1-D (G (z), D network loss-(log (D (x) + log (1-D (G (z ))), not Cross Entropy. Data input: noise is input on the GNET. D. input the hybrid G output data and sample data.

For GNET training, D (G (z) approaches 1 and G loss is the smallest. D network training 2 classification, distinguish between real data and generated data, real data D Output approaches 1, generate data output D (G (z) approaches 0.

The generated data distribution is the same as the actual distribution. D. Start training. The classification capability is limited and there are fluctuations. The actual data and generated data are preliminarily distinguished. D. The training is good, and the probability of generating data is obviously reduced. The increase in the G network affects the D distribution. G network does not move, training D, training is optimal, Dg * (x) = pdata (x)/(pdata (x) + pg (x )). Pg (x) approaches pdata (x), Dg * (x) approaches 0.5, and the G network and D network are in a balanced state. Network Training eventually converges to pg (x) = pdata (x ).

Synchronous training for G and D, one training for G, and k training for D. D. Computation of the same amount of input generated data and sample data loss (not cross entropy separate computation ). Cross entropy sets D (G (z) to 0, resulting in no gradient and failure to update G. Gan d (G (z) eventually converges to 0.5. Gnetwork uses RELU and sigmoid, and D network uses Maxout and dropout. -Log (D (G (z) instead of log (1-D (G (z). When training starts to increase the gradient information, the whole GAN is not a perfect zero-sum game.

GAN can sample at any time and use any micro-model (any neural network ). The image generated by GAN is more Sharp, the work is better, and is worth promoting. Poor training. Confitional GAN, semi-supervised learning.

DCGAN uses convolutional neural networks to effectively train and expand dimensions. Remove the pooling layer of the G network D network. Use Batch Normalization in network D of the G network. Remove the full connection hidden layer. The last layer of the G network uses Tanh, And the other layer uses RELU. D. LeakyRELU is used for each layer of the network.

DCGAN network model: GNET, 100 z-> fc layer-> reshape-> deconv + batchNorm + RELU (4)-> tanh64X64. D network, Version 1, conv + batchNorm + leakyRELU (4)-> reshape-> fc layer 1-> sigmoid. D network, Version 2, conv + batchNorm + leakyRELU (4)-> reshape-> fc layer 2-> softmax.
Layer-4 anti-convolution of the G network and layer-4 convolution of the D network. Network Anti-structure of network D of the G network. D network final output. One method is to use sigmoid to output a single value ranging from 0 to 1 as the probability. The other method uses softmax to output two values, true probability and false probability.
Https://github.com/carpedm20/DCGAN-tensorflow
Https://github.com/sugyan/tf-dcgan

Network feature expression after GAN training. DCGAN + SVM fifar-10 classification experiment. The convolution of each layer of the D network obtains features through 4x4 grid max pooling and connects up to 28672 vectors and SVM, which is better than K-means. DCGAN is used in SVHN portal training, and the effect is good. D. The Network learns Valid feature information without supervision.
G changes the z vector to generate different images. Linear addition and subtraction of the z vector to output a new image. The z vector corresponds to a special feature. GNET unsupervised learning feature expression.
BEGAN generates super realistic images.

CGAN (Conditional Generative Adversarial Nets ). Generate a number field, enter a number, and output the corresponding font. Enter z in the G network and y in the connection. D network input x connects to y. MinGmaxDV (D, G) = Ex ~ Pdata [logD (x | y)] + Ez ~ Pz (z) [log (1-D (G (z | y)].
GAN unsupervised, supervised, input classification, and output image.
MNIST font generation, multiple image tags. MNIST font generation, input numbers, and output the corresponding font. Number one hot processing, 5 corresponds to one hot [0, 0, 0, 0, 0, 0, 0]. Concatenates the input with the 100-Dimension z vector. Train and adjust the z vector, change the output, and solve multiple output problems. Output fonts of different shapes.

InfoGAN, unsupervised CGAN. Information Theory and mutual information. Enter the z + c variable in the G network. C and G network output x Mutual Information Maximization. The relationship between neural network training c and output. Mutual information definition: I (c, G (z, c) = Ec ~ P (c), x ~ G (z, c) [logQ (c | X)] + H (c ). The entropy of H is c, log (c) * c, and Q networks are based on X to Output c. Training Objective Based on I and GAN: minGmaxDV (D, G) = λ I (c, G (z, c )). Network change: the input of network D is only x, without c. Q: network D shares the same network and outputs independently at the last layer.


References:
Https://zhuanlan.zhihu.com/p/27012520

Welcome to paid consultation (150 RMB per hour), My: qingxingfengzi

I created an GAN Daily Report Group, focusing on the progress of each report every day. Gather people who are studying GAN, encourage each other, and move forward together. Add me to pull the group, please note: Join the GAN Daily Report Group.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.