Created
September 4, 2021 19:18
-
-
Save Borda/5eb3dea49aff2cd60f8c88e1e3f01a3c to your computer and use it in GitHub Desktop.
Converting Kaggle Training Notebooks to Shareable Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from pytorch_lightning import Trainer | |
| from kaggle_plantpatho.data import PlantPathologyDM | |
| from kaggle_plantpatho.models import LitResnet, MultiPlantPathology | |
| # create DataModule with training/validation split | |
| dm = PlantPathologyDM(batch_size=98) | |
| # initialize ResNet50 network | |
| net = LitResnet(arch='resnet50', num_classes=dm.num_classes) | |
| # initialize PL module with ResNet50 | |
| model = MultiPlantPathology(model=net, lr=6e-4) | |
| # create Trainer with custome arguments | |
| trainer = Trainer(...) | |
| # train the model | |
| trainer.fit(model=model, datamodule=dm) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment