Skip to content

Commit

Permalink
Minor style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fchollet committed Nov 14, 2016
1 parent 3ab2920 commit 016d85c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions keras/activations.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import absolute_import
from . import backend as K
from .utils.generic_utils import get_from_module


def softmax(x):
Expand All @@ -11,13 +12,15 @@ def softmax(x):
s = K.sum(e, axis=-1, keepdims=True)
return e / s
else:
raise Exception('Cannot apply softmax to a tensor that is not 2D or 3D. ' +
'Here, ndim=' + str(ndim))
raise ValueError('Cannot apply softmax to a tensor '
'that is not 2D or 3D. '
'Here, ndim=' + str(ndim))


def elu(x, alpha=1.0):
return K.elu(x, alpha)


def softplus(x):
return K.softplus(x)

Expand All @@ -43,13 +46,9 @@ def hard_sigmoid(x):


def linear(x):
'''
The function returns the variable that is passed in, so all types work.
'''
return x


from .utils.generic_utils import get_from_module
def get(identifier):
if identifier is None:
return linear
Expand Down

0 comments on commit 016d85c

Please sign in to comment.