This repository shows a couple of examples to start using PyTorch Lightning right away. PyTorch Lightning provides several functionalities that allow to organize in a flexible, clean and understandable way each component of the training phase of a PyTorch model.
If you want to know more in detail how to structure each PyTorch Lightning component, I recommend the following blog: PyTorch Lightning: Making your Training Phase Cleaner and Easier
- main_basic.py: This file contains a "basic" implementation of PyTorch Lighting.
- main_tune.py: This file contains a "more advanced" implementation of PyTorch Lightning, essentially it covers the use of some specific functionalities such as: finding automatically the optimal learning rate as well as finding the optimal batch size.
You just need to type
python main_basic.pyor
python main_tune.pyhowever, I recommend you to work with a virtual environment, in this case I am using pipenv. So in order to install the dependencies located in the Pipfile you just need to type:
pipenv installand then
pipenv shellFeel free to fork the model and add your own suggestiongs.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/YourGreatFeature) - Commit your Changes (
git commit -m 'Add some YourGreatFeature') - Push to the Branch (
git push origin feature/YourGreatFeature) - Open a Pull Request
If you have any question, feel free to reach me out at:
Distributed under the MIT License. See LICENSE.md for more information.
