-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LighterWriter - write/save predictions #40
Conversation
Right now, Maybe extend
|
I'd like it to be a writer base class and multiple sub-classes, such as |
I very much agree with @kbressem on this. I don't know if we want to think about every possible use case independently. I think that's why lightning also provided a base prediction writer. We can ship our default writer which works for common use cases, as you have implemented. For more specific use cases like you mentioned, I say let the users handle these, there can be way too much variability. For instance, I save my predictions in a |
Even if we do per-task writers, we still have a problem of mapping them to each output in multi-value Moreover, I don't think we should split
Regarding the CSV format, that will be supported here, too, and that's going to be very simple. The idea of the
But that is the essence of |
Maybe I was a bit muddy in my response and misread what @kbressem mentioned. What I meant to say was we don't need to think of handling every possible case in the To address your previous comment,
100% agree, but this also leads us to some complications I'm still of the opinion that we shouldn't try to handle all use cases in
We can ofcourse try to support as many use cases as we think of, but we also need to consider being easily extendable. |
Made some aesthetic comments for now. I will test the PR with some code tomorrow. Overall looks pretty good, seems like you thought of everything that's possible (including 24 FPS video 😉) ! We should add some test cases for such multi-use case features.
Maybe we make that a requirement from now on? It doesn't have to be something very crafty since people would already have test cases while implementing functionality, it should be easy to have it added to the PR. It will automatically increase coverage as well. |
@ibro45 Are we ready to merge this? |
Writing tests |
Alright if you agree let's merge it, so that we can merge other PRs, and I'll make another one for tests |
A callback for writing predictions.
I looked into Lightning's BasePredictionWriter. it's a very basic and not really useful Callback, so instead of inheriting from it, I thought that it's cleaner to start from a clean Callback.
Right now, it's only possible to write the predictions according to their dataloader/batch index. Will look into having an optional
get_names()
method in aDataset
s, which, if present, would replace the indices as names.