partial code as follows:( please just pay attention to the context of the 
code)


rng = T.shared_randomstreams.RandomStreams()


class gen_rand(object):
    def init(self, rng, input):
        self.input_shape = input.shape 
        print type(self.input_shape)
        self.output = rng.uniform(size=self.input_shape, low=0, high=1)
    def return_output(self):
        return self.output

I coded a neural network code with one of the weigh W initialized with 
T.shared_randomstreams.RandomStreams(), the reason I didn't use 
numpy.random is that I don't want to feed input.shape everytime, but to 
compute the shape of input in the code.

the code works but just because it's random tensor, It can't be used as a 
Weight in neural network, it changes every time.

How can I initialize a weight in NN with random module in theano( just want 
to randomly generate value once at the beginning and not to be updated by 
itself, i tried 'no_default_updates=True' then it can't be updated through 
gradient descent!!, I also tried copy modue in python to shallow copy 
rng.uniform, there was an error. I tried numpy.random, but it requires 
numerical size of the random value but not tensor)

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to