"GAN" How interesting to GAN to visualize? Please understand that Google's GAN Lab

Today, we will introduce an interesting gadget -GAN Lab, which is a visual tool against the generation of the network, the novice very friendly and help you quickly understand the workflow and the principle of the GAN.

Author & editor | millet gruel

Edit | There are three words

GAN GAN Lab is an open source visualization tools developed by Google, using the GAN Lab does not require the installation process does not require deep learning library PyTorch or TensorFlow, etc., do not require specialized hardware GPU, via a web browser (recommended Chrome) can be opened at:

https://poloclub.github.io/ganlab/

If you are interested in the source code, you can access github self-learning:

https://github.com/poloclub/ganlab/

Users can use the GAN Lab interactively train generated model and visualizing the intermediate result of the dynamic training process, is animated appreciated GAN training process in every detail, the screen simple and beautiful, I think this is GAN visualizer overall effect of the best, its main interface is as follows:

"GAN" How interesting to GAN to visualize?  Please understand that Google's GAN Lab

 

GAN Lab body consists of three parts: MODEL OVERVIEW GRAPH, LAYERED DISTRIBUTIONS, METRICS, wherein MODEL OVERVIEW GRAPH the GAN model is visualized as a picture, shows the basic structure of the GAN, data flow, the input and output data are visualized; LAYERED DISTRIBUTIONS visualized sample true, the contents generator generates the sample, a gradient generator and the like; mETRICS record a measurement of distance distribution of an iterative training process.

1. Set Model

First, at the top of the interface, we can choose a different data distribution. It is emphasized that: visualization can only work on no more than three dimensions to show, more than three dimensions of data can not be fully demonstrated, so the noise noise throughout the GAN Lab in training samples real samples, samples of fake samples are generated two-dimensional data . Some experimental results for GAN may be associated with related data dimensions, which is in the GAN Lab can not get reflected.

For simple picture, some of the buttons to adjust the model parameters are hidden, to be fully displayed, make sure the edit button next MODEL OVERVIEW GRAPH lit yellow.

For noise noise distribution may be selected 1D Gaussian distribution, a uniform distribution of 1D, 2D Gaussian distribution, uniform 2D, 1D shows where samples showed only in one dimension as a Gaussian / uniform distribution, another dimension remains constant. When the mouse is placed on the generator to the Generator, GAN Lab space conversion will exhibit noise from the process to generate a data stream dynamically shaped, as shown below:

"GAN" How interesting to GAN to visualize?  Please understand that Google's GAN Lab

 

For the distribution of the training data may be selected as shown in GAN Lab built in four types, as shown below:

"GAN" How interesting to GAN to visualize?  Please understand that Google's GAN Lab

 

It may be used on their own drawing function "drawing" the desired distribution of the training data, select the fifth type Draw one by yourself, in the white outline data distribution, and then click to apply, results as shown below:

"GAN" How interesting to GAN to visualize?  Please understand that Google's GAN Lab

 

Lab provided GAN GAN GAN is the simplest, it only supports a single structure of a single discriminator generator, and both of which are fully connected layers, may be disposed on the generator Generator number of hidden layers (hidden layers) and each of the hidden neurons (neurons &) in the number of layers. If for simplicity, may have been trained to use the model, simply select use pre-trained model to the top of the page.

For the loss function, GAN Lab provides Log loss and LeastSq loss, in which the objective function of the former version of the original GAN ​​in the latter is the least squares objective function of GAN.

For the number of iterations and the discriminator generator may be provided separately for each iteration round, the generator / frequency discriminator needs training, updates per epoch can be manually adjusted.

For the optimization algorithm, GAN Lab for generators and offer a discriminator SGD and Adam two algorithms, you can simply select the Optimizer, each algorithm can be set to different learning rates, you can choose in the Learning rate.

2. Model Training

After the model structure, parameters and other information setup is complete, you can train the process model in the top of the console interface control.

"GAN" How interesting to GAN to visualize?  Please understand that Google's GAN Lab

 

The first button Reset the model shows a completely reset the model, the parameters may be set again.

The second button Run / Pause training indicates the start / pause the training process, the training process visualization at different update content, while the data stream will be displayed.

The third button Slow-motion mode that enter slow motion mode, the lit yellow, the GAN operational flow may not display it in steps, in MODEL OVERVIEW GRAPH page, only the current node and the steps involved in the data stream are clearly displayed, the other the imaginary part of the display, help to understand GAN forward and backward propagation by calculation, as shown, respectively determining slow motion and generator modes:

"GAN" How interesting to GAN to visualize?  Please understand that Google's GAN Lab

 

