From bfd830f6b4b4c01a64a287395ea62d8e671b0891 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sun, 30 Jul 2017 11:40:25 -0500 Subject: [PATCH] machine-learning.functions: Add selu --- extra/machine-learning/functions/functions.factor | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extra/machine-learning/functions/functions.factor b/extra/machine-learning/functions/functions.factor index 426e498e85..86a8a85229 100644 --- a/extra/machine-learning/functions/functions.factor +++ b/extra/machine-learning/functions/functions.factor @@ -11,6 +11,10 @@ IN: machine-learning.functions : leaky-relu ( x a -- x' ) over 0 < [ * ] [ drop ] if ; inline +! https://arxiv.org/pdf/1706.02515.pdf +: selu ( x a -- x' ) + over 0 < [ [ [ e^ ] dip * ] keep - ] [ drop ] if ; inline + : default-leaky-relu ( x -- x' ) .01 leaky-relu ; inline @@ -24,4 +28,4 @@ IN: machine-learning.functions vexp-sum '[ e^ _ * recip log ] map ; : softmin ( seq -- softmin ) - vneg softmax ; inline \ No newline at end of file + vneg softmax ; inline