Why is FID so popular for evaluating GANs and other generative models?

The FID seems to be the most popular evaluation metric for GANs and other generative models. Why is it so popular? It seems to have some obvious issues, such as the assumption of Gaussian distributions, the lack of ability to detect memorization of training data, and so on. Some other issues are also discussed here: https://en.wikipedia.org/wiki/Fr%C3%A9chet_inception_distance Thanks!
Category: Data Science

Discriminator of a Conditional GAN with continuous labels

OK, let's say we have well-labeled images with non-discrete labels such as brightness or size or something and we want to generate images based on it. If it were done with a discrete label it could be done like: def forward(self, inputs, label): self.batch = inputs.size(0) h = self.res1(inputs) h = self.attn(h) ... h = self.res5(h) h = torch.sum((F.leaky_relu(h,0.2)).view(self.batch,-1,4*4), dim=2) outputs = self.fc(h) if label is not None: embed = self.embedding(label) outputs += torch.sum(embed*h,dim=1,keepdim=True) The embedding can be made to …
Category: Data Science

Generate examples with high targets

Suppose you have trained a Feedforward Neural Network with labeled examples ($x$,$y$) in a regression task to learn a function $\hat{f}$ to predict $y$ from $x$ with some error $\epsilon$ as $\hat{f}(x)=y+\epsilon$. Assuming the performance of the model is adequate, is it possible to generate synthetic $x$ examples that have high values for $\hat{f}(x)$? Has this application of neural networks been researched in the literature? For instance, each example $x$ is vector of product features and the target $y$ is …
Category: Data Science

In which way GAN generator transforms the data(for transforming a noise to the data)?

I have the problem: I understood how GAN works in general, but I need information how it work detailed. The part I don't understand is how the random noise at input is transformed to data on the output(the math side of that process). If anybody knows answer for the question please say it or at least say in which side I need google the question.
Category: Data Science

Are genetic algorithms considered to be generative models?

My understanding is that these sorts of algorithms can evolve/mutate data to hone in on specific desirable areas in large/difficult to search parameter spaces. Assuming one does this successfully, how does one generate new data/sample from that desirable range? Does doing so utilize the same algorithm/structure, or would additional methods need to be introduced? If genetic algorithms improve the efficiency of a search by finding promising regions, can they be considered as a type of generative models? Or would that …
Category: Data Science

How do GANs learn category distributions

I'm currently getting more into the topic of GANs and Generating Models. I've understood how the Generator and Discriminator work together in optimization to generate synthetic samples. Now I'm wondering how the model learns to reflect the occurance frequencies of the true entries in case of categorical data. As an example, lets say we have two columns of entries (1,A), (1, A), (2, A), (2, B) The model, when trained would not only try to output real combinations, so e.g. …
Category: Data Science

How to improve L2 loss for generative autoencoder

I am working with a modified generative autoencoder and having issues getting the L2 sufficiently low. I think problem is that because my data is over a very large range and is standardized to values between zero and one, small discrepancies in the standardized data lead to larger ones in the unstandardized data. Additionally, my other loss terms, despite being averaged by number of points in the batch, are usually orders of magnitude larger than my L2 loss, which I …
Category: Data Science

Generate profile face from front face image

How can I generate profile face image, based on an input of a front face image? specifically, I'm more interested in doing it for illustrated characters. For example, given the input of the front face (left) of Homer Simpson, we'll generate his profile face (right): (source) I'm sure that that the technology exists, as evident by many "2D to 3D Avatar" results (here's one for example), so I figure what I'm looking for should be possible (and maybe easier, since …
Category: Data Science

Time Series Generation - Multi Dimensional Time Series Data

Disclaimer: Mathematicians please don't be mad at me for the use of some of the terminologies in this post. I am an Engineer. :-) Background: So I am currently working on a problem where I have to generate a time series sequence of a process in which n actors are moving in a 2d space. But i don't know if this is even possible .The process being learned by some machine learning model M. BTW! I have never worked with …
Category: Data Science

P-value using Gaussian Discriminate Analysis

I was wondering , in Gaussian Discriminate Analysis (GDA) model, say we have two classes to classify y=0 and y=1 So after fitting the Gaussian over y=0 and y=1 dataset, when we try to predict class label for a new test data point, It says it uses the Bayes rule to calculate P(Y=0/1 | X) and assigns the class having maximum probability. My Query is can we use p-value instead of Bayes rule to test if the new data point …
Category: Data Science

CycleGAN on keras provides an error

from __future__ import print_function, division import scipy, os import scipy.misc from keras.datasets import mnist from keras_contrib.layers.normalization.instancenormalization import InstanceNormalization from keras.layers import Input, Dense, Reshape, Flatten, Dropout, Concatenate from keras.layers import BatchNormalization, Activation, ZeroPadding2D from keras.layers.advanced_activations import LeakyReLU from keras.activations import relu from keras.layers.convolutional import UpSampling2D, Conv2D, Conv2DTranspose from keras.models import Sequential, Model from keras.optimizers import Adam import datetime import matplotlib.pyplot as plt import sys import numpy as np import os import keras import shutil, os, random from keras.models import load_model …
Category: Data Science

