我想知道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.
发布评论
评论(1)
使用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.