Discriminative Vs Generative Algorithms

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Generative and Discriminative Models

Most of the Machine Learning and Deep Learning problems that you solve are
conceptualized from the Generative and Discriminative Models. In Machine Learning, one
can clearly distinguish between the two modelling types:
 Classifying an image as a dog or a cat falls under Discriminative Modelling
 Producing a realistic dog or a cat image is a Generative Modelling problem

What Can Discriminative Modelling Do?


 Being a superset of Machine Learning and Deep Learning algorithms, Discriminative
Modelling is not limited to classification tasks, but widely used in object detection,
semantic segmentation, keypoint detection, regression problems, and language
modelling.
 The discriminative model falls under the supervised learning branch. In a
classification task, given that the data is labelled, it tries to distinguish among classes,
for example, a car, traffic light and a truck.  These models correspond image samples
X to class labels Y, and discover the probability of image sample   belonging
to class label  . They learn to model the decision boundaries among classes
(such as cats, dogs and tigers). The decision boundary could be linear or non-
linear. The data points that are far out of the way from the decision boundary
(i.e. the outliers) are not very important. The discriminative model tries to learn a
boundary that separates the positive from the negative class, and comes up with the
decision boundary. Only those closest to this boundary are considered.
Discriminative models classify data points, without providing the model of how the
points were generated.

Examples of Discriminative models:


 Support Vector Machine
 Logistic Regression
 k-Nearest Neighbour (kNN)
 Random Forest
 Deep Neural Network ( such as AlexNet, VGGNet, and ResNet )

Generative Modeling
Generative modelling defines how a dataset is generated. It tries to understand the
distribution of data points, providing a model of how the data is actually generated in terms
of a probabilistic model. (e.g., support vector machines or the perceptron algorithm gives a
separating decision boundary, but no model of generating synthetic data points). The aim is to
generate new samples from what has already been distributed in the training data.
Assume you have an autonomous driving dataset with an urban-scene setting. You now want
to generate images from it that are semantically and spatially similar. To do this, the
generative model must understand the data’s underlying structure and learn the realistic,
generalized representation of the dataset, such as the sky is blue, buildings are usually tall,
and pedestrians use sidewalks.
To generate training samples, you need a training dataset, which consists of unlabelled data
points. Each data point has its own features, such as individual pixel values (image-domain)
and a set of vocabulary (text-domain). This whole process of generation is stochastic and
influences the individual samples generated by the model.
Generative models learn to approximate p(x), which is the probability of observing
observation x. This helps them represent the data more realistically. In the above figure, the
generative model learns to generate urban-scene images, taking a random noise as a matrix or
vector. Its task is to generate realistic samples X, with probability distribution similar to
Pdata (original data from the training set). The noise adds randomness to the model and ensures
that the images generated are diverse.

Types of Generative Models


 Naive Bayes
 Hidden Markov Models
 Autoencoder
 Boltzmann Machines
 Variational Autoencoder
 Generative Adversarial Networks

https://www.youtube.com/watch?v=NGf0voTMlcs
https://www.youtube.com/watch?v=OCwZyYH14uw
https://online.stat.psu.edu/stat501/lesson/1/1.1

You might also like