Add leaky-relu in the activation enum. (#858)

This commit is contained in:
Laurent Mazare
2023-09-15 08:05:38 +02:00
committed by GitHub
parent 39157346cb
commit 0633c85514

View File

@ -10,6 +10,7 @@ pub enum Activation {
NewGelu,
Relu,
Elu(f64),
LeakyRelu(f64),
}
impl super::Module for Activation {
@ -22,6 +23,7 @@ impl super::Module for Activation {
Self::NewGelu => xs.gelu(),
Self::Relu => xs.relu(),
&Self::Elu(alpha) => xs.elu(alpha),
&Self::LeakyRelu(negative_slope) => crate::ops::leaky_relu(xs, negative_slope),
}
}
}