diff options
author | Laurent Mazare <laurent.mazare@gmail.com> | 2023-12-03 17:06:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-03 16:06:09 +0000 |
commit | b5c283e86f18aa653e64d8c3894d8691d318bde7 (patch) | |
tree | 4569804ba8380518570ba50ca97925b23774c314 /candle-nn/src/linear.rs | |
parent | 8418154ee0cade8b9aebc22750c7717eb273b65d (diff) | |
download | candle-b5c283e86f18aa653e64d8c3894d8691d318bde7.tar.gz candle-b5c283e86f18aa653e64d8c3894d8691d318bde7.tar.bz2 candle-b5c283e86f18aa653e64d8c3894d8691d318bde7.zip |
Add the prelu layer. (#1402)
Diffstat (limited to 'candle-nn/src/linear.rs')
-rw-r--r-- | candle-nn/src/linear.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/candle-nn/src/linear.rs b/candle-nn/src/linear.rs index 94632296..59a4db8a 100644 --- a/candle-nn/src/linear.rs +++ b/candle-nn/src/linear.rs @@ -56,7 +56,7 @@ impl super::Module for Linear { /// Create or initialize a new linear layer. /// -/// This uses some default names for weight and biases, namely `"weight"` and `"bias"`. +/// This uses some default names for weights and biases, namely `"weight"` and `"bias"`. pub fn linear(in_dim: usize, out_dim: usize, vs: crate::VarBuilder) -> Result<Linear> { let init_ws = crate::init::DEFAULT_KAIMING_NORMAL; let ws = vs.get_with_hints((out_dim, in_dim), "weight", init_ws)?; @@ -69,6 +69,7 @@ pub fn linear(in_dim: usize, out_dim: usize, vs: crate::VarBuilder) -> Result<Li Ok(Linear::new(ws, Some(bs))) } +/// Create or initialize a new linear layer without biases. pub fn linear_no_bias(in_dim: usize, out_dim: usize, vs: crate::VarBuilder) -> Result<Linear> { let init_ws = crate::init::DEFAULT_KAIMING_NORMAL; let ws = vs.get_with_hints((out_dim, in_dim), "weight", init_ws)?; |