<s> """<STR_LIT>""" <EOL> import theano <EOL> T = theano . tensor <EOL> def identity ( x ) : <EOL> """<STR_LIT>""" <EOL> return x <EOL> def relu ( x ) : <EOL> """<STR_LIT>""" <EOL> return T . max ( <NUM_LIT:0> , x ) <EOL> def _rescale_softmax ( sm , min_val ) : <EOL> """<STR_LIT>""" <EOL> n_classes = sm . shape [ - <NUM_LIT:1> ] <EOL> n_classes = n_classes . astype ( theano . config . floatX ) <EOL> return sm * ( <NUM_LIT:1> - n_classes * min_val ) + min_val <EOL> def rescaled_softmax ( x , min_val = <NUM_LIT> ) : <EOL> """<STR_LIT>""" <EOL> return _rescale_softmax ( T . nnet . softmax ( x ) , min_val = min_val ) </s>
