<s> from __future__ import absolute_import <EOL> from . import backend as K <EOL> def softmax ( x ) : <EOL> ndim = K . ndim ( x ) <EOL> if ndim == <NUM_LIT:2> : <EOL> return K . softmax ( x ) <EOL> elif ndim == <NUM_LIT:3> : <EOL> e = K . exp ( x - K . max ( x , axis = - <NUM_LIT:1> , keepdims = True ) ) <EOL> s = K . sum ( e , axis = - <NUM_LIT:1> , keepdims = True ) <EOL> return e / s <EOL> else : <EOL> raise Exception ( '<STR_LIT>' + <EOL> '<STR_LIT>' + str ( ndim ) ) <EOL> def softplus ( x ) : <EOL> return K . softplus ( x ) <EOL> def relu ( x , alpha = <NUM_LIT:0.> , max_value = None ) : <EOL> return K . relu ( x , alpha = alpha , max_value = max_value ) <EOL> def tanh ( x ) : <EOL> return K . tanh ( x ) <EOL> def sigmoid ( x ) : <EOL> return K . sigmoid ( x ) <EOL> def hard_sigmoid ( x ) : <EOL> return K . hard_sigmoid ( x ) <EOL> def linear ( x ) : <EOL> '''<STR_LIT>''' <EOL> return x <EOL> from . utils . generic_utils import get_from_module <EOL> def get ( identifier ) : <EOL> return get_from_module ( identifier , globals ( ) , '<STR_LIT>' ) </s>
