我是靠谱客的博主 明亮蜗牛,这篇文章主要介绍Pytorch 学习(7):Pytorch中的Non-linear Activations (非线性层)实现,现在分享给大家,希望可以做个参考。

Pytorch 学习(7):Pytorch中的Non-linear Activations (非线性层)实现

Pytorch中的Non-linear Activations (非线性层)包括以下激活函数:

  • ReLU
  • ReLU6
  • ELU
  • SELU
  • PReLU
  • LeakyReLU
  • Threshold
  • Hardtanh
  • Sigmoid
  • Tanh
  • LogSigmoid
  • Softplus
  • Softshrink
  • Softsign
  • Tanhshrink
  • Softmin
  • Softmax
  • Softmax2d
  • LogSoftmax

Pytorch各激活函数的Python前端代码在activation.py中:

 

 查看一下ReLU的python源码:


class ReLU(Threshold):
    r"""Applies the rectified linear unit function element-wise
    :math:`text{ReLU}(x)= max(0, x)`

    .. image:: scripts/activation_images/ReLU.p

最后

以上就是明亮蜗牛最近收集整理的关于Pytorch 学习(7):Pytorch中的Non-linear Activations (非线性层)实现的全部内容,更多相关Pytorch内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(183)

评论列表共有 0 条评论

立即
投稿
返回
顶部