Git Product home page Git Product logo

Comments (12)

lezcano avatar lezcano commented on August 23, 2024

As it stands, alas, that is expected. Now it'd be possible to get around that by using the class used within https://pytorch.org/docs/master/generated/torch.nn.utils.parametrizations.orthogonal.html
In this one, there's the orthogonal_map="householder" option that should be notably more efficient for very tall matrices like yours. In particular, you should use the _Orthogonal class within https://pytorch.org/docs/master/_modules/torch/nn/utils/parametrizations.html#orthogonal
in place of geotorch.SO together with the option use_trivialization=False. That may work much better for your problem, as all the other options would instantiate a matrix of size 30000 x 50 and that one wouldn't.

I'd recommend you monkey-patch your way to victory here. This would mean: take the LowRank class for example and overwrite the static method def manifolds(n, k, rank, tensorial_size, triv): with one that returns two torch.nn.utils.parametrizations._Orthgonals rather than Stiefel. I'd reckon that should do (modulo perhaps monkey-patching the _Orthogonal class with a couple extra methods.

from geotorch.

renjithravindran avatar renjithravindran commented on August 23, 2024

again thanks for your lightning fast responses!
So you suggest to make this work I use the _Orthogonal class from ..utils.parametrizations.. instead geotorch.SO with map=householder and trivialization=False.
This much is clear!

But I dont understand the next steps, how is the LowRank class associated with what I am trying to do?

As of now I have a fair intuitions about the math behind these, so I think i can monkey-patch as required.
However, do you think with right modifications I should be able to have reasonable computational costs for the size of matrices
i am interested in?

thanks a lot!

from geotorch.

renjithravindran avatar renjithravindran commented on August 23, 2024

Also with these modifications, will things more or less look like the technique described here?

from geotorch.

lezcano avatar lezcano commented on August 23, 2024

I meant LowRank as an example of a class that does some SVD-like factorisation. I figured you were using one from geotorch.

If you're using the Stiefel class within your own class, then things are much simpler. Simply replace it with the _Orthogonal class from PyTorch and you should be good.

from geotorch.

lezcano avatar lezcano commented on August 23, 2024

About that paper, in some sense, yes. That paper has a number of years, and I'm not 100% sure that their implementation at the time was correct. Now, I'm pretty certain that the implementation in _Orthogonal is correct, and it should be fairly efficient, as it uses cuBLAS behind the scenes.

from geotorch.

renjithravindran avatar renjithravindran commented on August 23, 2024

Okey, actually I am trying to to do SVD with gradient descent.
But what I am really trying to do is Tucker decomposition, SVD is only a first step.

Let me try out your suggestions.

Thanks!!

from geotorch.

lezcano avatar lezcano commented on August 23, 2024

Any news?

from geotorch.

renjithravindran avatar renjithravindran commented on August 23, 2024

Hi Lezcano
Glad you asked.
I haven't got in to trying what you suggested.
I broke the work that I was doing into two parts, one that could use more classical way (HOOI) of doing tucker and the other using gradients.
And have been busy with the first part.
But mean while I did try using an implementation of the householder matrix technique for orthogonality, but that also gave me an OOM .

Thanks

from geotorch.

lezcano avatar lezcano commented on August 23, 2024

That technique is not the same as the one implemented in parametrizations.orthogonal in core PyTorch. I very much encourage you to use the one in core PyTorch, see if it works for your use case.

from geotorch.

renjithravindran avatar renjithravindran commented on August 23, 2024

from geotorch.

lezcano avatar lezcano commented on August 23, 2024

any news on this end?

from geotorch.

lezcano avatar lezcano commented on August 23, 2024

Closing for now as this is expected. We should consider adding the householder parametrisation from core and just roll with that one.

from geotorch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.