@@ -72,17 +72,19 @@ def __init__(self, input=None, n_visible=784, n_hidden=500, \
7272 size = (n_visible , n_hidden )),
7373 dtype = theano .config .floatX )
7474 # theano shared variables for weights and biases
75- W = theano .shared (value = initial_W , name = 'W' )
75+ W = theano .shared (value = initial_W , name = 'W' , borrow = True )
7676
7777 if hbias is None :
7878 # create shared variable for hidden units bias
7979 hbias = theano .shared (value = numpy .zeros (n_hidden ,
80- dtype = theano .config .floatX ), name = 'hbias' )
80+ dtype = theano .config .floatX ),
81+ name = 'hbias' , borrow = True )
8182
8283 if vbias is None :
8384 # create shared variable for visible units bias
8485 vbias = theano .shared (value = numpy .zeros (n_visible ,
85- dtype = theano .config .floatX ), name = 'vbias' )
86+ dtype = theano .config .floatX ),
87+ name = 'vbias' , borrow = True )
8688
8789 # initialize input layer for standalone RBM or layer0 of DBN
8890 self .input = input
@@ -352,7 +354,8 @@ def test_rbm(learning_rate=0.1, training_epochs=15,
352354 # initialize storage for the persistent chain (state = hidden
353355 # layer of chain)
354356 persistent_chain = theano .shared (numpy .zeros ((batch_size , n_hidden ),
355- dtype = theano .config .floatX ))
357+ dtype = theano .config .floatX ),
358+ borrow = True )
356359
357360 # construct the RBM class
358361 rbm = RBM (input = x , n_visible = 28 * 28 ,
0 commit comments