maxframe.tensor.special.softplus#
- maxframe.tensor.special.softplus(x, **kwargs)[源代码]#
逐元素计算 softplus 函数。
softplus 函数定义为:
softplus(x) = log(1 + exp(x))。它是修正线性单元(ReLU)函数的平滑近似。- 参数:
x (array_like) -- 输入值。
**kwargs -- 对于其他仅关键字参数,请参见 ufunc 文档。
- 返回:
softplus --
exp(0) + exp(x)的对数。- 返回类型:
ndarray
示例
>>> from maxframe.tensor import special
>>> special.softplus(0).to_numpy() 0.6931471805599453
>>> special.softplus([-1, 0, 1]).to_numpy() array([0.31326169, 0.69314718, 1.31326169])