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

Implementation of your quaternion #6

Open
Guptajakala opened this issue Dec 8, 2019 · 3 comments
Open

Implementation of your quaternion #6

Guptajakala opened this issue Dec 8, 2019 · 3 comments

Comments

@Guptajakala
Copy link

sign = torch.sign(out_rotation_raw[:, 3])+0.5 #batch

Here I assume your intended half quaternion is to negate the quaternion when some value is negative (Point out if I'm wrong). I don't understand why is there an additional +0.5? That will make -1 becomes -0.5 and 1 becomes 1.5

@papagina
Copy link
Owner

papagina commented Dec 9, 2019

Hi. Yes, you are right. I added +0.5 to handle the case when the value is 0. torch.sign() returns 0 when given 0.

@Guptajakala
Copy link
Author

Hi. Yes, you are right. I added +0.5 to handle the case when the value is 0. torch.sign() returns 0 when given 0.

Thanks for reply. In the line below

out_rotation_raw2 = out_rotation_raw * sign.view(batch,1).repeat(1,4)

torch.sign() returns 0 when given 0 and +0.5 we get 0.5. Will this 0.5 multiplication cause some unwanted scaling? I see that this +0.5 is outside of the bracket.

@papagina
Copy link
Owner

Hi. Yes, you are right. I added +0.5 to handle the case when the value is 0. torch.sign() returns 0 when given 0.

Thanks for reply. In the line below

out_rotation_raw2 = out_rotation_raw * sign.view(batch,1).repeat(1,4)

torch.sign() returns 0 when given 0 and +0.5 we get 0.5. Will this 0.5 multiplication cause some unwanted scaling? I see that this +0.5 is outside of the bracket.

I didn't see any problems in my experiments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants