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

Trainer.check #3244

Closed
justusschock opened this issue Aug 28, 2020 · 5 comments
Closed

Trainer.check #3244

justusschock opened this issue Aug 28, 2020 · 5 comments
Assignees
Labels
design Includes a design discussion discussion In a discussion stage feature Is an improvement or enhancement help wanted Open to be worked on
Milestone

Comments

@justusschock
Copy link
Member

🚀 Feature

Add a Trainer.check(...) interface that checks all your subclassed methods for (programatically) correctness.

Use a manually defined batch to avoid already creating the data loader here.

Discussed offline with @Borda and @ananthsub

@justusschock justusschock added feature Is an improvement or enhancement help wanted Open to be worked on labels Aug 28, 2020
@Borda Borda added design Includes a design discussion discussion In a discussion stage Important labels Aug 28, 2020
@edenlightning edenlightning added this to the 0.9.x milestone Sep 17, 2020
@edenlightning edenlightning modified the milestones: 0.9.x, 1.1 Sep 23, 2020
@Borda Borda modified the milestones: 1.1, 1.2 Nov 30, 2020
@gianscarpe
Copy link
Contributor

I find this feature extremely interesting and I'd like to contribute!

@Borda Borda assigned gianscarpe and unassigned williamFalcon Dec 30, 2020
@gianscarpe
Copy link
Contributor

gianscarpe commented Jan 4, 2021

Default check function inside LightningModule. This function uses inspect
library to check that each overriden function of the LightningModule subclass
respect the correct signature.

E.g., training_epoch_end, if defines, should have two inputs (self:
LightningModule and outputs: List) and should return None

The same check can be defined for LightiningCallbacks and
LightningDataModule. trainer.check should call each check function and raise
an specific exception (something like ProgrammaticallyError exception) if some
check fail.

Note: we can exploit object-orientation; the user can defined is own check
function for its own module

What do you @williamFalcon @Borda @edenlightning @justusschock ? Any suggestions are really appreciated! :)

@gianscarpe
Copy link
Contributor

Up @Borda @williamFalcon @justusschock :) Before working on this I think we need a deeper discussion on how to implement the check itself. I suggest using inspect library to check the correctness of arguments and overridden functions! :)

@Borda
Copy link
Member

Borda commented Feb 1, 2021

Pls be aware of #4945 and #4948

@edenlightning edenlightning modified the milestones: 1.2, 1.3 Feb 8, 2021
@carmocca
Copy link
Contributor

Closing this issue in favor of #6029

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Includes a design discussion discussion In a discussion stage feature Is an improvement or enhancement help wanted Open to be worked on
Projects
None yet
Development

No branches or pull requests

6 participants