Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
old_macaon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Franck Dary
old_macaon
Commits
bac54e14
Commit
bac54e14
authored
6 years ago
by
Franck Dary
Browse files
Options
Downloads
Patches
Plain Diff
Added support for ELU activation
parent
d66aeb6b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
MLP/include/MLP.hpp
+1
-0
1 addition, 0 deletions
MLP/include/MLP.hpp
MLP/src/MLP.cpp
+8
-0
8 additions, 0 deletions
MLP/src/MLP.cpp
with
9 additions
and
0 deletions
MLP/include/MLP.hpp
+
1
−
0
View file @
bac54e14
...
@@ -19,6 +19,7 @@ class MLP
...
@@ -19,6 +19,7 @@ class MLP
SIGMOID
,
SIGMOID
,
TANH
,
TANH
,
RELU
,
RELU
,
ELU
,
LINEAR
,
LINEAR
,
SPARSEMAX
,
SPARSEMAX
,
CUBE
,
CUBE
,
...
...
This diff is collapsed.
Click to expand it.
MLP/src/MLP.cpp
+
8
−
0
View file @
bac54e14
...
@@ -15,6 +15,9 @@ std::string MLP::activation2str(Activation a)
...
@@ -15,6 +15,9 @@ std::string MLP::activation2str(Activation a)
case
RELU
:
case
RELU
:
return
"RELU"
;
return
"RELU"
;
break
;
break
;
case
ELU
:
return
"ELU"
;
break
;
case
CUBE
:
case
CUBE
:
return
"CUBE"
;
return
"CUBE"
;
break
;
break
;
...
@@ -43,6 +46,8 @@ MLP::Activation MLP::str2activation(std::string s)
...
@@ -43,6 +46,8 @@ MLP::Activation MLP::str2activation(std::string s)
return
LINEAR
;
return
LINEAR
;
else
if
(
s
==
"RELU"
)
else
if
(
s
==
"RELU"
)
return
RELU
;
return
RELU
;
else
if
(
s
==
"ELU"
)
return
ELU
;
else
if
(
s
==
"CUBE"
)
else
if
(
s
==
"CUBE"
)
return
CUBE
;
return
CUBE
;
else
if
(
s
==
"SIGMOID"
)
else
if
(
s
==
"SIGMOID"
)
...
@@ -230,6 +235,9 @@ inline dynet::Expression MLP::activate(dynet::Expression h, Activation f)
...
@@ -230,6 +235,9 @@ inline dynet::Expression MLP::activate(dynet::Expression h, Activation f)
case
RELU
:
case
RELU
:
return
rectify
(
h
);
return
rectify
(
h
);
break
;
break
;
case
ELU
:
return
elu
(
h
);
break
;
case
SIGMOID
:
case
SIGMOID
:
return
logistic
(
h
);
return
logistic
(
h
);
break
;
break
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment