diff --git a/MLP/include/MLP.hpp b/MLP/include/MLP.hpp index a7efc5e615b49e16f57e63ce96123f38d0050012..efe83ae68fa27abd91d0769370b0c668f9ca751a 100644 --- a/MLP/include/MLP.hpp +++ b/MLP/include/MLP.hpp @@ -19,6 +19,7 @@ class MLP SIGMOID, TANH, RELU, + ELU, LINEAR, SPARSEMAX, CUBE, diff --git a/MLP/src/MLP.cpp b/MLP/src/MLP.cpp index ac2594aaff5663173adc679025162a7c5d6a544d..da90235ca35a8d7f174e28eab3fa419eaafe6f96 100644 --- a/MLP/src/MLP.cpp +++ b/MLP/src/MLP.cpp @@ -15,6 +15,9 @@ std::string MLP::activation2str(Activation a) case RELU : return "RELU"; break; + case ELU : + return "ELU"; + break; case CUBE : return "CUBE"; break; @@ -43,6 +46,8 @@ MLP::Activation MLP::str2activation(std::string s) return LINEAR; else if(s == "RELU") return RELU; + else if(s == "ELU") + return ELU; else if(s == "CUBE") return CUBE; else if(s == "SIGMOID") @@ -230,6 +235,9 @@ inline dynet::Expression MLP::activate(dynet::Expression h, Activation f) case RELU : return rectify(h); break; + case ELU : + return elu(h); + break; case SIGMOID : return logistic(h); break;