-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add high-dimensional manifolds #10
Comments
Yes, I would love to help with this. Uniformly sampling manifolds is
tricky, but naively I would start by just doing furthest points sampling to
make sure things are even
…On Thu, Nov 12, 2020 at 10:44 AM Filip Cornell ***@***.***> wrote:
Hello!
I think high-dimensional manifolds, that is, manifolds beyond 2 and 3
dimensions would be very interesting to add. d-dimensional spheres have
already been added, but if somebody knows how generate other types of
manifolds of higher dimensions, I would be happy to cooperate and
contribute to create this for this package :)
Cheers,
Filip
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#10>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJWDZRI7GVGYMASEY5VJ2LSPP7GXANCNFSM4TTOIQOA>
.
|
How great to hear! I think #11 is a start, but what other high-dimensional manifolds can we construct? |
Yeah actually, a flat torus is very straightforward that way. Simply use
meshgrid and have pairs of dimensions be a different circle, as you said
…On Thu, Nov 12, 2020 at 3:39 PM Filip Cornell ***@***.***> wrote:
Have a look here <http://planning.cs.uiuc.edu/node137.html>. He claims an
n-dimensional Torus can simply be built by taking the cartesian of S^1,
seen here <http://planning.cs.uiuc.edu/node136.html>. Can we use this
perhaps?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJWDZS6WHG6L5ICKFRRCWDSPRBY5ANCNFSM4TTOIQOA>
.
|
Hmm, I am not sure I understand how you mean. Do you perhaps have some sample code? |
For 10,000 samples on a flat 2-torus, for example, one could do this
N = 100
t = np.linspace(0, 2*np.pi, N)
theta, phi = np.meshgrid(t, t)
theta = theta.flatten()
phi = phi.flatten()
X = np.zeros((N*N, 4))
X[:, 0] = np.cos(theta)
X[:, 1] = np.sin(theta)
X[:, 2] = np.cos(phi)
X[:, 3] = np.sin(phi)
…On Fri, Nov 13, 2020 at 3:17 AM Filip Cornell ***@***.***> wrote:
Hmm, I am not sure I understand how you mean. Do you perhaps have some
sample code?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJWDZS3A5EO4OZHEL5QWPDSPTTQDANCNFSM4TTOIQOA>
.
|
Very sorry for such a late reply. That is very interesting, I suppose we can extend that to an arbitrary number of dimensions? |
Would something like this do as a first draft? def sample_4d_torus(n_points, seed):
assert np.sqrt(n_points) % 1 == 0, "Please pick a number of points with integer root. "
np.random.seed(seed)
N = int(np.sqrt())
t = np.random.uniform(0,2*np.pi, N)
t = np.linspace(0, 2*np.pi, N)
theta, phi = np.meshgrid(t, t)
theta = theta.flatten()
phi = phi.flatten()
X = np.zeros((N*N, 4))
X[:, 0] = np.cos(theta)
X[:, 1] = np.sin(theta)
X[:, 2] = np.cos(phi)
X[:, 3] = np.sin(phi)
return X |
Yeah, for a flat torus in 4D, that should be uniform. Did you mean to say
N = int(np.sqrt(n_points)) ?
…On Fri, Feb 12, 2021 at 3:50 AM Filip Cornell ***@***.***> wrote:
Would something like this do as a first draft?
def sample_4d_torus(n_points, seed):
assert np.sqrt(n_points) % 1 == 0, "Please pick a number of points with integer root. "
np.random.seed(seed)
N = int(np.sqrt())
t = np.random.uniform(0,2*np.pi, N)
t = np.linspace(0, 2*np.pi, N)
theta, phi = np.meshgrid(t, t)
theta = theta.flatten()
phi = phi.flatten()
X = np.zeros((N*N, 4))
X[:, 0] = np.cos(theta)
X[:, 1] = np.sin(theta)
X[:, 2] = np.cos(phi)
X[:, 3] = np.sin(phi)
return X
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJWDZWS7TECUCE7PSM6RDDS6TTVNANCNFSM4TTOIQOA>
.
|
Oh yes, it should be |
Yup, you can do this sort of thing in every even dimension at 4 and beyond
…On Fri, Feb 12, 2021 at 10:52 AM Filip Cornell ***@***.***> wrote:
Oh yes, it should be int(np.sqrt(n_points)). Can we extend this to more
than 4 dimensions?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJWDZTS3GMDA5HQRJVGFBTS6VFDHANCNFSM4TTOIQOA>
.
|
Hello!
First of all, thank you for a very nice python package! I think high-dimensional manifolds, that is, manifolds beyond 2 and 3 dimensions would be very interesting to add. d-dimensional spheres have already been added, but if somebody knows how generate other types of manifolds of higher dimensions, I would be happy to cooperate and contribute to create this for this package :)
Cheers,
Filip
The text was updated successfully, but these errors were encountered: