Replies: 1 comment 1 reply
-
Thanks for the question, glad to hear it's useful! For Mahalanobis I would first try out Distances.jl instead of writing one from scratch as they likely have a fairly optimised version of it: https://github.com/JuliaStats/Distances.jl, and it will plug in just fine. Optimising the metric might be the issue in all honesty. See the Primes.jl example in the PySR documentation for how to install and then interface with an external package. Let me know if this works! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
First, thank you for making such a helpful package.
I am currently trying to code a custom loss function calculates the Mahalanobis distance (https://en.wikipedia.org/wiki/Mahalanobis_distance ) as the loss. The below code is what I have so far, along with a test dataset to use:
The issue I am having is that currently it will run near infinitely (I haven't been able to get it to stop and have had to restart kernel multiple times to interrupt it). I have tried doing print statement debugging and just watch the code constantly repeat and never reaching the final return of the loss function. Some specific questions I have:
-Should I return L(Inf) or just append a very high loss for if predictions are negative?
-How come the code seems to be running many more loops than the niterations I set?
-Why is it not returning the final sum, which should be the loss?
Please let me know if I can help supply any more information that might be helpful to answer these questions.
Beta Was this translation helpful? Give feedback.
All reactions