Skip to content
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

Bug: inner_product mismatch in SpecialEuclidean #1806

Open
monsij opened this issue Jan 29, 2023 · 0 comments
Open

Bug: inner_product mismatch in SpecialEuclidean #1806

monsij opened this issue Jan 29, 2023 · 0 comments
Assignees
Labels

Comments

@monsij
Copy link
Collaborator

monsij commented Jan 29, 2023

Describe the bug

Inner products of two vectors belonging to the tangent space of SE(2) return different values when computation is performed using point_type="vector" and point_type="matrix".

The values are significantly different, ie floating point operations may not be causing it.

Steps/Code to Reproduce

Running the script below returns False:

import numpy as np
from geomstats.geometry.special_euclidean import SpecialEuclidean

GROUP_MAT = SpecialEuclidean(n=2, point_type="matrix") 
GROUP_VECT = SpecialEuclidean(n=2, point_type="vector")

# vector form
point_vec = GROUP_VECT.random_point()
v1_vect = np.random.rand(3) # any random length 3 vector belongs to SE(2)
v2_vect = np.random.rand(3)
ip_vect = GROUP_VECT.metric.inner_product(tangent_vec_a=v1_vect, tangent_vec_b=v2_vect, base_point=point_vec)



# matrix form
point_mat = GROUP_VECT.matrix_from_vector(point_vec)
# v1_mat, v2_mat should be in the tangent space
v1_mat = GROUP_VECT.matrix_from_vector(v1_vect) 
v2_mat = GROUP_VECT.matrix_from_vector(v2_vect)
ip_mat = GROUP_MAT.metric.inner_product(tangent_vec_a=v1_mat, tangent_vec_b=v2_mat, base_point=point_mat)

print(np.allclose(ip_vect, ip_mat))

Expected Behaviour

Inner products should be about the same:
np.allclose(ip_vect, ip_mat)=True

Actual Behaviour

For example

Vector form:
<v1, v2> = 0.5463887341252732

Matrix form:
<v1, v2> = 3.2790017553516457

Your environment

Geomstats: v2.5.0
Model Name:	MacBook Pro
Processor Name:	ARM64
@monsij monsij added the bug label Jan 29, 2023
@luisfpereira luisfpereira self-assigned this Jun 28, 2023
@luisfpereira luisfpereira changed the title Bug: inner_product mismatch Bug: inner_product mismatch in SpecialEuclidean Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants