Skip to content
This repository was archived by the owner on Aug 28, 2025. It is now read-only.

Conversation

@ishandutta0098
Copy link
Contributor

@ishandutta0098 ishandutta0098 commented Mar 29, 2023

What does this PR do?

I have refactored the entire mnist hello world example, maintaining a similar structure but much more readable.

Following are the major changes:

  1. Addition of a dataclass config instead of hardcoded config values
  2. Change in the implementation style of the forward() function of MNISTModel
  3. Add the ckpt_path argument to trainer.test() to suppress the warning
  4. Addition of docstrings to all classes and methods
  5. Addition of type hints for all parameters
  6. Addition of comments as and when required

Additional Information:

  • I have used patched commits to ensure that the code review becomes easier.
  • Code formatting has been done using black
  • The code has been tested via a local run

PR review

I am a member of the Lightning League and the refactoring has been discussed with @Borda

closes #240

- Added docstrings to the class and its methods - Added Examples to the docstrings - Added type hints to the class and its methods - Changed the forward method to make it more readable
- Add comments to DataLoader and Trainer - Replace hard coded values with config values
- Add docstrings to LitMNIST class and methods - Add type hints to LitMNIST class and methods
- Add comments to the code - Replace the hard coded values with config values
- This is required to suppress the warning message when running the test() function.
- Add comments to the code
@Borda Borda added enhancement New feature or request refactoring labels Mar 29, 2023
ishandutta0098 and others added 5 commits March 30, 2023 00:53
- Changed the docstring Formatting Style to Napoleon Google Style - Removed typing information from docstring as it is already present in the function signature
@codecov
Copy link

codecov bot commented Mar 29, 2023

Codecov Report

Merging #241 (bf47f8e) into main (9ce4acc) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files
@@ Coverage Diff @@ ## main #241 +/- ## =================================== Coverage 73% 73% =================================== Files 2 2 Lines 382 382 =================================== Hits 280 280 Misses 102 102 
@Borda Borda enabled auto-merge (squash) May 3, 2023 17:05
@Borda Borda requested a review from awaelchli May 3, 2023 17:05
@Borda Borda merged commit 0b676fa into Lightning-AI:main May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request refactoring

2 participants