#NEWLINE# def explnPrime( x ) : #NEWLINE# #INDENT# ' This function is the first derivative of the expln function (above).\n        It is needed for the backward pass of the module. ' #NEWLINE# def f( val ) : #NEWLINE# #INDENT# if ( val < 0 ) : #NEWLINE# #INDENT# return exp ( val ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( 1.0 / ( val + 1.0 ) ) #NEWLINE# #UNINDENT# #UNINDENT# try : #NEWLINE# #INDENT# result = array ( list ( map ( f , x ) ) ) #NEWLINE# #UNINDENT# except TypeError : #NEWLINE# #INDENT# result = array ( f ( x ) ) #NEWLINE# #UNINDENT# return result