如何使用python中的softmax输出进行神经网络和机器学习来解释多项式Lo​​git模型? [英] How to use softmax output in python for neural-network and machine-learning to interpret Multinomial Logit Model?

查看:76
本文介绍了如何使用python中的softmax输出进行神经网络和机器学习来解释多项式Lo​​git模型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它涉及使用softmax函数输出进行机器学习和神经网络来理解和解释多项式Lo​​git模型.

It involves the use of softmax function output for machine-learning and neural-network to understand and interpret Multinomial Logit Model.

推荐答案

Softmax函数是神经网络内深度学习中使用的最重要的输出函数之一(请参阅Uniqtech在几分钟内了解Softmax).Softmax函数适用于有三类或更多类结果的情况.softmax公式将e提升到每个值得分的指数得分,并通过e指数得分值的和求和.例如,如果我知道这四个类别的Logit分数是:[3.00,2.0,1.00,0.10],为了获得概率输出,可以将softmax函数应用如下:

Softmax function is one of the most important output function used in deep learning within the neural networks (see Understanding Softmax in minute by Uniqtech). The Softmax function is apply where there are three or more classes of outcomes. The softmax formula takes the e raised to the exponent score of each value score and devide it by the sum of e raised the exponent scores values. For example, if I know the Logit scores of these four classes to be: [3.00, 2.0, 1.00, 0.10], in order to obtain the probabilities outputs, the softmax function can be apply as follows:

  1. 将numpy导入为np

  1. import numpy as np

def softmax(x):

def softmax(x):

print(softmax(scores))

print(softmax(scores))

输出:概率(p)= 0.642 0.236 0.087 0.035

Output: probabilities (p) = 0.642 0.236 0.087 0.035

所有概率的总和(p)= 0.642 + 0.236 + 0.087 + 0.035 = 1.00.您可以尝试替换上述分数中您知道的任何值,您将获得不同的值.所有值或概率的总和将等于1.这是有道理的,因为所有概率的总和等于1,从而将Logit分数转换为概率分数,以便我们可以更好地进行预测.最后,softmax输出可以帮助我们理解和解释多项式Lo​​git模型.如果您喜欢这些想法,请在下面留下您的评论.

The sum of all probabilities (p) = 0.642 + 0.236 + 0.087 + 0.035 = 1.00. You can try to substitute any value you know in the above scores, and you will get a different values. The sum of all the values or probabilities will be equal to one. That’s makes sense, because the sum of all probability is equal to one, thereby turning Logit scores to probability scores, so that we can predict better. Finally, the softmax output, can help us to understand and interpret Multinomial Logit Model. If you like the thoughts, please leave your comments below.

这篇关于如何使用python中的softmax输出进行神经网络和机器学习来解释多项式Lo​​git模型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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