Generative Adversarial Networks A-Z

Generative Adversarial Networks

State of the art Generative Learning

Progressively Growing GANs

BIG Generative Adversarial Networks


  • Probability theory, Statistics
  • Machine Learning, Deep Learning
  • Python
  • Matrix Calculus


I really love Generative Learning and Generative Adversarial Networks. These amazing models can generate high-quality images (and not only images). I am an AI researcher, and I would like to share with you all my practical experience with GANs.

Generative Adversarial Networks were invented in 2014 and since that time it is a breakthrough in Deep Learning for the generation of new objects. Now, in 2019, there exists around a thousand different types of Generative Adversarial Networks. And it seems impossible to study them all.

I work with GANs for several years, since 2015. And now I can share with you all my experience, going from the classical algorithm to the advanced techniques and state-of-the-art models. I also added a section with different applications of GANs: super-resolution, text to image translation, image to image translation, and others.

This course has rather strong prerequisites:

  • Deep Learning and Machine Learning
  • Matrix Calculus
  • Probability Theory and Statistics
  • Python and preferably PyTorch

Here are tips for taking most from the course:

  1. If you don’t understand something, ask questions. In case of common questions, I will make a new video for everybody.
  2. Use handwritten notes. Not bookmarks and keyboard typing! Handwritten notes!
  3. Don’t try to remember all, try to analyze the material.

Who this course is for:

  • People, who already know Deep Learning and want to study Generative Adversarial Networks from A to Z
  • People, who know GANs, but wants to be in the front of the science

Course content

The 7 Must-Know Deep Learning Algorithms

The field of artificial intelligence (AI) has grown rapidly in recent times, leading to the development of deep learning algorithms. With the launch of AI tools such as DALL-E and OpenAI, deep learning has emerged as a key area of research. However, with an abundance of available algorithms, it can be difficult to know which ones are the most crucial to understand.

Dive into the fascinating world of deep learning and explore the top, must-know algorithms crucial to understanding artificial intelligence.

1. Convolutional Neural Networks (CNNs)

Convolutional Neural Networks (CNNs), also known as ConvNets, are neural networks that excel at object detection, image recognition, and segmentation. They use multiple layers to extract features from the available data. CNNs mainly consist of four layers:

  1. Convolution layer
  2. Rectified Linear Unit (ReLU)
  3. Pooling Layer
  4. Fully Connected Layer

These four layers provide a working mechanism for the network. The convolution layer is the first layer in CNNs, which filters out complex features from the data. Then, the ReLU maps data to train the network. After that, the process sends the map to the pooling layer, which reduces sampling, and converts the data from 2D to a linear array. Finally, the fully connected layer forms a flattened linear matrix used as input to detect images or other data types.

2. Deep Belief Networks

Deep Belief Networks (DBNs) are another popular architecture for deep learning that allows the network to learn patterns in data with artificial intelligence features. They are ideal for tasks such as face recognition software and image feature detection.

The DBN mechanism involves different layers of Restricted Boltzmann Machines (RBM), which is an artificial neural network that helps in learning and recognizing patterns. The layers of DBN follow the top-down approach, allowing communication throughout the system, and the RBM layers provide a robust structure that can classify data based on different categories.

3. Recurrent Neural Networks (RNNs)

Recurrent Neural Network (RNN) is a popular deep learning algorithm with a wide range of applications. The network is best known for its ability to process sequential data and design language models. It can learn patterns and predict outcomes without mentioning them in the code. For example, the Google search engine uses RNN to auto-complete searches by predicting relevant searches.

The network works with interconnected node layers that help memorize and process input sequences. It can then work through those sequences to automatically predict possible outcomes. Additionally, RNNs can learn from prior inputs, allowing them to evolve with more exposure. Therefore, RNNs are ideal for language modeling and sequential modeling.

4. Long Short Term Memory Networks (LSTMs)

Long Short Term Memory Networks (LSTMs) are a Recurrent Neural Network (RNN) type that differs from others in their ability to work with long-term data. They have exceptional memory and predictive capabilities, making LSTMs ideal for applications like time series predictions, natural language processing (NLP), speech recognition, and music composition.

LSTM networks consist of memory blocks arranged in a chain-like structure. These blocks store relevant information and data that may inform the network in the future while removing any unnecessary data to remain efficient.

During data processing, the LSTM changes cell states. First, it removes irrelevant data through the sigmoid layer. Then it processes new data, evaluates necessary parts, and replaces the previous irrelevant data with the new data. Finally, it determines the output based on the current cell state that has filtered data.

The ability to handle long-term data sets LSTMs apart from other RNNs, making them ideal for applications that require such capabilities.

5. Generative Adversarial Networks

Generative Adversarial Networks (GANs) are a type of deep learning algorithm that supports generative AI. They are capable of unsupervised learning and can generate results on their own by training through specific datasets to create new data instances.

The GAN model consists of two key elements: a generator and a discriminator. The generator is trained to create fake data based on its learning. In contrast, the discriminator is trained to check the output for any fake data or errors and rectify the model based on it.

