python - Using a shared varibale to select from a matrix -
I am trying to select several elements from the matrix using a changing vector, The function is sent on. But when I try to run the code, I get the following error for the last line (W-selection)
ValueError: Setting an array element with a sequence < / Pre> This announcement is:
x = T.vector ('x', dtype = 'int32') y = T.vector ('y', Dtype = 'int32 ') Pure = Pure (rng = rng, x = x, n_in = dim * 5, n_out = 2, n_hidden = 100, y = y, n_tokens = len (txt), dim = dim) and then I use my input (x) as follows:
W = numpy.asarray (rng.uniform (decrease = 0, high = 1., aka R = (n_tokens, dim)), dtype = theano.config.floatX) itself. = = Theano.shared (value = w, name = 'w', borrow = true) self.output = w [x,] intention is to run in run time x The index will be a simple vector
x = [0, 1, 5, 98 ..] ..] thanks for help
Matrix W is a type of ndarray type, so it is not known how to deal with x-x like thiano. If you want to index this numpy array, then use a numpy index array instead of théono tensor. If you want to index the Thano tensioner itself, then you have to wait for the next release of Thano or have to update in the development version: It says:
Like no one, Distinguishes between the basic and advanced indexing, Theano fully supports basic indexing (see NumPyâ ??? s indexing).
Integer will be supported in advanced indexing 0.6rc4 (or development version). We do not support boolean masks because there is no boolean type in Thano (we use the int 8 for the output of the logic operator).
Comments
Post a Comment