Shared scripts for training deep learning networks in torch
Install only to your user. Go to your virtual environment. Run:
git clone https://github.com/CAAI/rh-torch.git && cd rh-torch
pip install -e .
The following directory tree allows to use GenericTIODataModule as is for loading data for training/inference. Otherwise you need to overwrite the prepare_patient_data method to accomodate for your directory structure.
Project directory
│ ├── data directory
│ │ ├── patient1
│ │ │ ├── input_file1.npy
│ │ │ ├── input_file2.npy
│ │ │ └── target_file1.npy
│ │ ├── patient2
│ │ ├── ...
│ │ ├── patientn
│ │ ├── train_test_split.json
│ │
│ ├── data_generator.py
│ └── my_config.yaml
torch_training -c ~/example_project/my_config.yaml
After training, the model is saved in ~/example_project/trained_models along with a copy of the config file.
Create your edits in a different branch, decicated to a few specific things. We prefer many minor edits over one huge. Once everything is well-documented and tested, perform a pull request for your edits to be made available in the main branch. See steps here:
git branch awesome-addition
git checkout awesome-addition
# do your changes
git commit -a -m 'your changes'
git push
gh pr create --title "your title" --body "longer description of what you did"
If you wish, you can add --assignee <github_name>
to ping specific persons for looking at your pull request.
One someone accepted your pull request (after reviewing the changes), it will be part of the main branch.
Before you accept a pull request, please update the version.py with an incremented number and a description of what has changed. This number is logged as part of the training config file that is autogenerated.