GANs are widely used for image generation, such as enhancing the graphics quality in video games. They are also useful for enhancing astronomical images, simulating gravitational lenses, and generating videos. GANs remain a popular research topic in the AI community, as their potential applications are vast and varied.

6. Multilayer Perceptrons

Multilayer Perceptron (MLP) is another deep learning algorithm, which is also a neural network with interconnected nodes in multiple layers. MLP maintains a single data flow dimension from input to output, which is known as feedforward. It is commonly used for object classification and regression tasks.

The structure of MLP involves multiple input and output layers, along with several hidden layers, to perform filtering tasks. Each layer contains multiple neurons that are interconnected with each other, even across layers. The data is initially fed to the input layer, from where it progresses through the network.

The hidden layers play a significant role by activating functions like ReLUs, sigmoid, and tanh. Subsequently, it processes the data and generates an output on the output layer.

This simple yet effective model is useful for speech and video recognition and translation software. MLPs have gained popularity due to their straightforward design and ease of implementation in various domains.

7. Autoencoders

Autoencoders are a type of deep learning algorithm used for unsupervised learning. It’s a feedforward model with a one-directional data flow, similar to MLP. Autoencoders are fed with input and modify it to create an output, which can be useful for language translation and image processing.

The model consists of three components: the encoder, the code, and the decoder. They encode the input, resize it into smaller units, then decode it to generate a modified version. This algorithm can be applied in various fields, such as computer vision, natural language processing, and recommendation systems.

Choosing the Right Deep Learning Algorithm

To select the appropriate deep learning approach, it is crucial to consider the nature of the data, the problem at hand, and the desired outcome. By understanding each algorithm’s fundamental principles and capabilities, you can make informed decisions.

Choosing the right algorithm can make all the difference in the success of a project. It is an essential step toward building effective deep learning models.

Machine Learning Algorithms

Some Basic Machine Learning Algorithms

elow you’ll find descriptions of and links to some basic and powerful machine-learning algorithms, including:

  • Attention Mechanisms & Memory Networks
  • Bayes Theorem & Naive Bayes Classifiers
  • Decision Trees
  • Eigenvectors, Eigenvalues and Machine Learning
  • Evolutionary & Genetic Algorithms
  • Expert Systems/Rules Engines/Symbolic Reasoning
  • Generative Adversarial Networks (GANs)
  • Graph Analytics and ML
  • Linear Regression
  • Logistic Regression
  • LSTMs and Recurrent Neural Networks
  • Markov Chain Monte Carlo Methods (MCMC)
  • Neural Networks
  • Random Forests
  • Reinforcement Learning
  • Word2vec, Neural Embeddings and NLP

Machine learning algorithms are programs (math and logic) that adjust themselves to perform better as they are exposed to more data. The “learning” part of machine learning means that those programs change how they process data over time, much as humans change how they process data by learning. So a machine-learning algorithm is a program with a specific way to adjusting its own parameters, given feedback on its previous performance in making predictions about a dataset.

Linear Regression

Linear regression is simple, which makes it a great place to start thinking about algorithms more generally. Here it is:

ŷ = a * x + b

Read aloud, you’d say “y-hat equals a times x plus b.”

  • y-hat is the output, or guess made by the algorithm, the dependent variable.
  • a is the coefficient. It’s also the slope of the line that expresses the relationship between x and y-hat.
  • x is the input, the given or independent variable.
  • b is the intercept, where the line crosses the y axis.

Linear regression expresses a linear relationship between the input x and the output y; that is, for every change in x, y-hat will change by the same amount no matter how far along the line you are. The x is transformed by the same a and b at every point.

Linear regression with only one input variable is called Simple Linear Regression. With more than one input variable, it is called Multiple Linear Regression. An example of Simple Linear Regression would be attempting to predict a house price based on the square footage of the house and nothing more.

house_price_estimate = a * square_footage + b

Multiple Linear Regression would take other variables into account, such as the distance between the house and a good public school, the age of the house, etc.

The reason why we’re dealing with y-hat, an estimate about the real value of y, is because linear regression is a formula used to estimate real values, and error is inevitable. Linear regression is often used to “fit” a scatter plot of given x-y pairs. A good fit minimizes the error between y-hat and the actual y; that is, choosing the right a and b will minimize the sum of the differences between each y and its respective y-hat.

That scatter plot of data points may look like a baguette – long in one direction and short in another – in which case linear regression may achieve a fit. (If the data points look like a meandering river, a straight line is probably not the right function to use to make predictions.)

scatter plot

Testing one line after another against the data points of the scatter plot, and automatically correcting it in order to minimize the sum of differences between the line and the points, could be thought of as machine learning in its simplest form.

Apply AI to Business Simulations »

Logistic Regression

