Function candle_nn::activation::prelu

source ·
pub fn prelu(num_channels: Option<usize>, vs: VarBuilder<'_>) -> Result<PReLU>
Expand description

Create or initialize a new PReLU layer.

This uses some default name for weights, namely "weight".

§Arguments

  • num_channels - The number of channels. Use None to have as single trainable value and Some for a 1D vector with the appropriate number of channels. When applying the forward function, the input tensor shape s should either be one dimension with this number of channels or if s.len() >= 2 it should have s[1] equal to this number.