mirror of
https://github.com/wassname/keras-contrib.git
synced 2026-07-29 11:21:43 +08:00
Bug fix
This commit is contained in:
@@ -66,14 +66,14 @@ class PELU(Layer):
|
||||
|
||||
def call(self, x, mask=None):
|
||||
if K.backend() == 'theano':
|
||||
pos = K.relu(x) * (K.pattern_broadcast(self.alphas, self.param_broadcast) /
|
||||
pos = x * (K.pattern_broadcast(self.alphas, self.param_broadcast) /
|
||||
K.pattern_broadcast(self.betas, self.param_broadcast))
|
||||
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)
|
||||
neg = self.alphas * (K.exp(x / self.betas) - 1)
|
||||
return pos + neg
|
||||
return K.switch(x < 0., neg, pos)
|
||||
|
||||
def get_config(self):
|
||||
config = {'alphas_init': self.alphas_init.__name__,
|
||||
|
||||
Reference in New Issue
Block a user