Let’s analyze the name first. Logistic regression is not really regression, not in the sense of linear regression, which predicts continuous numerical values. (And it has nothing to do with logistics. 😉

Logistic regression does not do that. It’s actually a binomial classifier that acts like a light switch. A light switch essentially has two states, on and off. Logistic regression takes input data and classifies it as category or not_category, on or off expressed as 1 or 0, based on the strength of the input’s signal. So it’s a light switch for signal that you find in the data. If you want to mix the metaphor, it’s actually more like a transistor, since it both amplifies and gates the signal. More on that here.

Logistic regression takes input data and squishes it, so that no matter what the range of the input is, it will be compressed into the space between 1 and 0. Notice, in the image below, no matter how large the input x becomes, the output y cannot exceed 1, which it asymptotically approaches, and no matter low x is, y cannot fall below 0. That’s how logistic regression compresses input data into a range between 0 and 1, through this s-shaped, sigmoidal transform.

logistic regression

Decision Tree

Decision, or decide, stems from the Latin decidere, which itself is the combination of “de” (off) and “caedere” (to cut). So decision is about the cutting off of possibilities. Decision trees can be used to classify data, and they cut off possibilities of what a given instance of data might be by examining a data point’s features. Is it bigger than a bread box? Well, then it’s not a marble. Is it alive? Well, then it’s not a bicycle. Think of a decision as a game of 20 questions that an algorithm is asking about the data point under examination.

A decision tree is a series of nodes, a directional graph that starts at the base with a single node and extends to the many leaf nodes that represent the categories that the tree can classify. Another way to think of a decision tree is as a flow chart, where the flow starts at the root node and ends with a decision made at the leaves. It is a decision-support tool. It uses a tree-like graph to show the predictions that result from a series of feature-based splits.

decision tree

Here are some useful terms for describing a decision tree:

  • Root Node: A root node is at the beginning of a tree. It represents entire population being analyzed. From the root node, the population is divided according to various features, and those sub-groups are split in turn at each decision node under the root node.
  • Splitting: It is a process of dividing a node into two or more sub-nodes.
  • Decision Node: When a sub-node splits into further sub-nodes, it’s a decision node.
  • Leaf Node or Terminal Node: Nodes that do not split are called leaf or terminal nodes.
  • Pruning: Removing the sub-nodes of a parent node is called pruning. A tree is grown through splitting and shrunk through pruning.
  • Branch or Sub-Tree: A sub-section of decision tree is called branch or a sub-tree, just as a portion of a graph is called a sub-graph.
  • Parent Node and Child Node: These are relative terms. Any node that falls under another node is a child node or sub-node, and any node which precedes those child nodes is called a parent node.
decision tree nodes

Decision trees are a popular algorithm for several reasons:

  • Explanatory Power: The output of decision trees is interpretable. It can be understood by people without analytical or mathematical backgrounds. It does not require any statistical knowledge to interpret them.
  • Exploratory data analysis: Decision trees can enable analysts to identify significant variables and important relations between two or more variables, helping to surface the signal contained by many input variables.
  • Minimal data cleaning: Because decision trees are resilient to outliers and missing values, they require less data cleaning than some other algorithms.
  • Any data type: Decision trees can make classifications based on both numerical and categorical variables.
  • Non-parametric: A decision tree is a non-parametric algorithm, as opposed to neural networks, which process input data transformed into a tensor, via tensor multiplication using large number of coefficients, known as parameters.


  • Overfitting: Over fitting is a common flaw of decision trees. Setting constraints on model parameters and making the model simpler through pruning are two ways to regularize a decision tree.
  • Predicting continuous variables: While decision trees can ingest continuous numerical input, they are not a practical way to predict such values, since decision-tree predictions must be separated into discrete categories, which results in a loss of information when applying the model to continuous values.
  • Heavy feature engineering: The flip side of a decision tree’s explanatory power is that it requires heavy feature engineering. When dealing with unstructured data or data with latent factors, this makes decision trees sub-optimal. Neural networks are clearly superior in this regard.

Random Forest

Random forests are made of many decision trees. They are ensembles of decision trees, each decision tree created by using a subset of the attributes used to classify a given population (they are sub-trees, see above). Those decision trees vote on how to classify a given instance of input data, and the random forest bootstraps those votes to choose the best prediction. This is done to prevent overfitting, a common flaw of decision trees.

A random forest is a supervised classification algorithm. It creates a forest (many decision trees) and orders their nodes and splits randomly. The more trees in the forest, the better the results it can produce.

If you input a training dataset with targets and features into the decision tree, it will formulate some set of rules that can be used to perform predictions.

Example: You want to predict whether a visitor to your e-commerce Web site will enjoy a mystery novel. First, collect information about past books they’ve read and liked. Metadata about the novels will be the input; e.g. number of pages, author, publication date, which series it’s part of if any. The decision tree contains rules that apply to those features; for example, some readers like very long books and some don’t. Inputting metadata about new novels will result in a prediction regarding whether or not the Web site visitor in question would like that novel. Arranging the nodes and defining the rules relies on information gain and Gini-index calculations. With random forests, finding the root node and splitting the feature nodes is done randomly.