Hot answers tagged

20 votes
Accepted

How to calculate the output shape of conv2d_transpose?

Here is the correct formula for computing the size of the output with tf.layers.conv2d_transpose(): ...
user avatar
  • 316
19 votes
Accepted

GANs (generative adversarial networks) possible for text as well?

Yes, GANs can be used for text. However, there is a problem in the combination of how GANs work and how text is normally generated by neural networks: GANs work by propagating gradients through the ...
user avatar
  • 15.4k
18 votes
Accepted

what is the main difference between GAN and autoencoder?

The main differences are the philosophy that drives the loss metric, and consequently the architecture (the latter goes without saying, obviously). Autoencoders The job of an autoencoder is to ...
user avatar
  • 421
11 votes
Accepted

What is the difference between ImageNet and ImageNet1k? How to download it?

The ImageNet dataset consists of more than 14M images, divided into approximately 22k different labels/classes. However the ImageNet challenge is conducted on just 1k high-level categories (probably ...
user avatar
  • 2,100
10 votes
Accepted

Can we generate huge dataset with Generative Adversarial Networks

This is unlikely to add much beyond your direct data collection efforts. The quality of current GAN outputs (as of 2017) will not be high enough. The images produced by a GAN are typically small and ...
user avatar
  • 27.3k
8 votes

How to calculate the output shape of conv2d_transpose?

Take a look at the source code for tf.keras.Conv2DTranspose, which calls the function deconv_output_length when calculating its ...
user avatar
  • 181
8 votes

Why is my generator loss function increasing with iterations?

I think that there are several issues with your model: First of all - Your generator's loss is not the generator's loss. You have on binary cross-entropy loss function for the discriminator, and you ...
user avatar
  • 2,100
7 votes
Accepted

GAN vs DCGAN difference

A Generative Adversarial Network (GAN) takes the idea of using a generator model to generate fake examples and discrimator model that tries to decide if the image it receives is a fake (i.e. from the ...
user avatar
  • 13.9k
6 votes
Accepted

GAN to generate a custom image does not work

Generating text as an image is extremely difficult and I have never seen a GAN applied in the image space to generate pages of text. The reason this is so hard is because of the way in which text is ...
user avatar
  • 8,488
5 votes

How to calculate the output shape of conv2d_transpose?

Instead of using tf.nn.conv2d_transpose you can use tf.layers.conv2d_transpose It is a wrapper layer and there is no need to ...
user avatar
5 votes

How to use GAN for unsupervised feature extraction from images?

Typically to extract features, you can use the top layer of the network before the output. The intuition is that these features are linearly separable because the top layer is just a logistic ...
user avatar
  • 435
5 votes
Accepted

GAN discriminator converging to one output

What you are experiencing is called mode collapse, which can occur in GAN Training and is one of its "training instability problems". If you are using Vanilla GAN one effective way is to implement ...
user avatar
  • 346
5 votes
Accepted

Why do I get an OOM error although my model is not that large?

Why I am getting OOM error on the large batch size although my dataset and model are not that big? Yes, the batch size is probably the reason. Also, another the reason is that you don't use the ...
user avatar
5 votes
Accepted

Why Gaussian latent variable (noise) for GAN?

Why people often choose the input to a GAN (z) to be samples from a Gaussian? Generally, for two reasons: (1) mathematical simplicity, (2) working well enough in practice. However, as we explain, ...
user avatar
  • 8,559
5 votes

Train a GAN on "before and after" images of dental surgeries

It's a very specific problem and there's no right or wrong solution. I'll just write what I'd do in your position and hope that it is useful. How many "before and after" images will I need? You'...
user avatar
  • 7,498
4 votes
Accepted

What does discriminator of a GAN should do?

The discriminator must classify individual elements as being fake (i.e. created by the generator) or real (i.e. taken from the training dataset). The discriminator generates labels (real/fake) for ...
user avatar
  • 15.4k
4 votes
Accepted

Loss function in GAN

In algorithm 1 of the original GAN article (https://arxiv.org/pdf/1406.2661.pdf), the discriminator is said to be updated by "ascending its stochastic gradient". This is referring to equation 1: $$ \...
user avatar
  • 15.4k
4 votes

High level understanding of residual blocks

Suppose we want to fit a function $f(x)$. We can either try to learn a neural network model $F(\cdot)$ so that $F(x) \approx f(x)$. Or, in the residual network approach, we try to learn a neural ...
user avatar
  • 2,988
4 votes
Accepted

What are "VGG54" and "VGG22" derived from the VGG19 CNN?

Reading the article, it seems like they define VGG54 as the loss calculated from the euclidean distance between the $\phi_{5,4}$ feature maps derived from both the high and low resolution images using ...
user avatar
4 votes

Value Function of Generative Adversarial Network

Your notation is a little confusing, but I suspect this is because you're not reading the original equation exactly right. $\mathbb{E}_{x \sim p_{data}(x)}$ means "the expectation over $x$ drawn ...
user avatar
  • 1,154
4 votes
Accepted

Understanding notation of Goodfellow's GAN objective function

You are thinking of it backwards :) i.e. don't ask "How do we get these expectation parts?" or "how he got from" sum to expectation, ask where we got the sums! The expectations are what we actually ...
user avatar
4 votes
Accepted

DC GAN with Batch Normalization not working

Golden Rule: In Keras, if using Batch Normalization layer, train the discriminator on real and fake images separately. Don't combine them. I was able to solve it by changing the discriminator ...
user avatar
4 votes
Accepted

Does it make sense to do train test split when trainning GANS?

Training GANs is only a partially unsupervised task, IMHO. It's certainly unsupervised for the Generator, but it's supervised for the Adversarial Network. So it might be useful to test the ...
user avatar
  • 5,687
4 votes
Accepted

Is a multi-layer perceptron exactly the same as a simple fully connected neural network?

Yes, a multilayer perceptron is just a collection of interleaved fully connected layers and non-linearities. The usual non-linearity nowadays is ReLU, but in the past sigmoid and tanh non-linearities ...
user avatar
  • 15.4k
3 votes
Accepted

Perform several different torchvision.transforms on ImageFolder object

I've just found out about the class torch.utils.data.ConcatDataset([datasets]) . Its easy to use and documentation is here : http://pytorch.org/docs/master/data.html
user avatar
3 votes
Accepted

Why does TFLearn DCGAN not run on my GPU (on Windows)?

The parts of your code that need to be inside the with tf.device('/gpu:0'): context is the actual computation graph, where the neural network lives. All the ...
user avatar
3 votes

GANs (generative adversarial networks) possible for text as well?

There is even more specific research on this topic: The trained generator is capable of producing sentences with certain level of grammar and logic. Xuerong Xiao, "Text Generation using Generative ...
user avatar
3 votes
Accepted

Using Generative Adversarial Networks for a generation of image layer

In terms of generating an image "layer", that is just the same as generating an output image that can be overlaid on the input using standard graphics software. If you want pixel-level accuracy in the ...
user avatar
  • 27.3k
3 votes

Can we generate huge dataset with Generative Adversarial Networks

I have the exact same issue with a DNN that I am currently building. Taking my data set and synthesizing new data with a GAN seems like a great idea. But the GAN itself will only learn to output ...
user avatar
3 votes

Can we generate huge dataset with Generative Adversarial Networks

Just from a purely theoretical perspective this cannot be possible. Any given training dataset represents a certain amount of information about the structure of a certain space. If you train a GAN on ...
user avatar
  • 131

Only top scored, non community-wiki answers of a minimum length are eligible