Loss function for list of y_pred and y_true #534
Replies: 1 comment
-
Implementing it in full_objective helped :)
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I have a pretty particular problem where my loss function is not dependent on a single sample from (X, y), but instead requires a set batch of samples. This is because the loss function uses ranking/sorting among a small set of samples (batches of 25).
The Data
I have pre-processed my data heavily to function with this scenario. X is a flattened
[N, 25, 2]
array (=[N*25, 2]
) and y is a flattened[N, 25]
array that lists ranks (=[N*25]
).The loss function
This is a Python loss function that works if y_pred was an array:
I attempted to translate it to Julia:
The problem
I quickly realized that PySR sends individual scalars to the loss function and not the entire X and y arrays at once.
Question
Can I change PySR to use the entire X and y arrays? Can I access them in a custom objective somehow? Or am I able to use the built in batching feature to solve this?
Beta Was this translation helpful? Give feedback.
All reactions