Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nextml-code/pytorch-lantern-template
https://github.com/nextml-code/pytorch-lantern-template
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/nextml-code/pytorch-lantern-template
- Owner: nextml-code
- License: apache-2.0
- Created: 2020-11-12T15:35:21.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-10-19T13:27:00.000Z (about 2 years ago)
- Last Synced: 2023-03-05T13:34:08.807Z (almost 2 years ago)
- Language: Python
- Size: 808 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pytorch Lantern Template
Project template to be used together with [pytorch-lantern](https://github.com/nextml-code/pytorch-lantern).
## Usage
See [pytorch-lantern](https://github.com/nextml-code/pytorch-lantern) for instructions.
## Code structure
What each directory in the newly-initialized project contains:
### `data`
Problem formulation in a natural (human-readable) form. Datastreams
for training and evaluation.- Splits data in train / early_stopping / compare
- Augments data
- Create informative batches (oversample, stratify, etc)
- Works with the natural format of the examples
- Contains train/compare and train/early stopping splits as `.json` files.### `package`
Helper functions for running inference and downloading model weights if they are not packaged.
### `package/model`
Contains the model architecture as well as functions to convert the data from
human-readable to model-readable.- Preprocessing natural data into model-interpretable data
- Model
- Predictions (model output representation with helper functions)
- Loss
- Prediction visualization### `operations`
Operations are scripts that are run via the [guild CLI](https://guild.ai/)
that saves artefacts from the run such as model checkpoints.These often include:
- `guild run train`
- `guild run retrain model=xyz`
- `guild run evaluate model=xyz`## Development
Install dev dependencies like cookiecutter.
```bash
poetry install
```Setup test environment
```bash
./test/create.sh
```Download and prepare dataset
```bash
./test/prepare.sh
```Run tests in any order
```bash
./test/run.sh
./test/test.sh
```It can be useful to chain create and run when developing
```bash
./test/create.sh && ./test/run.sh
```or create and prepare:
```bash
./test/create.sh && ./test/prepare.sh
```### Common issues
You cannot activate two environments at the same time. You should not have
the outer template environment activated (i.e. poetry shell) when running
the development scripts above.