Linalg

Moved linalg function using numpy to nlinalg.py in theano.tensor.
What was the input size? Try a small one, a "medium" and a big one. like
2x2, 10x10, 100x100, 1000x1000.

They could have different speed ration for different size.


On Fri, Jul 11, 2014 at 2:33 PM, 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)
>
> Just ran both function in a loop of 100 000 iterations. Scipy is in fact
> slower then numpy, i will delete the scipy version and move the function
> into nlinalg.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Theano/Theano/pull/1908/files#r14836392>.
>