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 pytorch Lightning example #545

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

st7ma784
Copy link

@st7ma784 st7ma784 commented Jan 6, 2025

Summary

Add Pytorch Lightning Implementation for Classification model. The ambition of this change is to allow rapid developement and evaluation of classifiers using HPC provision, and refactor the framework for scalable deployment.

Describe your changes

The main change is removing the generic pytorch wrappers for iterating over dataloaders, and revising how "phases" is referred to in the code, instead leaning on PTL's implementation of separate train, validation, inference steps. Some other minor refactoring has occurred to remove repeated 'if' statements during each step to aid with pipelining.

Checklist before assigning a reviewer (update as needed)

  • Self-review code
  • Test with map data
  • Update reference docs
  • Update changelog
  • Add test code to HEC
  • Add logging information
  • Compare to previous implementation

Reviewer checklist

Please check this conforms to downstream needs in example notebooks.

  • Everything looks ok?

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

Attention: Patch coverage is 0% with 288 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
mapreader/classify/pytorchLightningClassifier.py 0.00% 288 Missing ⚠️
Flag Coverage Δ
unittests 76.42% <0.00%> (-2.55%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
mapreader/classify/pytorchLightningClassifier.py 0.00% <0.00%> (ø)

@rwood-97
Copy link
Collaborator

rwood-97 commented Jan 7, 2025

Hi, thanks so much for this.

I'm going to spend some time the rest of this week seeing if I can wrap this code into a class similar to the ClassifierContainer so we can essentially swap over to pytorch lightning whilst still following same/similar API.

Do you know if there is any reason we wouldn't want to swap over completely? (i.e. what are downsides of using lightning vs just normal pytorch?)

@st7ma784
Copy link
Author

st7ma784 commented Jan 7, 2025 via email

Comment redundant lines
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