PReLU#
- classtorch.nn.modules.activation.PReLU(num_parameters=1,init=0.25,device=None,dtype=None)[source]#
Applies the element-wise PReLU function.
or
Here is a learnable parameter. When called without arguments,nn.PReLU() uses a singleparameter across all input channels. If called withnn.PReLU(nChannels),a separate is used for each input channel.
Note
weight decay should not be used when learning for good performance.
Note
Channel dim is the 2nd dim of input. When input has dims < 2, then there isno channel dim and the number of channels = 1.
- Parameters
- Shape:
Input: where* means, any number of additionaldimensions.
Output:, same shape as the input.
- Variables
weight (Tensor) – the learnable weights of shape (
num_parameters).

Examples:
>>>m=nn.PReLU()>>>input=torch.randn(2)>>>output=m(input)