Linalg

Moved linalg function using numpy to nlinalg.py in theano.tensor.
The rank  is only returned if we ask it. Can you check if they are the same
speed? Is so, we can just remove the scipy call and move it, as we don't
use its extra parameter.


On Fri, Jul 11, 2014 at 10:40 AM, Tanjay94 <notifications@github.com> wrote:

> In theano/tensor/slinalg.py:
>
> > +        return hash((type(self), self.props()))
> > +
> > +    def __eq__(self, other):
> > +        return (type(self) == type(other) and self.props() == other.props())
> > +
> > +    def make_node(self, x):
> > +        x = as_tensor_variable(x)
> > +        assert x.ndim == 2
> > +        return Apply(self, [x], [x.type()])
> > +
> > +    def perform(self, node, (x,), (z, )):
> > +        try:
> > +            if imported_scipy:
> > +                z[0] = scipy.linalg.pinv(x).astype(x.dtype)
> > +            else:
> > +                z[0] = numpy.linalg.pinv(x).astype(x.dtype)
>
> http://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.pinv.html
> http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.pinv.html
> From what we can read in their respective doc, scipy offers more option
> and return the matrix rank along with its pseudo inverse.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Theano/Theano/pull/1908/files#r14824028>.
>