当前位置: 首页 > wzjs >正文

网站建设的具体方法网络推广运营公司

网站建设的具体方法,网络推广运营公司,广州网站建设免费,江门企业模板建站文章目录B-SiLU (Bounded Sigmoid Linear Unit)函数导函数函数和导函数图像优缺点PyTorch 中的 B-SiLUTensorFlow 中的 B-SiLU备注B-SiLU (Bounded Sigmoid Linear Unit) 论文 https://arxiv.org/pdf/2505.22074 结合了 SiLU 的自门控特性与可调下限参数,B-SiLU 通过…

文章目录

    • B-SiLU (Bounded Sigmoid Linear Unit)
      • 函数+导函数
      • 函数和导函数图像
      • 优缺点
      • PyTorch 中的 B-SiLU
      • TensorFlow 中的 B-SiLU
      • 备注

B-SiLU (Bounded Sigmoid Linear Unit)

  • 论文

    https://arxiv.org/pdf/2505.22074

    结合了 SiLU 的自门控特性与可调下限参数,B-SiLU 通过 SUGAR(Surrogate Gradient for ReLU)方法用于解决 ReLU 的「死亡 ReLU 问题」,在前向传播中保持 ReLU 的稀疏性,而在反向传播中 作为 ReLU 的平滑导数替代函数。实验表明,SUGAR 结合 B-SiLU 在 CIFAR-10 和 CIFAR-100 数据集上显著提升了 VGG-16 和 ResNet-18 的测试准确率,分别提升 10-16 个百分点,优于其他替代函数(如 ELU、SELU、LeakyReLU 等。

  • 这篇中,作为ReLU的梯度替代,同时还有一个NELU被提出,但是感觉效果不太好,后续就不写了image-20250716224556609

函数+导函数

  • B-SiLU函数
    B-SiLU(x)=(x+α)⋅σ(x)−α2=x+α1+e−x−α2\begin{aligned} \mathrm{B\text{-}SiLU}(x) &= (x + \alpha) \cdot \sigma(x) - \frac{\alpha}{2} \\ &= \frac{x + \alpha}{1 + e^{-x}} - \frac{\alpha}{2} \end{aligned} B-SiLU(x)=(x+α)σ(x)2α=1+exx+α2α
    α=0 时,B-SiLU 退化为 SiLU/Swish-1。

  • B-SiLU函数导数
    ddxB-SiLU(x)=[(x+α)⋅σ(x)−α2]′=σ(x)+(x+α)ddxσ(x)=σ(x)+(x+α)⋅σ(x)(1−σ(x))\begin{aligned} \frac{d}{dx} \mathrm{B\text{-}SiLU}(x) &= \left[(x + \alpha)\cdot\sigma(x) - \frac{\alpha}{2}\right]' \\ &=\sigma(x) + (x+\alpha) \frac{d}{dx}\sigma(x)\\ &= \sigma(x) + (x + \alpha)\cdot\sigma(x)\bigl(1 - \sigma(x)\bigr) \end{aligned} dxdB-SiLU(x)=[(x+α)σ(x)2α]=σ(x)+(x+α)dxdσ(x)=σ(x)+(x+α)σ(x)(1σ(x))
    其中 σ(⋅)\sigma(\cdot)σ() 为 Sigmoid 函数,α=1.67\alpha=1.67α=1.67(论文建议值)。且
    ddxσ(x)=σ(x)(1−σ(x))\frac{d}{dx}\sigma(x) = \sigma(x)(1-\sigma(x)) dxdσ(x)=σ(x)(1σ(x))


函数和导函数图像

  • 画图

    import numpy as np
    from matplotlib import pyplot as pltdef b_silu(x, alpha=1.67):return (x + alpha) / (1 + np.exp(-x)) - alpha / 2def b_silu_derivative(x, alpha=1.67):sig = 1 / (1 + np.exp(-x))return sig + (x + alpha) * sig * (1 - sig)x = np.linspace(-6, 6, 1000)
    y  = b_silu(x)
    y1 = b_silu_derivative(x)plt.figure(figsize=(12, 8))
    ax = plt.gca()
    plt.plot(x, y,  label='B-SiLU')
    plt.plot(x, y1, label='Derivative')
    plt.title('B-SiLU (α=1.67) and Derivative')ax.spines['right'].set_color('none')
    ax.spines['top'].set_color('none')
    ax.xaxis.set_ticks_position('bottom')
    ax.spines['bottom'].set_position(('data', 0))
    ax.yaxis.set_ticks_position('left')
    ax.spines['left'].set_position(('data', 0))plt.legend(loc=2)
    plt.savefig('./b_silu.jpg')
    plt.show()
    


优缺点

  • B-SiLU 的优点

    1. 有界输出:下限 −α/2-\alpha/2α/2、上限趋于 +∞+\infty+
    2. 平滑可导:避免 ReLU 的“死亡”现象,反向传播更稳定。
    3. 非单调性:负区间小负值仍保留部分梯度,有利于信息流动。
    4. 兼容 ReLU:前向与 ReLU 近似,易于替换且无需大幅调参。
  • B-SiLU 的缺点

    1. 计算量略高:相比 ReLU 多了 sigmoid 运算。
    2. 超参数 α\alphaα:需要针对任务微调,通用性稍逊。
    3. 研究阶段:目前应用案例不如 ReLU/Swish 丰富。

PyTorch 中的 B-SiLU

  • 代码

    import torch
    import torch.nn.functional as Ftorch.manual_seed(1024)def b_silu(x, alpha=1.67):return (x + alpha) * torch.sigmoid(x) - alpha / 2x = torch.randn(3)
    y = b_silu(x)
    print("x:", x)
    print("B-SiLU(x):", y)
    

    输出示例

    x: tensor([-1.4837,  0.2671, -1.8337])
    B-SiLU(x): tensor([-0.8006,  0.2622, -0.8576])
    

TensorFlow 中的 B-SiLU

  • 代码

    import tensorflow as tf@tf.function
    def b_silu(x, alpha=1.67):return (x + alpha) * tf.nn.sigmoid(x) - alpha / 2x = tf.constant([-1.4837,  0.2671, -1.8337], dtype=tf.float32)
    y = b_silu(x)
    print("x:", x.numpy())
    print("B-SiLU(x):", y.numpy())
    

    输出示例

    x: [-1.4837  0.2671 -1.8337]
    B-SiLU(x): [-0.80055887  0.2621364  -0.85755754]
    

备注

  • 这篇论文发布于2025年5月,目前这个B-SiLU 在反向传播中 作为 ReLU 的平滑导数替代函数。所以暂时这里只关注
http://www.dtcms.com/wzjs/114683.html

相关文章:

  • 水友做的yyf网站松原市新闻
  • 传媒公司做网站编辑_如何?seo高端培训
  • 如何给别人做网站赚钱无锡整站百度快照优化
  • 专门做企业名录的网站域名申请哪家好
  • 在线crm客户关系管理信息流优化师是干什么的
  • 专业金融网站建设google浏览器官方
  • 建设开发网站百度网页版入口
  • 模板网站如何引擎收录seo网络贸易网站推广
  • 自学织梦做网站要多久郑州网络营销公司哪家好
  • 建设部监理工程师注册网站baidu com百度一下
  • 深圳 外贸 网站建设 龙百度怎么发帖做推广
  • 阜阳哪里做网站的多广州 关于进一步优化
  • 做一个展示型网站要多少钱电子商务营销策划方案
  • wordpress 站内信百度seo培训要多少钱
  • 新手如何做好网络营销推广湖南靠谱seo优化
  • flash网站开发郑州seo排名第一
  • 做网站收费标准点击量软件外包网
  • 网站建设销售工作职责百度不让访问危险网站怎么办
  • 有用的网站地址2023网站分享
  • app应用网站html5模板南京网站制作
  • 湖南网站建设哪里好免费seo排名网站
  • 网站建设比较好抚顺网络推广
  • 烽盈网站建设深圳网站seo外包公司哪家好
  • 网页游戏排行榜人气seo百度快照优化公司
  • 智能家装广州专门做seo的公司
  • 如何做百万格子网站合肥网站外包
  • 芗城网站建设全网推广软件
  • wordpress 文档管理系统海南百度推广seo
  • xxx网站建设规划书网站要怎么创建
  • 做网站 域名 服务器的关系媒体:北京不再公布疫情数据