Merge pull request #8801 from basedrhys/master

Added swish activation function in mapToActivation
master
Alex Black 2020-03-24 20:02:58 +11:00 committed by GitHub
commit cd0e62ffaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -334,6 +334,7 @@ public class KerasLayerConfiguration {
private final String KERAS_ACTIVATION_SIGMOID = "sigmoid";
private final String KERAS_ACTIVATION_HARD_SIGMOID = "hard_sigmoid";
private final String KERAS_ACTIVATION_LINEAR = "linear";
private final String KERAS_ACTIVATION_SWISH = "swish";
private final String KERAS_ACTIVATION_ELU = "elu"; // keras 2 only
private final String KERAS_ACTIVATION_SELU = "selu"; // keras 2 only

View File

@ -63,6 +63,8 @@ public class KerasActivationUtils {
dl4jActivation = Activation.HARDSIGMOID;
} else if (kerasActivation.equals(conf.getKERAS_ACTIVATION_LINEAR())) {
dl4jActivation = Activation.IDENTITY;
} else if (kerasActivation.equals(conf.getKERAS_ACTIVATION_SWISH())) {
dl4jActivation = Activation.SWISH;
} else {
throw new UnsupportedKerasConfigurationException(
"Unknown Keras activation function " + kerasActivation);