summaryrefslogtreecommitdiff
path: root/candle-nn/src
diff options
context:
space:
mode:
authorLaurent Mazare <laurent.mazare@gmail.com>2023-09-15 08:05:38 +0200
committerGitHub <noreply@github.com>2023-09-15 07:05:38 +0100
commit0633c85514891141f5d8ded4e1a935ca430c97fe (patch)
tree0209a3bf2cf17360449b781dea87d4d7c1b55ca3 /candle-nn/src
parent39157346cb96d7610ddb6cdc686aed32d12bba3d (diff)
downloadcandle-0633c85514891141f5d8ded4e1a935ca430c97fe.tar.gz
candle-0633c85514891141f5d8ded4e1a935ca430c97fe.tar.bz2
candle-0633c85514891141f5d8ded4e1a935ca430c97fe.zip
Add leaky-relu in the activation enum. (#858)
Diffstat (limited to 'candle-nn/src')
-rw-r--r--candle-nn/src/activation.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/candle-nn/src/activation.rs b/candle-nn/src/activation.rs
index 22e062b0..17467b31 100644
--- a/candle-nn/src/activation.rs
+++ b/candle-nn/src/activation.rs
@@ -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),
}
}
}