Hi again,

I'm obviously new to theano.  I've been reading through the tutorial 
because I am triyng to manipulate data from a lasagne neural net.

One thing I'd like to do is cutoff values in the stored array at a min and 
max.  I'm having trouble however even getting the array to multiply by a 
value.  With the c function I am simply trying to multiply the values by a 
number but even that's not working.

Sorry for my ignorance but can anyone please tell me how I can accomplish 
what I'd like to do?

Here's the test code that fails:

import numpy as np
import theano
from theano import tensor as T
import math
test_array = np.reshape(np.array([[2, 1., 1.],
                                                      [1., -10., 1.],
                                                      [1., 1., 1.]]), 
(1,1,3,3))
test_tensor = T.tensor4('test_tensor')
test_tensor = theano.shared(test_array)
print(test_tensor)
print(test_tensor.get_value())

#works above this line then fails
a = T.tensor4()
b = T.minimum(255, T.maximum(0, 255 * a))
c = 255 * a
min_max = theano.function([a], b)
tens_mult = theano.function([a], c)
print(min_max(test_tensor))
print(tens_mult(test_tensor))
update_tensor = min_max(test_tensor)
print(update_tensor.get_value())


Thank you,
MGP

-- 

--- 
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