生成算法和判别算法有什么区别? [英] What is the difference between a generative and a discriminative algorithm?

查看:206
本文介绍了生成算法和判别算法有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助我了解生成式区分性算法,请记住,我只是一个初学者.

Please, help me understand the difference between a generative and a discriminative algorithm, keeping in mind that I am just a beginner.

推荐答案

假设您有输入数据x,并且要将数据分类为标签y.生成模型学习联合概率分布p(x,y),而判别模型学习有条件概率分布p(y|x)-您应将其理解为"y指定为x".

Let's say you have input data x and you want to classify the data into labels y. A generative model learns the joint probability distribution p(x,y) and a discriminative model learns the conditional probability distribution p(y|x) - which you should read as "the probability of y given x".

这是一个非常简单的例子.假设您具有(x,y)形式的以下数据:

Here's a really simple example. Suppose you have the following data in the form (x,y):

(1,0), (1,0), (2,0), (2, 1)

p(x,y)

      y=0   y=1
     -----------
x=1 | 1/2   0
x=2 | 1/4   1/4

p(y|x)

      y=0   y=1
     -----------
x=1 | 1     0
x=2 | 1/2   1/2

如果花几分钟盯着这两个矩阵,您将了解两个概率分布之间的差异.

If you take a few minutes to stare at those two matrices, you will understand the difference between the two probability distributions.

分布p(y|x)是用于将给定示例x分类为类y的自然分布,这就是将直接对此模型进行建模的算法称为判别算法的原因.生成算法模型p(x,y),可以通过应用贝叶斯规则将其转换为p(y|x),然后用于分类.但是,分布p(x,y)也可以用于其他目的.例如,您可以使用p(x,y)生成可能(x,y)对的.

The distribution p(y|x) is the natural distribution for classifying a given example x into a class y, which is why algorithms that model this directly are called discriminative algorithms. Generative algorithms model p(x,y), which can be transformed into p(y|x) by applying Bayes rule and then used for classification. However, the distribution p(x,y) can also be used for other purposes. For example, you could use p(x,y) to generate likely (x,y) pairs.

从上面的描述中,您可能会认为生成模型更有用,因此更好,但是却不那么简单.

From the description above, you might be thinking that generative models are more generally useful and therefore better, but it's not as simple as that. This paper is a very popular reference on the subject of discriminative vs. generative classifiers, but it's pretty heavy going. The overall gist is that discriminative models generally outperform generative models in classification tasks.

这篇关于生成算法和判别算法有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