-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Make TensorVariable interface more similar to that of numpy.ndarray #1080
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
That is a good idea. We started that, but we didn't finish. |
I put the milestone 0.6.1 as this is fast to reuse existing code. But we need someone to do it. |
I'll pick some low-hanging fruits like dot = dot focusing on features which will help implementing linalg functions. It looks like some of them can be copied from numpy.linalg verbatim once ndarray methods are implemented. |
I'm not sure I understand what you wrote. I think that in your table, all what had something in the right column are easy as the implementation already exist in Theano. What need to be added is the method in _tensor_py_operators in the file tensor/basic.py. Or you mean you try the one without theano implementation? I'll add in the table the theano equivalent of take and trace |
There are three levels of difficulty here: trivial - just add an alias to an existing method; simple - adapt an existing function to work as a method or attribute (x.T, x.conj(), x.real, etc.); implementation required - methods with --- in Theano column; design question - mutating methods like .sort() - should these be implemented at all? I think it all will become clearer once I show the code, but the above is the rough order in which I intend to tackle this issue. I will probably switch back to #1057 once I have what I need. |
Ok. I'll check the code when you made a new PR. thanks |
Issue #1080: Make TensorVariable interface more similar to that of numpy.ndarray
I started implementing take op and ran into the following inconsistency in numpy: >>> x = np.zeros((2,3,4))
>>> x[:,:,1]
array([[ 0., 0., 0.],
[ 0., 0., 0.]])
>>> x.take(1,axis=2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: object of too small depth for desired array I am not sure I understand this error message and numpy.take() seems to be under-documented. Does anyone know if there are any other cases when take() is not equivalent to advanced indexing? |
On Fri, Dec 07, 2012, abalkin wrote:
Apparently, x.take needs a list of indices:
Pascal |
gh-1181 add x.nonzeros() |
I could really use the |
here's a quick implementation of cumsum for vectors: https://gist.github.com/jsalvatier/8378901. I think grad only works for the 1d case. |
Can you make a PR out of that? You can put it in theano/tensor/extra_ops.py thanks On Sat, Jan 11, 2014 at 7:36 PM, John Salvatier notifications@github.comwrote:
|
Another user asked for this today:) So it seam you are not the only one wanting this :) |
How much does it need still to be done for this? Does anybody know which calls or operations are left? |
@tsirif check out the ideas with low priority section here https://github.com/Theano/Theano/wiki/GSoC2016 |
@gokul-uf I didn't describe this well, sorry. I mean i want to do a PR in order to be eligible to participate for GSoC. Is there anything available considering this issue? |
|
Thanks i will look this up! |
@tsirif |
Uh oh!
There was an error while loading. Please reload this page.
See also gh-1216
Numpy's ndarray instances support many convenience methods most of which are already implemented as global functions in theano.tensor but not available as TensorVariable members.
Here is the summary:
The text was updated successfully, but these errors were encountered: