{"id":14424,"date":"2020-05-18T13:58:16","date_gmt":"2020-05-18T08:28:16","guid":{"rendered":"https:\/\/www.mygreatlearning.com\/blog\/generative-adversarial-networks-gans\/"},"modified":"2024-09-02T17:17:21","modified_gmt":"2024-09-02T11:47:21","slug":"generative-adversarial-networks-gans","status":"publish","type":"post","link":"https:\/\/www.mygreatlearning.com\/blog\/generative-adversarial-networks-gans\/","title":{"rendered":"Introduction to Generative Adversarial Networks (GANs)"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"supervised-vs-unsupervised-learning\"><strong>Supervised vs Unsupervised Learning<\/strong><\/h2>\n\n\n\n<p>In <a aria-label=\"Supervised Learning (opens in a new tab)\" href=\"https:\/\/www.mygreatlearning.com\/blog\/what-is-machine-learning\/\" target=\"_blank\" rel=\"noreferrer noopener\">Supervised Learning<\/a>, we train the machine using data that is well \"labeled\". It means the data is already tagged with the correct answer. A supervised learning algorithm learns from labeled training data and predicts outcomes for unforeseen data. There are two subcategories of supervised learning, viz- <a aria-label=\" (opens in a new tab)\" href=\"https:\/\/www.mygreatlearning.com\/blog\/linear-regression-in-machine-learning\/\" target=\"_blank\" rel=\"noreferrer noopener\">Regression<\/a> and Classification.<br>Classification means to group the output into a class. If the algorithm tries to label input into two distinct classes, it is called binary classification. Selecting between more than two classes is referred to as <a href=\"https:\/\/www.mygreatlearning.com\/blog\/multiclass-classification-explained\/\">multiclass classification<\/a>. On the other hand, Regression Algorithms are used to predict continuous values such as price, salary, and age.<\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\"Unsupervised Learning (opens in a new tab)\" href=\"https:\/\/www.mygreatlearning.com\/blog\/what-is-machine-learning\/\" target=\"_blank\">Unsupervised Learning<\/a> is a machine learning technique, where the model does not need any supervision. Instead, we need to allow the model to work on its own to discover information. It mainly deals with the unlabelled data. Density estimation, dimensionality reduction, and clustering and some of the main applications of unsupervised learning.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-are-generative-models\"><strong>What are Generative Models?<\/strong><\/h2>\n\n\n\n<p>The learning models in machine learning can be classified into two sub-categories, viz - Discriminative models and Generative models. To understand GANs, we should know about generative models and how they are different from Discriminative models.<\/p>\n\n\n\n<p>Discriminative models classify input data; i.e., given the features of an instance of data, they predict a label or category to which that data belongs. In Supervised Learning, the classification algorithms\/models are examples of discriminative models.<\/p>\n\n\n\n<p>Generative Modelling is an unsupervised learning task in machine learning that involves generating new data samples from the probability distribution of training data. Given some data, the aim is to have a model for the underlying probability distribution of that data so that we can draw samples that are similar to our training data.<\/p>\n\n\n\n<p>Mathematically, generative models learn the joint probability distribution P(X,Y), whereas the discriminative models learn the posterior probability, P(Y|X), that is the probability of the label Y given the data X.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"uses-of-generative-models\"><strong>Uses of Generative Models<\/strong><\/h4>\n\n\n\n<p>1. It can help in generating artificial faces.<\/p>\n\n\n\n<p>2. It can be used in Text to image generation.<\/p>\n\n\n\n<p>3. It can produce fake voices or noises and can be used in image denoising.<\/p>\n\n\n\n<p>4. It can be used in MRI image reconstruction.<\/p>\n\n\n\n<p>5. It can also be used to generate instances of data to handle imbalanced data.<\/p>\n\n\n\n<p>Generative models target the true distribution of the training data to generate new data points with some variations. Now, it is not always possible for our machine to learn the true distribution of the data, for this, we take the help of a powerful neural network which can help make the machine learn the approximate true distribution of the data.<br>The neural networks we use as generative models have parameters which are smaller than the amount of data we have as training dataset. The models are forced to discover the distribution in order to generate data. <\/p>\n\n\n\n    <div class=\"courses-cta-container\">\n        <div class=\"courses-cta-card\">\n            <div class=\"courses-cta-header\">\n                <div class=\"courses-learn-icon\"><\/div>\n                <span class=\"courses-learn-text\">Texas McCombs, UT Austin<\/span>\n            <\/div>\n            <p class=\"courses-cta-title\">\n                <a href=\"https:\/\/www.mygreatlearning.com\/pg-program-artificial-intelligence-course\" class=\"courses-cta-title-link\">PG Program in AI &amp; Machine Learning<\/a>\n            <\/p>\n            <p class=\"courses-cta-description\">Master AI with hands-on projects, expert mentorship, and a prestigious certificate from UT Austin and Great Lakes Executive Learning.<\/p>\n            <div class=\"courses-cta-stats\">\n                <div class=\"courses-stat-item\">\n                    <div class=\"courses-stat-icon courses-user-icon\"><\/div>\n                    <span>Duration: 12 months<\/span>\n                <\/div>\n                <div class=\"courses-stat-item\">\n                    <div class=\"courses-stat-icon courses-star-icon\"><\/div>\n                    <span>Ratings: 4.72<\/span>\n                <\/div>\n            <\/div>\n            <a href=\"https:\/\/www.mygreatlearning.com\/pg-program-artificial-intelligence-course\" class=\"courses-cta-button\">\n                Start Learning today\n                <div class=\"courses-arrow-icon\"><\/div>\n            <\/a>\n        <\/div>\n    <\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-are-gans\"><strong>What are GANs<\/strong><\/h2>\n\n\n\n<p><strong>Generative adversarial networks, <\/strong>also known as<strong> GANs<\/strong> are deep generative models and like most generative models they use a differential function represented by a neural network known as a Generator network. GANs also consist of another neural network called Discriminator network.<br><\/p>\n\n\n\n<p>A Generator network takes random noise as input and runs that noise through the differential function to transform the noise and reshape it to get a recognisable structure. The output of the generator seems like a real data point. The choice of the random input voice determines which data point will come out of the generator network. Running the generator network with many different input noise values produces many different realistic output data samples. The goal for these generated data samples is to be the fair samples from the distribution of real data.<br><\/p>\n\n\n\n<p>But the generator network needs to be trained before it can generate realistic data points as output. The training process for a generative model is different from that of the training process of a supervised model. For a supervised learning model, each input data is associated with its respective label whereas, for a generative model, the model is shown a lot of data samples and it makes new data samples that come from the same probability distribution.<\/p>\n\n\n\n<p>GANs use an approximation where a second network called the Discriminator guides the Generator to generate the samples from the probability distribution of given data. The Discriminator is a regular <a rel=\"noreferrer noopener\" aria-label=\"neural network (opens in a new tab)\" href=\"https:\/\/www.mygreatlearning.com\/blog\/types-of-neural-networks\/\" target=\"_blank\">neural network<\/a> classifier that classifies the real samples from the fake samples generated by the Generator.<\/p>\n\n\n\n<p>During the training process, the Discriminator is shown real samples half of the time and fake samples from the Generator the other half of the time. It assigns a probability close to \u20181\u2019 to real samples and the probability close to \u20180\u2019 to fake samples.<\/p>\n\n\n\n<p>Meanwhile, the Generator is trying to output samples that the Discriminator would assign a probability of near one and classify them as real samples. Over time the generator is forced to produce the samples that are more realistic outputs in order to fool the Discriminator. It is clear that the two networks are competing against each other and can be termed as adversarial networks.&nbsp;&nbsp;<\/p>\n\n\n\n<p>Note that this adversarial framework has transformed an unsupervised problem with raw data and no samples into a supervised problem with labels we create, that is, real and fake.&nbsp;<\/p>\n\n\n\n<p>In the figure above, the blue line represents the distribution of Discriminator, the green line represents Generative distribution while the bell is the distribution of real data.<\/p>\n\n\n\n<p>The Generator takes random noise value<em> z<\/em> and maps them to output values <em>x. <\/em>The probability distribution over <em>x <\/em>represented by the model becomes denser wherever more values of z are mapped. The Discriminator outputs high values wherever the density of real data is greater than the density of generated data. The Generator changes the samples it produces to move uphill along the function learned by the Discriminator and eventually the Generator\u2019s distribution matches the distribution of real data. Due to this, the Discriminator outputs the probability of 0.5 for every sample because every sample is equally likely to be generated by the real data-set as it is to be generated by the Generator.<\/p>\n\n\n\n<p>We can think of this process as a competition between police and counterfeiters. The Generator network is like a counterfeiter trying to produce fake money and pass it off as real. The police act as a Discriminator network and want to catch the counterfeiter spending the fake money but also do not want to stop people using real money. Over time the police get better at recognising fake money but at the same time, the counterfeiter also improves his techniques to produce fake currency. At some point, the counterfeiter makes exact replicas of the currency and the police can no longer discriminate between the real and fake money.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"where-are-gans-used\"><strong>Where are GANs used<\/strong><\/h2>\n\n\n\n<p>Most of the applications for GANs have been in the field of <a rel=\"noreferrer noopener\" aria-label=\"computer vision (opens in a new tab)\" href=\"https:\/\/www.mygreatlearning.com\/blog\/computer-vision-a-case-study-transfer-learning\/\" target=\"_blank\">computer vision<\/a>. More specifically GANs are good at generating images that have never been seen before. Some of the models that have used GANs are described below:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>StackGAN model<\/strong>: StackGAN model is good at generating images from the description. Text to image synthesis is one of the use cases for Generative Adversarial Networks (GANs) that has many industrial applications. Synthesizing images from text descriptions is a very hard task, as it is very difficult to build a model that can generate images that reflect the meaning of the text.<\/li>\n<\/ol>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>pix2pix model: <\/strong>pix2pix are used for image translation which means that images in one domain can be transformed into images of another domain, For example, blueprints of a building can be transformed into photos of the finished building, or drawing of cats can be transformed into real images of cats<\/li>\n<\/ol>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>CycleGAN<\/strong>: CycleGAN is an unsupervised approach to training image-to-image translation models using the generative adversarial network, or GAN, model architecture. Some of the popular applications of CycleGANs are Object Transfiguration, For example changing an image of horses into zebras or vice-versa.<\/li>\n<\/ol>\n\n\n\n    <div class=\"courses-cta-container\">\n        <div class=\"courses-cta-card\">\n            <div class=\"courses-cta-header\">\n                <div class=\"courses-learn-icon\"><\/div>\n                <span class=\"courses-learn-text\">Texas McCombs, UT Austin<\/span>\n            <\/div>\n            <p class=\"courses-cta-title\">\n                <a href=\"https:\/\/onlineexeced.mccombs.utexas.edu\/gen-ai-for-business-applications-online-course\" class=\"courses-cta-title-link\">Post Graduate Program in Generative AI for Business Applications<\/a>\n            <\/p>\n            <p class=\"courses-cta-description\">Discover the power of generative AI in real-world business scenarios. Learn to lead with data-driven insights and strategy.<\/p>\n            <div class=\"courses-cta-stats\">\n                <div class=\"courses-stat-item\">\n                    <div class=\"courses-stat-icon courses-user-icon\"><\/div>\n                    <span>Duration: 3 months<\/span>\n                <\/div>\n                <div class=\"courses-stat-item\">\n                    <div class=\"courses-stat-icon courses-star-icon\"><\/div>\n                    <span>3 Hands-on Projects<\/span>\n                <\/div>\n            <\/div>\n            <a href=\"https:\/\/onlineexeced.mccombs.utexas.edu\/gen-ai-for-business-applications-online-course\" class=\"courses-cta-button\">\n                Discover the Program\n                <div class=\"courses-arrow-icon\"><\/div>\n            <\/a>\n        <\/div>\n    <\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"tips-for-training-gans\"><strong>Tips for Training GANs<\/strong><\/h2>\n\n\n\n<p>To make GANs work well, it is essential to choose a good architecture. For simple tasks like generating 28 x 28 images of handwritten digits of the MNIST dataset, we can use a fully connected architecture. In this type of architecture, we do not use any convolutional or recurrent layers.<\/p>\n\n\n\n<p>Both the Generator as well as Discriminator must have at least one hidden layer to ensure that they can represent any probability distribution. For the hidden layers, we use \u201cLeakyRELU\u201d as the activation function as they make sure that the gradient can flow through the entire architecture.<\/p>\n\n\n\n<p>A popular choice for the output of the Generator is to use \u201ctanh\u201d (hyperbolic tan) activation function which ensures that the data is in the interval between -1 to +1. The output of discriminator needs to be a probability, to force this constraint we use the sigmoid unit as the output.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"generating-mnist-handwritten-digit\"><strong>Generating MNIST Handwritten Digit&nbsp;<\/strong><\/h2>\n\n\n\n<p>In this section, we are going to use a fully connected architecture of GANs to generate MNIST handwritten digits.&nbsp;We use <a rel=\"noreferrer noopener\" aria-label=\"Python programming language (opens in a new tab)\" href=\"https:\/\/www.mygreatlearning.com\/blog\/python-tutorial-for-beginners-a-complete-guide\/\" target=\"_blank\">Python programming language<\/a> along with Keras library for implementation.<\/p>\n\n\n\n<p>The MNIST dataset is an acronym that stands for the Modified National Institute of Standards and Technology dataset. It is a dataset of 70,000 small square 28\u00d728 pixel grayscale images of handwritten single digits between 0 and 9.<\/p>\n\n\n<figure class=\"wp-block-image size-large td-caption-align-https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/dataset-card-mnist-2.png zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/dataset-card-mnist-2.png\"><img decoding=\"async\" width=\"1024\" height=\"759\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/dataset-card-mnist-2-1024x759.png\" alt=\"MNIST\" class=\"wp-image-14496\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/dataset-card-mnist-2-1024x759.png 1024w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/dataset-card-mnist-2-300x222.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/dataset-card-mnist-2-768x569.png 768w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/dataset-card-mnist-2-696x516.png 696w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/dataset-card-mnist-2-1068x791.png 1068w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/dataset-card-mnist-2-567x420.png 567w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/dataset-card-mnist-2-80x60.png 80w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/dataset-card-mnist-2.png 1181w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">samples from MNIST dataset<\/figcaption><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code> # example of training a gan on mnist\n # import all necessary libararies\n  from numpy import expand_dims\n  from numpy import zeros\n  from numpy import ones\n  from numpy import vstack\n  from numpy.random import randn\n  from numpy.random import randint\n  from keras.datasets.mnist import load_data\n  from keras.optimizers import Adam\n  from keras.models import Sequential\n  from keras.layers import Dense\n  from keras.layers import Reshape\n  from keras.layers import Flatten\n  from keras.layers import Conv2D\n  from keras.layers import Conv2DTranspose\n  from keras.layers import LeakyReLU\n  from keras.layers import Dropout\n  from matplotlib import pyplot\n\n  # define the standalone discriminator model\n  def define_discriminator():\n    d = Sequential()\n  # input_dim is modified from 28x28 to 784\n    d.add(Dense(1024, input_dim=784, activation=LeakyReLU(alpha=0.2)))\n    d.add(Dropout(0.3))\n    d.add(Dense(512, activation=LeakyReLU(alpha=0.2)))\n    d.add(Dropout(0.3))\n    d.add(Dense(256, activation=LeakyReLU(alpha=0.2)))\n    d.add(Dropout(0.3))\n    d.add(Dense(1, activation='sigmoid'))  # Values between 0 and 1\n    d.compile(loss='binary_crossentropy', optimizer=Adam(lr=0.0002, beta_1=0.5), metrics=&#091;'accuracy'])\n    return d\n    \n\n  # define the standalone generator model\n  def define_generator(latent_dim):\n    g = Sequential()\n#latent_dim is dimnetion of noise.It can be anything like 10,50,100\n    g.add(Dense(256, input_dim=latent_dim, activation=LeakyReLU(alpha=0.2)))\n    g.add(Dense(512, activation=LeakyReLU(alpha=0.2)))\n    g.add(Dense(1024, activation=LeakyReLU(alpha=0.2)))\n    g.add(Dense(784, activation='tanh'))  # Values between -1 and 1\n    g.compile(loss='binary_crossentropy', optimizer=Adam(lr=0.0002, beta_1=0.5), metrics=&#091;'accuracy'])\n    return g\n    \n\n  # define the combined generator and discriminator model, for updating the generator\n  def define_gan(g_model, d_model):\n    # make weights in the discriminator not trainable\n    #so that it doesnt change when training generator\n    d_model.trainable = False\n    # connect them\n    model = Sequential()\n    # add generator\n    model.add(g_model)\n    # add the discriminator\n    model.add(d_model)\n    # compile model\n    opt = Adam(lr=0.0002, beta_1=0.5)\n    model.compile(loss='binary_crossentropy', optimizer=opt)\n    return model\n\n  # load and prepare mnist training images\n  def load_real_samples():\n    # load mnist dataset\n    (trainX, _), (_, _) = load_data()\n    # expand to 3d, e.g. add channels dimension\n    X = trainX.reshape(60000, 784)\n    # convert from unsigned ints to floats\n    X = X.astype('float32')\n    # scale from &#091;0,255] to &#091;0,1]\n    X = X \/ 255.0\n    return X\n\n  # select real samples\n  def generate_real_samples(dataset, n_samples):\n    # choose random instances\n    ix = randint(0, dataset.shape&#091;0], n_samples)\n    # retrieve selected images\n    X = dataset&#091;ix]\n    # generate 'real' class labels (1)\n    y = ones((n_samples, 1))\n    return X, y\n\n  # generate points in latent space as input for the generator\n  def generate_latent_points(latent_dim, n_samples):\n    # generate points in the latent space\n    x_input = randn(latent_dim * n_samples)\n    # reshape into a batch of inputs for the network\n    x_input = x_input.reshape(n_samples, latent_dim)\n    return x_input\n\n  # use the generator to generate n fake examples, with class labels\n  def generate_fake_samples(g_model, latent_dim, n_samples):\n    # generate points in latent space\n    x_input = generate_latent_points(latent_dim, n_samples)\n    # predict outputs\n    X = g_model.predict(x_input)\n    # create 'fake' class labels (0)\n    y = zeros((n_samples, 1))\n    return X, y\n\n\n  def plot_loss(losses):\n     \n      d_loss = &#091;v for v in losses&#091;\"D\"]]\n      g_loss = &#091;v for v in losses&#091;\"G\"]]\n      \n      plt.figure(figsize=(10,8))\n      plt.plot(d_loss, label=\"Discriminator loss\")\n      plt.plot(g_loss, label=\"Generator loss\")\n\n      plt.xlabel('Epochs')\n      plt.ylabel('Loss')\n      plt.legend()\n      plt.show()\n      \n  def plot_generated(n_ex=10, dim=(1, 10), figsize=(12, 2)):\n      noise = np.random.normal(0, 1, size=(n_ex, z_dim))\n      generated_images = g_model.predict(noise)\n      generated_images = generated_images.reshape(generated_images.shape&#091;0], 28, 28)\n      plt.figure(figsize=figsize)\n      for i in range(generated_images.shape&#091;0]):\n          plt.subplot(dim&#091;0], dim&#091;1], i+1)\n          plt.imshow(generated_images&#091;i, :, :], interpolation='nearest', cmap='gray_r')\n          plt.axis('off')\n      plt.tight_layout()\n      plt.show()\n\n  # train the generator and discriminator\n  def train(g_model, d_model, gan_model, dataset, latent_dim, n_epochs=100, n_batch=256):\n    losses = {\"D\":&#091;], \"G\":&#091;]}\n    samples = &#091;]\n    bat_per_epo = int(dataset.shape&#091;0] \/ n_batch)\n    half_batch = int(n_batch \/ 2)\n    # manually enumerate epochs\n    for i in range(n_epochs):\n      # enumerate batches over the training set\n      for j in range(bat_per_epo):\n        # get randomly selected 'real' samples\n        X_real, y_real = generate_real_samples(dataset, half_batch)\n        # generate 'fake' examples\n        X_fake, y_fake = generate_fake_samples(g_model, latent_dim, half_batch)\n        # create training set for the discriminator\n        X, y = vstack((X_real, X_fake)), vstack((y_real, y_fake))\n        # update discriminator model weights\n        d_model.trainable = True\n        d_loss, _ = d_model.train_on_batch(X, y)\n        # prepare points in latent space as input for the generator\n        X_gan = generate_latent_points(latent_dim, n_batch)\n        # create inverted labels for the fake samples\n        y_gan = ones((n_batch, 1))\n        # update the generator via the discriminator's error\n        d_model.trainable = False #discriminator is not trained while training gan\n        g_loss = gan_model.train_on_batch(X_gan, y_gan)\n      print(\"###################### epoch {} completed #########################\".format(i))\n      plot_generated()\n      # Only store losses from final batch of epoch\n      losses&#091;\"D\"].append(d_loss)\n      losses&#091;\"G\"].append(g_loss)\n     # Update the plots\n    plot_loss(losses)\n\n\n  # size of the latent space\n  latent_dim = 100\n  # create the discriminator\n  d_model = define_discriminator()\n  # create the generator\n  g_model = define_generator(latent_dim)\n  # create the gan\n  gan_model = define_gan(g_model, d_model)\n  # load image data\n  dataset = load_real_samples()\n  # train model\n  train(g_model, d_model, gan_model, dataset, latent_dim,n_epochs=200)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"output\">Output:<\/h2>\n\n\n\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\">\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\">\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\">\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\"><figure class=\"wp-block-image zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-119.png\"><img decoding=\"async\" width=\"859\" height=\"103\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-119.png\" alt=\"GANs\" class=\"wp-image-14427\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-119.png 859w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-119-300x36.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-119-768x92.png 768w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-119-696x83.png 696w\" sizes=\"(max-width: 859px) 100vw, 859px\" \/><figcaption class=\"wp-element-caption\">Images generated by the generator after the first epoch<\/figcaption><\/figure>\n\n\n<figure class=\"wp-block-image zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-120.png\"><img decoding=\"async\" width=\"865\" height=\"110\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-120.png\" alt=\"GANs\" class=\"wp-image-14428\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-120.png 865w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-120-300x38.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-120-768x98.png 768w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-120-696x89.png 696w\" sizes=\"(max-width: 865px) 100vw, 865px\" \/><figcaption class=\"wp-element-caption\"> <em>Images generated by the generator after the 34th epoch<\/em> <\/figcaption><\/figure>\n\n\n<figure class=\"wp-block-image zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-121.png\"><img decoding=\"async\" width=\"869\" height=\"104\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-121.png\" alt=\"GANs\" class=\"wp-image-14429\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-121.png 869w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-121-300x36.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-121-768x92.png 768w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-121-696x83.png 696w\" sizes=\"(max-width: 869px) 100vw, 869px\" \/><figcaption class=\"wp-element-caption\"> <em>Images generated by the generator after the 100th epoch<\/em> <\/figcaption><\/figure>\n\n\n<figure class=\"wp-block-image zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-123.png\"><img decoding=\"async\" width=\"876\" height=\"104\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-123.png\" alt=\"GANs\" class=\"wp-image-14430\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-123.png 876w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-123-300x36.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-123-768x91.png 768w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-123-696x83.png 696w\" sizes=\"(max-width: 876px) 100vw, 876px\" \/><figcaption class=\"wp-element-caption\"> <em>Images generated by the generator after the 181st epoch<\/em> <\/figcaption><\/figure>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<p>As we can see we are able to generate decent replicas of the MNIST dataset. Although an alternative is to use DCGANs (Deep Convolutional GANs) which may produce better results than a simple MPL (Multi-Layered Perceptron) which we used here.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"variational-autoencodersvae\"><strong>Variational Autoencoders(VAE)<\/strong><\/h2>\n\n\n\n<p>VAE are deep latent variables (Latent variables are the variables which we cannot observe in training and test datasets. These variables cannot be measured on a quantitative scale) models that use artificial neural networks to infer an approximate posterior over latent variables and to generate new data samples.<\/p>\n\n\n\n<p>VAE are deep learning techniques which are recognized as being able to draw images, interpolate between sentences and achieve great results in semi supervised learning.<\/p>\n\n\n\n<p>This brings us to the end of this article where we have learned about GANs in <a rel=\"noreferrer noopener\" aria-label=\"deep learning (opens in a new tab)\" href=\"https:\/\/www.mygreatlearning.com\/blog\/what-is-deep-learning\/\" target=\"_blank\">deep learning<\/a> and its implementation.<\/p>\n\n\n\n<p>If you wish to learn more about Python and the concepts of <a rel=\"noreferrer noopener\" aria-label=\"ML (opens in a new tab)\" href=\"https:\/\/www.mygreatlearning.com\/blog\/what-is-machine-learning\/\" target=\"_blank\">ML<\/a>, upskill with <a rel=\"noreferrer noopener\" aria-label=\"Great Learning\u2019s PG Program Artificial Intelligence and Machine Learning (opens in a new tab)\" href=\"https:\/\/www.mygreatlearning.com\/pg-program-artificial-intelligence-course\" target=\"_blank\">Great Learning\u2019s PG Program Artificial Intelligence and Machine Learning<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Supervised vs Unsupervised Learning In Supervised Learning, we train the machine using data that is well \"labeled\". It means the data is already tagged with the correct answer. A supervised learning algorithm learns from labeled training data and predicts outcomes for unforeseen data. There are two subcategories of supervised learning, viz- Regression and Classification.Classification means [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":14498,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[2],"tags":[],"content_type":[],"class_list":["post-14424","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-artificial-intelligence"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Introduction to Generative Advesarial Networks (GANs)<\/title>\n<meta name=\"description\" content=\"Generative Adversarial Networks or GAN are a type of deep generative models which are capable of generating new data samples from the underlying probability distribution of training data\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mygreatlearning.com\/blog\/generative-adversarial-networks-gans\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Introduction to Generative Adversarial Networks (GANs)\" \/>\n<meta property=\"og:description\" content=\"Generative Adversarial Networks or GAN are a type of deep generative models which are capable of generating new data samples from the underlying probability distribution of training data\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mygreatlearning.com\/blog\/generative-adversarial-networks-gans\/\" \/>\n<meta property=\"og:site_name\" content=\"Great Learning Blog: Free Resources what Matters to shape your Career!\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/GreatLearningOfficial\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-05-18T08:28:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-02T11:47:21+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/shutterstock_769510177-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"700\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Great Learning Editorial Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/Great_Learning\" \/>\n<meta name=\"twitter:site\" content=\"@Great_Learning\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Great Learning Editorial Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generative-adversarial-networks-gans\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generative-adversarial-networks-gans\\\/\"},\"author\":{\"name\":\"Great Learning Editorial Team\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\"},\"headline\":\"Introduction to Generative Adversarial Networks (GANs)\",\"datePublished\":\"2020-05-18T08:28:16+00:00\",\"dateModified\":\"2024-09-02T11:47:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generative-adversarial-networks-gans\\\/\"},\"wordCount\":1761,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generative-adversarial-networks-gans\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/04\\\/shutterstock_769510177-1.jpg\",\"articleSection\":[\"AI and Machine Learning\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generative-adversarial-networks-gans\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generative-adversarial-networks-gans\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generative-adversarial-networks-gans\\\/\",\"name\":\"Introduction to Generative Advesarial Networks (GANs)\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generative-adversarial-networks-gans\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generative-adversarial-networks-gans\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/04\\\/shutterstock_769510177-1.jpg\",\"datePublished\":\"2020-05-18T08:28:16+00:00\",\"dateModified\":\"2024-09-02T11:47:21+00:00\",\"description\":\"Generative Adversarial Networks or GAN are a type of deep generative models which are capable of generating new data samples from the underlying probability distribution of training data\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generative-adversarial-networks-gans\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generative-adversarial-networks-gans\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generative-adversarial-networks-gans\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/04\\\/shutterstock_769510177-1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/04\\\/shutterstock_769510177-1.jpg\",\"width\":1000,\"height\":700,\"caption\":\"GAN\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generative-adversarial-networks-gans\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AI and Machine Learning\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/artificial-intelligence\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Introduction to Generative Adversarial Networks (GANs)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"name\":\"Great Learning Blog\",\"description\":\"Learn, Upskill &amp; Career Development Guide and Resources\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"alternateName\":\"Great Learning\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\",\"name\":\"Great Learning\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"width\":900,\"height\":900,\"caption\":\"Great Learning\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/GreatLearningOfficial\\\/\",\"https:\\\/\\\/x.com\\\/Great_Learning\",\"https:\\\/\\\/www.instagram.com\\\/greatlearningofficial\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/in.pinterest.com\\\/greatlearning12\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/beaconelearning\\\/\"],\"description\":\"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.\",\"email\":\"info@mygreatlearning.com\",\"legalName\":\"Great Learning Education Services Pvt. Ltd\",\"foundingDate\":\"2013-11-29\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"1001\",\"maxValue\":\"5000\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\",\"name\":\"Great Learning Editorial Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"caption\":\"Great Learning Editorial Team\"},\"description\":\"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.\",\"sameAs\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/\",\"https:\\\/\\\/in.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/Great_Learning\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCObs0kLIrDjX2LLSybqNaEA\"],\"award\":[\"Best EdTech Company of the Year 2024\",\"Education Economictimes Outstanding Education\\\/Edtech Solution Provider of the Year 2024\",\"Leading E-learning Platform 2024\"],\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/author\\\/greatlearning\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Introduction to Generative Advesarial Networks (GANs)","description":"Generative Adversarial Networks or GAN are a type of deep generative models which are capable of generating new data samples from the underlying probability distribution of training data","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.mygreatlearning.com\/blog\/generative-adversarial-networks-gans\/","og_locale":"en_US","og_type":"article","og_title":"Introduction to Generative Adversarial Networks (GANs)","og_description":"Generative Adversarial Networks or GAN are a type of deep generative models which are capable of generating new data samples from the underlying probability distribution of training data","og_url":"https:\/\/www.mygreatlearning.com\/blog\/generative-adversarial-networks-gans\/","og_site_name":"Great Learning Blog: Free Resources what Matters to shape your Career!","article_publisher":"https:\/\/www.facebook.com\/GreatLearningOfficial\/","article_published_time":"2020-05-18T08:28:16+00:00","article_modified_time":"2024-09-02T11:47:21+00:00","og_image":[{"width":1000,"height":700,"url":"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/shutterstock_769510177-1.jpg","type":"image\/jpeg"}],"author":"Great Learning Editorial Team","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/Great_Learning","twitter_site":"@Great_Learning","twitter_misc":{"Written by":"Great Learning Editorial Team","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mygreatlearning.com\/blog\/generative-adversarial-networks-gans\/#article","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/generative-adversarial-networks-gans\/"},"author":{"name":"Great Learning Editorial Team","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad"},"headline":"Introduction to Generative Adversarial Networks (GANs)","datePublished":"2020-05-18T08:28:16+00:00","dateModified":"2024-09-02T11:47:21+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/generative-adversarial-networks-gans\/"},"wordCount":1761,"commentCount":0,"publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/generative-adversarial-networks-gans\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/shutterstock_769510177-1.jpg","articleSection":["AI and Machine Learning"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.mygreatlearning.com\/blog\/generative-adversarial-networks-gans\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.mygreatlearning.com\/blog\/generative-adversarial-networks-gans\/","url":"https:\/\/www.mygreatlearning.com\/blog\/generative-adversarial-networks-gans\/","name":"Introduction to Generative Advesarial Networks (GANs)","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/generative-adversarial-networks-gans\/#primaryimage"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/generative-adversarial-networks-gans\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/shutterstock_769510177-1.jpg","datePublished":"2020-05-18T08:28:16+00:00","dateModified":"2024-09-02T11:47:21+00:00","description":"Generative Adversarial Networks or GAN are a type of deep generative models which are capable of generating new data samples from the underlying probability distribution of training data","breadcrumb":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/generative-adversarial-networks-gans\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mygreatlearning.com\/blog\/generative-adversarial-networks-gans\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/generative-adversarial-networks-gans\/#primaryimage","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/shutterstock_769510177-1.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/shutterstock_769510177-1.jpg","width":1000,"height":700,"caption":"GAN"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mygreatlearning.com\/blog\/generative-adversarial-networks-gans\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/www.mygreatlearning.com\/blog\/"},{"@type":"ListItem","position":2,"name":"AI and Machine Learning","item":"https:\/\/www.mygreatlearning.com\/blog\/artificial-intelligence\/"},{"@type":"ListItem","position":3,"name":"Introduction to Generative Adversarial Networks (GANs)"}]},{"@type":"WebSite","@id":"https:\/\/www.mygreatlearning.com\/blog\/#website","url":"https:\/\/www.mygreatlearning.com\/blog\/","name":"Great Learning Blog","description":"Learn, Upskill &amp; Career Development Guide and Resources","publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"alternateName":"Great Learning","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mygreatlearning.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization","name":"Great Learning","url":"https:\/\/www.mygreatlearning.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","width":900,"height":900,"caption":"Great Learning"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/GreatLearningOfficial\/","https:\/\/x.com\/Great_Learning","https:\/\/www.instagram.com\/greatlearningofficial\/","https:\/\/www.linkedin.com\/school\/great-learning\/","https:\/\/in.pinterest.com\/greatlearning12\/","https:\/\/www.youtube.com\/user\/beaconelearning\/"],"description":"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.","email":"info@mygreatlearning.com","legalName":"Great Learning Education Services Pvt. Ltd","foundingDate":"2013-11-29","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"1001","maxValue":"5000"}},{"@type":"Person","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad","name":"Great Learning Editorial Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","caption":"Great Learning Editorial Team"},"description":"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.","sameAs":["https:\/\/www.mygreatlearning.com\/","https:\/\/in.linkedin.com\/school\/great-learning\/","https:\/\/x.com\/https:\/\/twitter.com\/Great_Learning","https:\/\/www.youtube.com\/channel\/UCObs0kLIrDjX2LLSybqNaEA"],"award":["Best EdTech Company of the Year 2024","Education Economictimes Outstanding Education\/Edtech Solution Provider of the Year 2024","Leading E-learning Platform 2024"],"url":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"}]}},"uagb_featured_image_src":{"full":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/shutterstock_769510177-1.jpg",1000,700,false],"thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/shutterstock_769510177-1-150x150.jpg",150,150,true],"medium":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/shutterstock_769510177-1-300x210.jpg",300,210,true],"medium_large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/shutterstock_769510177-1-768x538.jpg",768,538,true],"large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/shutterstock_769510177-1.jpg",1000,700,false],"1536x1536":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/shutterstock_769510177-1.jpg",1000,700,false],"2048x2048":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/shutterstock_769510177-1.jpg",1000,700,false],"web-stories-poster-portrait":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/shutterstock_769510177-1.jpg",640,448,false],"web-stories-publisher-logo":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/shutterstock_769510177-1.jpg",96,67,false],"web-stories-thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/04\/shutterstock_769510177-1.jpg",150,105,false]},"uagb_author_info":{"display_name":"Great Learning Editorial Team","author_link":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"},"uagb_comment_info":0,"uagb_excerpt":"Supervised vs Unsupervised Learning In Supervised Learning, we train the machine using data that is well \"labeled\". It means the data is already tagged with the correct answer. A supervised learning algorithm learns from labeled training data and predicts outcomes for unforeseen data. There are two subcategories of supervised learning, viz- Regression and Classification.Classification means&hellip;","_links":{"self":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/14424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/comments?post=14424"}],"version-history":[{"count":15,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/14424\/revisions"}],"predecessor-version":[{"id":110609,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/14424\/revisions\/110609"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media\/14498"}],"wp:attachment":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media?parent=14424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/categories?post=14424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/tags?post=14424"},{"taxonomy":"content_type","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/content_type?post=14424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}