torch.nn.functional.prelu# torch.nn.functional.prelu(input, weight) → Tensor# 应用元素级的函数 PReLU(x)=max(0,x)+weight∗min(0,x)\text{PReLU}(x) = \max(0,x) + \text{weight} * \min(0,x)PReLU(x)=max(0,x)+weight∗min(0,x),其中 weight 是一个可学习的参数。 注意 weight 应为标量或一维张量。如果 weight 是一维的,其大小必须与输入通道数匹配,当 input.dim() >= 2 时由 input.size(1) 确定,否则为 1。在一维情况下,请注意,当 input 的维度大于 2 时,weight 可以以一种无法通过普通 广播语义 实现的方式扩展到 input 的形状。 有关更多详细信息,请参阅 PReLU。
torch.nn.functional.prelu# torch.nn.functional.prelu(input, weight) → Tensor# 应用元素级的函数 PReLU(x)=max(0,x)+weight∗min(0,x)\text{PReLU}(x) = \max(0,x) + \text{weight} * \min(0,x)PReLU(x)=max(0,x)+weight∗min(0,x),其中 weight 是一个可学习的参数。 注意 weight 应为标量或一维张量。如果 weight 是一维的,其大小必须与输入通道数匹配,当 input.dim() >= 2 时由 input.size(1) 确定,否则为 1。在一维情况下,请注意,当 input 的维度大于 2 时,weight 可以以一种无法通过普通 广播语义 实现的方式扩展到 input 的形状。 有关更多详细信息,请参阅 PReLU。