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
Random methods #30
Comments
Also adresses #33 |
Raising matrix to a negative half power is required for uniform distribution on a Stiefel manifold. We need to implement appropriate methods for doing it. Maybe another issue is required for this. #41 |
I think it is reasonable to leave this as a future work and implement non uniform |
Proposals
manifold = Manifold()
x = manifold.random.normal(shape)
# or
x = manifold.random.normal(*shape)
# inplace verison
x = manifold.random.normal_(x)
# arguments go as **kwargs
x = manifold.random.normal_(x, **kwargs)
manifold = Manifold()
x = manifold.random_normal(shape)
# or
x = manifold.random_normal(*shape)
# inplace verison
x = manifold.random_normal_(x)
# arguments go as **kwargs
x = manifold.random_normal_(x, **kwargs)
manifold = Manifold()
x = manifold.normal(shape)
# or
x = manifold.normal(*shape)
# inplace version
x = manifold.normal_(x)
# arguments go as **kwargs
x = manifold.normal_(x, **kwargs)
|
So, given the time constraints... Option 1We could think of manifold-agnostic behaviour: e.g., sample tangents and exponentiate:
This way we're explicit that the result isn't Gaussian (we'd need to compute exact squared distances for that). Option 2An interface
with manifold-specific implementation
and user-classes taking
Would work for now, though from the beginning what I don't like is that we'd have to check everyhwere that |
By |
An instance of some manifold |
I don't like the idea with interfaces and actually I forgot why putting random into manifold was a bad idea after all? Separate sampler is not feasible at this moment. |
|
I liked
Maybe we can have an api as in torch.distributions |
So, we got two options and I think both of them are going to involve |
But the above idea does not solve common problems like initialization, etc |
Perhaps, we make |
Do not get it |
Please elaborate |
|
We write |
So what we are sticking to? |
TLDRI don't like java's way of "fat interfaces"; if we throw a huuuge lot of methods into manifold interface, then we make a promise to implement all of these methods for each new kind of manifold that we add in the future. That might not be that easy. For instance, I'm unsure atm if we can just make Gaussian sampler on some manifold of parameterized distributions (whose density would require evaluating squared distance (the integral) on that manifold, and sampling itself -- well, it needs RnD, so it's better to postpone that decision; it's almost always better to postpone any decision) Now, we could consider one more option.
and |
I guess it's smth like
Except that sometimes we might want to allow switching between Gaussian and Uniform (between anything) |
I still don't get how we resolve the issue of the |
Ooook, I'm beginning to realize what is the source of mutual misunderstanding. Long story short: ok, go on, make |
I wrote couple of things and I don't like it already. For me it is much more intuitive and simpler to just call |
Agree
Let's implement random methods per manifold without any abstract method. These methods are manifold specific and hence can't be generalized |
FTFY: they can be; we just won't |
So, what about |
Was thinking about As for randoms, I still expect that at some point a generic Still not sure about users of these samplers. Well, later |
It would be cool to have random sampling on the manifold. It should have
The text was updated successfully, but these errors were encountered: