SphericalHarmonics with legendre_polys over 30 is creating nan's
This is a horrible issue and one that I can add more value to, but attempting to use the SphericalHarmonics encoder with a legendre_polys > 30 results in an NaN. Great work by the way, this stuff is awesome!
Hi,
thanks for the issue and the feedback. Interesting. We started to have issues above L=50. Not yet at L=30. It may depend a bit on the float precision of the individual computers. I also noticed a small error in the analytic YLM calculations (missing brackets see this commit https://github.com/MarcCoru/locationencoder/commit/bd4dbe6fe0a3de37066e3762da67bda6664d992c) It only affects a constant within the m=0 harmonics. So, it didn't seem have a large detrimental impact on the experiments.
I fixed it today. Can you try again with the fixed constant? Maybe it will help also with higher orders. Another try could be to ensure that double precision is used. I can imagine that with low precision, some numerical instabilities can happen
@MarcCoru thanks for the speedy response. I'll give it a go with the new commit. Worth noting that I've cast everything to a tensor of type float 64 for sanity checking and I was still getting the error. If the issue persists, I'll write up a notebook and share 😄
hello, @MrDaubinet , did you solve the problem, I got nans with L=32