<s> import theano . tensor as tt <EOL> from Mariana . abstraction import Abstraction_ABC <EOL> __all__ = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] <EOL> class Activation_ABC ( Abstraction_ABC ) : <EOL> """<STR_LIT>""" <EOL> def apply ( self , layer , x , purpose ) : <EOL> """<STR_LIT>""" <EOL> hyps = { } <EOL> for k in self . hyperParameters : <EOL> hyps [ k ] = getattr ( self , k ) <EOL> message = "<STR_LIT>" % ( layer . name , self . __class__ . __name__ , purpose ) <EOL> layer . network . logLayerEvent ( layer , message , hyps ) <EOL> return self . function ( x ) <EOL> def function ( self , x ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplemented ( "<STR_LIT>" ) <EOL> class Pass ( Activation_ABC ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> Activation_ABC . __init__ ( self ) <EOL> def function ( self , x ) : <EOL> return x <EOL> class Sigmoid ( Activation_ABC ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> Activation_ABC . __init__ ( self ) <EOL> def function ( self , x ) : <EOL> return tt . nnet . sigmoid ( x ) <EOL> class Tanh ( Activation_ABC ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> Activation_ABC . __init__ ( self ) <EOL> def function ( self , x ) : <EOL> return tt . tanh ( x ) <EOL> class ReLU ( Activation_ABC ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> Activation_ABC . __init__ ( self ) <EOL> def function ( self , x ) : <EOL> return tt . maximum ( <NUM_LIT:0.> , x ) <EOL> class Softmax ( Activation_ABC ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , temperature = <NUM_LIT:1> ) : <EOL> Activation_ABC . __init__ ( self ) <EOL> self . hyperParameters = [ "<STR_LIT>" ] <EOL> self . temperature = temperature <EOL> def function ( self , x ) : <EOL> return tt . nnet . softmax ( x / self . temperature ) </s>
