#NEWLINE# def __init__( self , numpy_rng , theano_rng = None , input = None , n_visible = 784 , n_hidden = 500 , W = None , bhid = None , bvis = None ) : #NEWLINE# #INDENT# "\n        Initialize the dA class by specifying the number of visible units (the\n        dimension d of the input ), the number of hidden units ( the dimension\n        d' of the latent or hidden space ) and the corruption level. The\n        constructor also receives symbolic variables for the input, weights and\n        bias. Such a symbolic variables are useful when, for example the input\n        is the result of some computations, or when weights are shared between\n        the dA and an MLP layer. When dealing with SdAs this always happens,\n        the dA on layer 2 gets as input the output of the dA on layer 1,\n        and the weights of the dA are used in the second stage of training\n        to construct an MLP.\n\n        :type numpy_rng: numpy.random.RandomState\n        :param numpy_rng: number random generator used to generate weights\n\n        :type theano_rng: theano.tensor.shared_randomstreams.RandomStreams\n        :param theano_rng: Theano random generator; if None is given one is\n                     generated based on a seed drawn from `rng`\n\n        :type input: theano.tensor.TensorType\n        :param input: a symbolic description of the input or None for\n                      standalone dA\n\n        :type n_visible: int\n        :param n_visible: number of visible units\n\n        :type n_hidden: int\n        :param n_hidden:  number of hidden units\n\n        :type W: theano.tensor.TensorType\n        :param W: Theano variable pointing to a set of weights that should be\n                  shared belong the dA and another architecture; if dA should\n                  be standalone set this to None\n\n        :type bhid: theano.tensor.TensorType\n        :param bhid: Theano variable pointing to a set of biases values (for\n                     hidden units) that should be shared belong dA and another\n                     architecture; if dA should be standalone set this to None\n\n        :type bvis: theano.tensor.TensorType\n        :param bvis: Theano variable pointing to a set of biases values (for\n                     visible units) that should be shared belong dA and another\n                     architecture; if dA should be standalone set this to None\n\n\n        " #NEWLINE# self . n_visible = n_visible #NEWLINE# self . n_hidden = n_hidden #NEWLINE# if ( not theano_rng ) : #NEWLINE# #INDENT# theano_rng = RandomStreams ( numpy_rng . randint ( ( 2 ** 30 ) ) ) #NEWLINE# #UNINDENT# if ( not n_hidden ) : #NEWLINE# #INDENT# initial_W = numpy . asarray ( numpy_rng . uniform ( low = ( ( - 4 ) * numpy . sqrt ( ( 6.0 / ( n_hidden + n_visible ) ) ) ) , high = ( 4 * numpy . sqrt ( ( 6.0 / ( n_hidden + n_visible ) ) ) ) , size = ( n_visible , n_hidden ) ) , dtype = theano . config . floatX ) #NEWLINE# W = theano . shared ( value = initial_W , name = 'W' , borrow = True ) #NEWLINE# #UNINDENT# if ( not bvis ) : #NEWLINE# #INDENT# bvis = theano . shared ( value = numpy . zeros ( n_visible , dtype = theano . config . floatX ) , borrow = True ) #NEWLINE# #UNINDENT# if ( not bhid ) : #NEWLINE# #INDENT# bhid = theano . shared ( value = numpy . zeros ( n_hidden , dtype = theano . config . floatX ) , name = 'b' , borrow = True ) #NEWLINE# #UNINDENT# self . W = W #NEWLINE# self . b = bhid #NEWLINE# self . b_prime = bvis #NEWLINE# self . W_prime = self . W . T #NEWLINE# self . theano_rng = theano_rng #NEWLINE# if ( input is None ) : #NEWLINE# #INDENT# self . x = T . dmatrix ( name = 'input' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . x = input #NEWLINE# #UNINDENT# self . params = [ self . W , self . b , self . b_prime ]