SoftMax A在NN中必须具有吗?

发布于 2025-01-23 21:15:39 字数 558 浏览 3 评论 0 原文

我想知道SoftMax是否是多类(超过2)分类神经网络中的必备方法?我正在阅读一些堆栈跨流的主题,看到人们在说有必要在最后一层拥有SoftMax,但是我不确定是否真的有必要? (这是讨论的链接 https://stackoverflow.com/questions/70303466/do-i--i--i---------------我在我的梅尔蒂级分类#:〜:text = yes%20 you%20 need,this%20is%20- 据我所知,SoftMax的作用只是将输出范围缩放到0到1之间,总和为1。因此,我不确定它如何影响整个网络和损失计算。感谢您提前回答。

I was wondering if softmax is a must-have in a multi-class(more than 2) classification neural network? I was reading some stack-overflow topics and I saw people talking that it's necessary to have softmax at the last layer, but I am not sure if it really is necessary? (here is the link for the discussion https://stackoverflow.com/questions/70303466/do-i-need-to-apply-the-softmax-function-anywhere-in-my-multi-class-classificatio#:~:text=Yes%20you%20need,this%20is%20useful! )
as far as i know , what softmax does is just scaling the outputs to range between 0 and 1 and the sum to be 1. so i am not sure how it affects the whole network and loss calculation. thanks for your answers in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

苦笑流年记忆 2025-01-30 21:15:39

使用SoftMax,您将获得更容易解释的类概率。有一个很好的讨论在这里

可以直接学习概率。虽然这是可能的 - 数字可能不那么稳定,并且不会准确地添加到100%。这是SoftMax提供帮助的地方。

如果您需要的只是最可能类的索引 - 您可以在预测阶段使用Argmax而无需SoftMax。但是在训练阶段,您仍然需要SoftMax。

with softmax you get class probabilities which are easier to interpret. There is a good discussion here

One may say that a NN may learn probabilities directly. While this is possible - the numbers may not be that stable and they will not add precisely to 100%. This is where softmax helps.

If all you need is the index of the most probable class - you can use argmax without softmax at predict stage. But for the training stage you still need softmax.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文