Skip to content
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

Add "id" support. Refactor Writers. Add Writer additional format extensibility. #78

Merged
merged 22 commits into from
Sep 15, 2023

Conversation

ibro45
Copy link
Collaborator

@ibro45 ibro45 commented Aug 13, 2023

Description

  • The dataset can now return "id" key in a dict for the purpose of identifying each batch sample. Useful for prediction writing to name the written files properly.
  • Refactored Writers. No need for interval argument. The batch samples are added as a table record (TableWriter) or written to a file (FileWriter) at each batch end.
  • New formats of writing predictions can now be easily added, either by passing them using the additional_writers argument, or by calling .add_writer() method after the instantiation.
  • Remove the gather_tensors and use decollate_batch instead to support writing batch size > 1
  • Remove multi opt and sched support
  • Remove the remaining sys.exit()'s
  • Added support for dict of metrics in System, in addition to single or list of metrics. A dict allows multiple metrics of the same class, e.g., Dice, by assigning them different keys (names). That way, you can use two or more same class metrics. E.g., a Dice with micro averaging and a Dice with macro averaging.
  • Some LighterSystem refactoring

Related Issue

#47
#23 (partially, all sys.exits() replaced)

Type of Change

  • 📚 Examples / docs / tutorials / dependencies update
  • 🔧 Bug fix (non-breaking change which fixes an issue)
  • 🥂 Improvement (non-breaking change which improves an existing feature)
  • 🚀 New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 🔐 Security fix

Checklist

  • I've read the CODE_OF_CONDUCT.md document.
  • I've read the CONTRIBUTING.md guide.
  • I've updated the code style using make codestyle.
  • I've written tests for all new methods and classes that I created.
  • I've written the docstring in Google format for all the methods and classes that I used.

@ibro45 ibro45 marked this pull request as ready for review August 15, 2023 00:47
@ibro45 ibro45 requested a review from surajpaib August 15, 2023 00:47
@ibro45
Copy link
Collaborator Author

ibro45 commented Aug 15, 2023

Need to fix some DDP issues first

@ibro45
Copy link
Collaborator Author

ibro45 commented Aug 15, 2023

Done, ready for merge

@ibro45
Copy link
Collaborator Author

ibro45 commented Aug 16, 2023

Sorry, this PR escalated 😅📈 happy to sit down/have a call if you want to go through it together

Copy link
Collaborator

@surajpaib surajpaib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff with the writer! Love the flexibility.

lighter/callbacks/logger.py Outdated Show resolved Hide resolved
lighter/callbacks/writer/base.py Outdated Show resolved Hide resolved
lighter/callbacks/writer/base.py Outdated Show resolved Hide resolved
lighter/callbacks/writer/base.py Outdated Show resolved Hide resolved
lighter/callbacks/writer/base.py Outdated Show resolved Hide resolved
@ibro45
Copy link
Collaborator Author

ibro45 commented Sep 14, 2023

Do you think the Writers should support predict mode only, or should they also support test mode?

@project-lighter project-lighter deleted a comment from surajpaib Sep 14, 2023
@surajpaib
Copy link
Collaborator

I think predict should suffice. I would disassociate testing from the prediction.

@surajpaib surajpaib merged commit a22442f into main Sep 15, 2023
7 checks passed
@surajpaib surajpaib deleted the fixes branch September 15, 2023 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants