Mish¶ class torch.nn.Mish(inplace=False)[source][source]¶ 逐元素应用 Mish 函数。 Mish:一种自正则化非单调神经网络激活函数。 Mish(x)=x∗Tanh(Softplus(x))\text{Mish}(x) = x * \text{Tanh}(\text{Softplus}(x)) Mish(x)=x∗Tanh(Softplus(x)) 注意 参阅 Mish: A Self Regularized Non-Monotonic Neural Activation Function 形状 输入:(∗)(*)(∗),其中 ∗*∗ 表示任意维数。 输出:(∗)(*)(∗),与输入具有相同形状。 示例 >>> m = nn.Mish() >>> input = torch.randn(2) >>> output = m(input)