WGAN-GP slow critic training time

I am implementing WGAN-GP using Tensorflow 2.0, but each training iteration of the critic is very slow (about 4 secs on my CPU, and somehow 9 secs on Colab GPU). Is WGAN-GP usually this slow or there is a flaw in my code? Here's my code for training the critic: def train_critic(self, X_real, batch_size, gp_loss_factor, optimizer): y_real = np.ones((batch_size, 1)) # Get batch of generated images noise = np.random.normal(0, 1, (batch_size, self.z_dim)) X_fake = self.gen.predict(noise) y_fake = -np.ones((batch_size, 1)) X …
Category: Data Science

Create an RNN on text sources with different lengths

I want to create an RNN to generate a new text based on many examples of existing texts of a certain format in the training data. The type of texts in the training data consists of 3 segments, like so: Example text 1: [Segment 0, ~20 characters] [Segment 1, ~200 characters] [Segment 2, ~400 characters] It is worth mentioning that the segments are all still alphanumerical, but of varying structure. Segment 1 contains more numbers and Segment 2 has more …
Category: Data Science

Issues related to the code for ROI pooling from the feature map

I am trying to do ROI pooling on the feature map obtained from the VGG layers but I don't know how to code this layers. Can anybody help me out? Here is my VGG layers: model=Sequential() model.add(ZeroPadding2D((1,1),input_shape=(3,112,112))) model.add(Convolution2D(64, 3, 3, activation='relu')) model.add(BatchNormalization(momentum=0.99)) model.add(ZeroPadding2D((1,1))) model.add(Convolution2D(64, 3, 3, activation='relu')) model.add(BatchNormalization(momentum=0.99)) model.add(MaxPooling2D((2,2), strides=(2,2), dim_ordering="th")) model.add(ZeroPadding2D((1,1))) model.add(Convolution2D(128, 3, 3, activation='relu')) model.add(BatchNormalization(momentum=0.99)) model.add(ZeroPadding2D((1,1))) model.add(Convolution2D(128, 3, 3, activation='relu')) model.add(BatchNormalization(momentum=0.99)) model.add(MaxPooling2D((2,2), strides=(2,2), dim_ordering="th")) model.add(ZeroPadding2D((1,1))) model.add(Convolution2D(256, 3, 3, activation='relu')) ` The corresponding model is described in the picture …
Category: Data Science

Magenta MusicVAE/GrooVAE conditioning

I want to try different methods of conditioning the decoding process of the Variational Autoencoder Models of the Google Magenta project for my own research project. As far as I can tell, MusicVAE has already been conditioned by the authors on chords (e.g., for the 'hier-multiperf_vel_1bar_med_chords' model). I want to also try other methods, like style tags or diatonicity etc. However, I am having a hard time of figuring out where the respective tensors (one-hot-encoded chords I think) are used …
Category: Data Science

Function for KDE-style distribution generation for sampling

I have some points in pytorch and I would like to sample from a distribution that resembles these points. I noticed that the seaborn kde plots seem to draw out/define a distribution graphically and I was wondering if there was a way to do something similar for sampling purposes. In other words I would like to feed my points into a function that uses them to define/approximate a distribution from which I can sample more points. Is this a feasible …
Category: Data Science

How to build Generative Model when we have more than one variable

I have a data-frame which has looks similar to this: A B C 1 2 2 2 4 3 4 8 5 9 16 7 16 32 11 22 43 14 28 55 17 34 67 20 40 79 23 A,B and C can be assumed to be the features in machine learning literature. I have read maximum likelihood estimation for 1 variable assuming Gaussian distribution. The equation is something like, where xi's are each data-point: Where x1,x2....xn are n …
Category: Data Science

How can I generate handwritten notes given any handwriting sample and text file?

I am new to ML/DL and looking for a good way to generate a handwritten (simulated) file given 2 inputs: A set of sample handwritten notes (for training). All notes will be from the same person. A text file. The output will be a text file in handwritten form, making use of the sample set. Any pointers would be appreciated. I looked at this, but it differs from my requirements in that it does not generate for a given sample …
Category: Data Science

Reverse scaling Synthetic KDE data

For Python 3.9, sklearn version: 0.24.2 and numpy version: 1.20.3, I am using a Kernel Density Estimation (KDE) generative model. The goal is to generate new data using a given input data. The steps to achieve this involve: Scale input data to be in range [-1, 1] using MinMaxScaler Train KDE model on scaled input data Use trained KDE model to generate new sample/synthetic (scaled) data Use trained scaler from step - 1 to get data back in original scale …
Category: Data Science

Neural network architecture to automatically crop a photo of a paper sheet

With an RGB image of a paper sheet with text, I want to obtain an output image which is cropped and deskewed. Example of input: I have tried non-AI tools (such as openCV.findContours) to find the 4 corners of the sheet, but it's not very robust in some lighting conditions, or if there are other elements on the photo. So I see two options: a NN with input=image, output=image, that does everything (including the deskewing, and even also the brightness …
Category: Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.