《PyTorch深度学习实践》05.Softmax Classifier

Nannan Lv5

《PyTorch深度学习实践》.Softmax Classifier

1. 引入

我们之前讲的糖尿病的数据集的案例,是一个二分类的,我们的结果只用输出一个,因为另一个的概率就是1-输出就行了。

image-20240714180121855

那么如果有10个分类呢?

image-20240714180238532

我们把每一个类当成二分类做可以吗?

image-20240714180748841

比如我们在做5的时候,是5的话就是1,其他都是0,当作二分类问题去做。在这题看起来可以的,因为我们知道总共有哪些类别。但是我们没办法解决抑制问题(比如我等于某个结果的情况的概率很高,其实它等于别的结果的概率就不应该那么高了)。

We hope the outputs is competitive ! Actually we hope the neural network outputs a distribution.

我们就引入了我们的方法softmax!

image-20240714181356030

2. Softmax

我们希望满足每个概率>0并且所有概率和=1

image-20240714181404061

2.1 Softmax Layer

怎么实现满足每个概率>0并且所有概率和=1的呢?

image-20240714181550600

举个例子:

image-20240714181738253

image-20240714182518413

2.2 Example

image-20240714182614806

To be continue…

  • Title: 《PyTorch深度学习实践》05.Softmax Classifier
  • Author: Nannan
  • Created at : 2024-07-13 22:52:41
  • Updated at : 2024-09-29 23:20:41
  • Link: https://redefine.ohevan.com/2024/07/13/【实践】05.Softmax Classifier/
  • License: This work is licensed under CC BY-NC-SA 4.0.
Comments
On this page
《PyTorch深度学习实践》05.Softmax Classifier