惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Security Latest
Security Latest
T
The Exploit Database - CXSecurity.com
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Tor Project blog
Help Net Security
Help Net Security
PCI Perspectives
PCI Perspectives
T
The Blog of Author Tim Ferriss
H
Heimdal Security Blog
The Register - Security
The Register - Security
Schneier on Security
Schneier on Security
宝玉的分享
宝玉的分享
Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
C
CERT Recently Published Vulnerability Notes
L
LangChain Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
MongoDB | Blog
MongoDB | Blog
美团技术团队
S
Security @ Cisco Blogs
Cloudbric
Cloudbric
Cisco Talos Blog
Cisco Talos Blog
C
Cybersecurity and Infrastructure Security Agency CISA
月光博客
月光博客
B
Blog RSS Feed
Cyberwarzone
Cyberwarzone
U
Unit 42
AWS News Blog
AWS News Blog
F
Fortinet All Blogs
L
LINUX DO - 最新话题
GbyAI
GbyAI
T
Threat Research - Cisco Blogs
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
A
About on SuperTechFans
Hugging Face - Blog
Hugging Face - Blog
Attack and Defense Labs
Attack and Defense Labs
Engineering at Meta
Engineering at Meta
MyScale Blog
MyScale Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
V2EX - 技术
V2EX - 技术
Y
Y Combinator Blog
T
Tailwind CSS Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Recorded Future
Recorded Future
TaoSecurity Blog
TaoSecurity Blog
博客园_首页
C
CXSECURITY Database RSS Feed - CXSecurity.com
M
MIT News - Artificial intelligence
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
H
Hacker News: Front Page

RAIS

LSTM - 长短期记忆网络 - RAIS 三种梯度下降算法的区别(BGD, SGD, MBGD) - RAIS PCA - 主成分分析法 - RAIS 深度学习中的正则化(一) - RAIS | Blog 深度前馈网络 - RAIS | Blog 构建机器学习算法 - RAIS | Blog 随机梯度下降 - RAIS | Blog 无监督学习算法 - RAIS | Blog 监督学习算法 - RAIS | Blog 最大似然估计与最大后验估计 - RAIS | Blog 估计、偏差和方差 - RAIS | Blog 超参数、验证集和K-折交叉验证 - RAIS | Blog 过拟合和欠拟合 - RAIS | Blog 机器学习算法 - RAIS | Blog 深度学习中的数值计算 - RAIS | Blog 深度学习中的信息论 - RAIS | Blog 深度学习中的概率论 - RAIS | Blog 深度学习中的线性代数 - RAIS | Blog 深度学习最佳实践 - RAIS | Blog
Sigmoid 函数 - RAIS | Blog
2021-01-16 · via RAIS

前言

Sigmoid 函数(Logistic 函数)是神经网络中非常常用的激活函数,我们今天来深入了解一下 Sigmoid 函数。

函数形式

$$
S(x)=\frac{1}{1+e^{-x}}
$$

$$
y=\begin{cases}
1, 当 S(x)\geq0.5 \\
0, 当 S(x)<0.5
\end{cases}
$$

$$
S(x)’=\frac{e^{-x}}{(1+e^{-x})^2}=S(x)(1-S(x))
$$

函数图像

Sigmoid

代码实现

代码运行:Colab

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import matplotlib.pyplot as plt
import numpy as np
import math

x = np.linspace(-10, 10, 100)
z = 1 / (1 + np.exp(-x))

plt.title("Sigmoid")
plt.plot(x, z)
plt.xlabel("x")
plt.ylabel("Sigmoid(X)")

plt.savefig("sigmoid.png")
plt.show()
plt.close()

性质及问题

函数值 S(x) 的值域为 (0, 1),常用于二分类问题,函数平滑,易于求导。但是作为激活函数,其计算量大,反向传播求误差梯度时,求导有除法,容易出现梯度消失的情况,在输入接近于正无穷或负无穷时,梯度趋近于 0,发生梯度弥散(随着网络层数的增加,使用反向传播算法计算梯度时,从输出层到最初几层,梯度消失的非常明显,造成整体损失函数对最初几层的权重的导数非常小,这样在使用梯度下降算法时,最初几层权重变化非常慢,甚至无法学习到有用的特征)。因为 Sigmoid 函数值大于 0,因此权重更新只能朝着一个方向更新,可能影响收敛速度。

总结

Sigmoid 函数是神经网络中一种非常常用的激活函数,被广泛应用于逻辑回归,在统计学,机器学习领域有其广泛应用。