tf-quaternion icon indicating copy to clipboard operation
tf-quaternion copied to clipboard

norm() should have a sqrt

Open Divye02 opened this issue 6 years ago • 2 comments

EDIT: Given the definition of normalized quaternion, shouldn't norm() return self._q / self.abs(), because I was expecting the normalized quaternion when I called norm() and I am sure other people might make that mistake, given that you have a different method "abs()" for the actual norm of a quaternion

Divye02 avatar Feb 28 '18 22:02 Divye02

I also thought about this for some time. The main problem is that I initially wanted to resemble the API of moble's quaternion implementation to ease testing of tensorflow code. Given that this implementation now can handle multi-dimensional/batched quaternions which is not available in moble's implementation, maybe it's time to consider dropping the API compatibility and move to mathematically correct function names. However, I'm not too sure what's the best way to transition. Despite the fact that the user base is extremely small, I don't want to break other people's code.What do you think of adding a deprecation warning for some time and then rename abs to norm and norm to squared_norm?

PhilJd avatar Mar 01 '18 09:03 PhilJd

That sounds good!

Divye02 avatar Mar 02 '18 00:03 Divye02