文件最后提交记录最后更新时间
1 个月前
2 个月前
1 个月前
19 天前
19 天前
2 个月前
2 个月前
5 个月前
1 个月前
README

SoftplusV2

产品支持情况

产品 是否支持
Ascend 950PR/Ascend 950DT √
Atlas A3 训练系列产品/Atlas A3 推理系列产品 √
Atlas A2 训练系列产品/Atlas A2 推理系列产品 √
Atlas 200I/500 A2 推理产品 ×
Atlas 推理系列产品 √
Atlas 训练系列产品 √

功能说明

  • 算子功能:Softplus激活函数,当β⋅x\beta \cdot x不超过阈值时输出1βlog⁡(1+exp⁡(β⋅x))\frac{1}{\beta}\log(1+\exp(\beta \cdot x)),否则直接输出xx。
  • 计算公式:

out={1βlog⁡(1+exp⁡(β⋅x)),β⋅x≤thresholdx,β⋅x>thresholdout = \begin{cases} \displaystyle \frac{1}{\beta}\log(1+\exp(\beta \cdot x)), & \beta \cdot x \le threshold \\ x, & \beta \cdot x > threshold \end{cases}

参数说明

参数名 输入/输出/属性 描述 数据类型 数据格式
x 输入 待进行Softplus计算的输入张量,公式中的x。 FLOAT、FLOAT16、BFLOAT16 ND
y 输出 Softplus计算后的输出张量,公式中的out,shape与x一致。 FLOAT、FLOAT16、BFLOAT16 ND
beta 可选属性 公式中的beta,默认值为1.0。 FLOAT -
threshold 可选属性 公式中的threshold,默认值为20.0。 FLOAT -
  • Atlas 推理系列产品、Atlas 训练系列产品:数据类型不支持BFLOAT16。

约束说明

无

调用说明

调用方式 样例代码 说明
aclnn接口 test_aclnn_softplus 通过aclnnSoftplusGetWorkspaceSize、aclnnSoftplus接口调用SoftplusV2算子,接口说明参见aclnnSoftplus。