mirror of
https://github.com/jafioti/luminal.git
synced 2026-06-01 21:49:47 +09:00
recip on sigmoid
This commit is contained in:
1
crates/luminal_metal/src/search/mod.rs
Normal file
1
crates/luminal_metal/src/search/mod.rs
Normal file
@@ -0,0 +1 @@
|
||||
use crate::*;
|
||||
@@ -168,7 +168,7 @@ impl GraphTensor {
|
||||
/// The sigmoid activation function
|
||||
pub fn sigmoid(self) -> GraphTensor {
|
||||
// Based on https://github.com/tinygrad/tinygrad/blob/9d142430cbe61121c864c0015f1de83c94a7d2c0/tinygrad/mlops.py#L70
|
||||
1. / (1. + (-self).exp())
|
||||
(1. + (-self).exp()).reciprocal()
|
||||
}
|
||||
|
||||
/// The swish (aka silu) activation function
|
||||
|
||||
Reference in New Issue
Block a user