"GAN" How interesting to GAN to visualize?  Please understand that Google's GAN Lab

 

After the fourth button Train for one epoch may be used to control the rhythm of the training, the training i.e. only once, as a yellow lights, Generator select only trained once, or only one training Discriminator, or both are trained once Both, each click will conduct a training epoch.

The final epoch record the number of iterative training model so far.

METRICS in part, the loss of generating and recording the discriminator, and also records the two distributions KL divergence and JS divergence (here calculated by gridding), as shown below. Note that the function of image METRICS part after 2000 times epoch is updated every time.

"GAN" How interesting to GAN to visualize?  Please understand that Google's GAN Lab

 

 3. Visual Data

MODEL OVERVIEW GRAPH module in each node are visualized. Noise Noise sample node (represented green) distribution, the training data set Real Samples sample node (represented using purple) distribution, the sample data generated Fake Samples node (colored purple shown) are distributed in two-dimensional plane out show clearly, As shown below:

"GAN" How interesting to GAN to visualize?  Please understand that Google's GAN Lab

 

In the generator Generator node, manifold generates data will be presented to visualize it, the purple color indicates the range of the data stream shaped, purple degree of depth represents the probability distribution of data level, purple indicates a high probability, light purple indicates a low probability, As shown below:

"GAN" How interesting to GAN to visualize?  Please understand that Google's GAN Lab

 

In the discriminator Discriminator node, the overall prediction result discriminator is in the form of a (hot map) of the heat map shows visually out, wherein the green part represents arbiter considered to be true samples, darker the green indicates discrimination output is closer to 1 ; purple color indicates false determination is considered as a sample, the deeper the purple represents discrimination output is closer to 0; white portion represents a discrimination output is close to 0.5, she can also be understood as its classification plane, as shown below:

"GAN" How interesting to GAN to visualize?  Please understand that Google's GAN Lab

 

In the predictions discriminator Prediction of Samples node, each sample Real Samples true and false samples Fake Samples after discriminator output is displayed, its meaning and the same color.

Gradients nodes gradient generator, visualize the result will generate false samples i.e. samples, a gradient co displayed, indicating the gradient direction in each sample calculated false with line segments, represented by the magnitude of the gradient of the length of the line, as shown in FIG. :

"GAN" How interesting to GAN to visualize?  Please understand that Google's GAN Lab

 

LAYERED DISTRIBUTIONS the manifold real sample, the sample false, false samples, the results of FIG discriminator gradient false samples to demonstrate five nodes in the same figure, as shown below:

"GAN" How interesting to GAN to visualize?  Please understand that Google's GAN Lab

 

Can be adjusted in the content display module LAYERED DISTRIBUTIONS selectively display, just click real samples, fake samples, discriminator, generator, gradients in other words can be described below, the node is the word represented by a solid line will be displayed in the visualized content LAYERED DISTRIBUTIONS, the broken line is no display, as shown below:

"GAN" How interesting to GAN to visualize?  Please understand that Google's GAN Lab

 

 4. The two demo

We give an example to see how to understand the workflow by GAN GAN Lab. First, the training generator causes spurious sample (purple) to a real sample (green) closer gradient false training samples also showed two distributions so close, as shown below:

"GAN" How interesting to GAN to visualize?  Please understand that Google's GAN Lab

 

Next, training discriminator, the discriminator will not influence on the distribution of the sample, but will have an impact FIG heat output, as shown below:

"GAN" How interesting to GAN to visualize?  Please understand that Google's GAN Lab

 

Iteratively updated continuously, and finally the true and false samples nearly coincident samples, and these samples is determined at the output point of 0.5 (white), as shown below:

"GAN" How interesting to GAN to visualize?  Please understand that Google's GAN Lab

 

In addition, we analyzed data sample, understood crash mode, as shown below, all samples were generated false gathered to a point, the generator does not completely fit the distribution of the actual sample, which is reflected by GAN Lab of.

"GAN" How interesting to GAN to visualize?  Please understand that Google's GAN Lab

 

GAN Lab is now known a very good GAN visualization software, simple lively, suitable for entry, but for difficult problems, due to various constraints, it's not a complete visualization.

[1]Minsuk K , Nikhil T , Polo C D H , et al. GAN Lab: Understanding Complex Deep Generative Models using Interactive Visual Experimentation[J]. IEEE Transactions on Visualization and Computer Graphics, 2018:1-1.

Published 472 original articles · won praise 757 · Views 1.61 million +

Guess you like

Origin blog.csdn.net/weixin_42137700/article/details/104814282