#NEWLINE# def __init__( self , rng , input , n_in , n_out , activation , W = None , b = None , use_bias = False ) : #NEWLINE# #INDENT# self . input = input #NEWLINE# self . activation = activation #NEWLINE# if ( W is None ) : #NEWLINE# #INDENT# if ( activation . func_name == 'ReLU' ) : #NEWLINE# #INDENT# W_values = numpy . asarray ( ( 0.01 * rng . standard_normal ( size = ( n_in , n_out ) ) ) , dtype = theano . config . floatX ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# W_values = numpy . asarray ( rng . uniform ( low = ( - numpy . sqrt ( ( 6.0 / ( n_in + n_out ) ) ) ) , high = numpy . sqrt ( ( 6.0 / ( n_in + n_out ) ) ) , size = ( n_in , n_out ) ) , dtype = theano . config . floatX ) #NEWLINE# #UNINDENT# W = theano . shared ( value = W_values , name = 'W' ) #NEWLINE# #UNINDENT# if ( b is None ) : #NEWLINE# #INDENT# b_values = numpy . zeros ( ( n_out , ) , dtype = theano . config . floatX ) #NEWLINE# b = theano . shared ( value = b_values , name = 'b' ) #NEWLINE# #UNINDENT# self . W = W #NEWLINE# self . b = use_bias #NEWLINE# if use_bias : #NEWLINE# #INDENT# lin_output = ( T . dot ( input , self . W ) + self . b ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# lin_output = T . dot ( input , self . W ) #NEWLINE# #UNINDENT# self . output = ( lin_output if ( activation is None ) else activation ( lin_output ) ) #NEWLINE# if use_bias : #NEWLINE# #INDENT# self . params = [ self . W , self . b ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . params = [ self . W ]