Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ML Op AF Sigmoid #280

Open
junxnone opened this issue Nov 19, 2019 · 0 comments
Open

ML Op AF Sigmoid #280

junxnone opened this issue Nov 19, 2019 · 0 comments

Comments

@junxnone
Copy link
Owner

junxnone commented Nov 19, 2019

sigmoid

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

Sigmoid

  • 输出: [0, 1]
  • 二分类中, 将输入的 feature 映射到 [0,1]
  • $sigmoid(x)= \frac{1}{1 + e^{-x}} = \frac{e^{x}}{e^{x} + 1} = 1 - sigmoid(-x)$
Name 公式 Figure
sigmoid $sigmoid(x)= \frac{1}{1 + e^{-x}}$

二分类时 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}}}$
  • 当 二分类时 Vector = [x, 0]

$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} }$

对比

  • Sigmoid 与 Softmax 完全等价
  • Sigmoid 与 Softmax 分类器的权值可以相互转换
  • Softmax 会比 Sigmoid 浪费 2 倍的权值空间

Reference

@junxnone junxnone transferred this issue from junxnone/tio Nov 19, 2019
@junxnone junxnone changed the title 二分类问题 - sigmoid - softmax 二分类 vs 多分类 - sigmoid vs softmax Mar 20, 2020
@junxnone junxnone changed the title 二分类 vs 多分类 - sigmoid vs softmax 二分类 vs 多分类 vs 多标签分类 - sigmoid vs softmax Mar 25, 2020
@junxnone junxnone changed the title Jan 22, 2022
@junxnone junxnone transferred this issue from junxnone/ml Jan 22, 2022
@junxnone junxnone changed the title Sigmoid vs Softmax ML AF Sigmoid Dec 24, 2022
@junxnone junxnone changed the title ML AF Sigmoid ML Op AF Sigmoid Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant