junxnone / aiwiki

AI Wiki
https://junxnone.github.io/aiwiki
17 stars 2 forks source link

ML Op AF Softmax #335

Open junxnone opened 1 year ago

junxnone commented 1 year ago

Reference

Brief

Name 应用 输出
sigmoid - 二分类
- 多标签分类/Multi-Label
一个或多个 0∼1 范围内的概率值
softmax - 多分类 在 classes_num 个不同输出类别上的概率分布

Softmax

Examples

image image image image

二分类时 sigmoidsoftmax 等价

Name Formula
sigmoid $sigmoid(x)= \frac{1}{1 + e^{-x}}$
softmax $softmax(\vec{z}){i}=\frac{e^{z{i}}}{\sum{j=1}^{K}e^{z{i}}}$

$softmax(\vec{z}){1}=\frac{e^{z{1}}}{e^{z{1}} + e^{z{2}}}=\frac{e^{x}}{e^{x} + e^{0}}=\frac{e^{x}}{e^{x} + 1}=\frac{1}{1+e^{-x} }$

对比