Update advanced_activations.py

This commit is contained in:
Fariz Rahman
2017-01-26 16:15:25 +05:30
committed by GitHub
parent a3b6178947
commit 0cf91f1f8a
+1 -1
View File
@@ -71,7 +71,7 @@ class PELU(Layer):
neg = (K.pattern_broadcast(self.alphas, self.param_broadcast) *
(K.exp(x / K.pattern_broadcast(self.betas, self.param_broadcast)) - 1))
else:
pos = K.relu(x) * (self.alphas / self.betas)
pos = self.alphas / self.betas
neg = self.alphas * (K.exp(x / self.betas) - 1)
is_neg = K.cast(x < 0., K.floatx())
return is_neg * neg + (1. - is_neg) * pos