Added support for random weighted sampling for unbalanced datasets
This is a draft pull request for adding the weighted random sampling option as suggested here: https://github.com/paninski-lab/lightning-pose/issues/158#issuecomment-2299752505
I am not very experienced with coding and good practices (typical biologist background :D) so I put this together with the help of an LLM.
For some reason, I was unable to pass the config setting to the function. Am I missing something? This is the reason it's currently set to be enabled by default. Technically, even when its turned on, it should still work normally for data that is not unbalanced, right?
I also added a test to check if the functionality works. Even though, it makes more sense to add a test with an unbalanced dataset as input and check that the outputs are correct. Right?
Also, I am not sure yet how well this works with the suggestion to use the COCO input for heterogenous datasets: https://github.com/paninski-lab/lightning-pose/issues/263
As I said, not much experience here and would love some input on how to do this right.
I am also open for a meeting (as @themattinthehatt suggested) to discuss this and also adding the top_view_mouse model to LP.
Thanks for the PR @hummuscience! Happy to take a closer look soon. I'm a bit swamped until mid-May with end of semester/deadlines, but after that let's definitely plan to meet and discuss further (both this PR and the top_view_mouse model). This work will actually dovetail quite nicely with the COCO input for heterogeneous datasets issue.