Skip to content

Commit ab3a189

Browse files
update
1 parent 7cef95a commit ab3a189

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

src/unary.jl

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ unary_ops = [
4545
# "normcdfinv",
4646
# "rcbrt",
4747
("relu", "relu", "(xi>0?xi:0)"),
48+
("elu", "elu", "(xi>0?xi:exp(xi)-1)")
4849
# "rint",
4950
"round",
5051
# "rsqrt",
@@ -153,21 +154,6 @@ broadcast(::typeof(+), a::KnetArray)=a
153154
+(a::KnetArray)=a
154155
-(a::KnetArray)=broadcast(-,a)
155156

156-
"""
157-
elu(x, alpha=1)
158-
159-
Exponential Linear Unit. Returns
160-
`max(0,x) + alpha*(exp(min(x,0)) - 1)
161-
162-
Paper Ref. :
163-
"Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs) (ICLR 2016)"
164-
"""
165-
function elu(x, alpha=1)
166-
p = relu(x)
167-
m = -relu(-x)
168-
return p + alpha*(exp(m) - 1)
169-
end
170-
171157
"""
172158
selu(x)
173159

0 commit comments

Comments
 (0)