Skip to content

lydhr/PytorchBoilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vanilla Pytorch + Hydra boilerplate

Yet another Pytorch boilerplate ...... but targeting at research users who would love to

    1. write customized steps
    1. conduct extensive ablation studies

Key features

  • Vanilla Pytorch with a trainer.

  • Hydra supports multi-run, a command line configuration, and verbose logging of hyper-parameters for ablation studies.

  • MISC

    • Custom dataset.
    • Currently, it is a single-GPU implementation.
    • Coding style: one lesson I learned from my mentors is to avoid global variables; instead, pass the hyper-parameters down function by function, which is less prone to unnoticeable bugs.

Sample usage

  • python main.py
  • python main.py --multirun model.arch=RNN,CNN (reference: conf/config.yaml)

This demo is built for an audio classification task:

  • The data/ folder comes with 6 short audio clips of piano or podcast. The exemplary datasets classes load the raw WAV files and segment them into short training and testing samples.
  • It runs a vanilla RNN or CNN model that binary-classifies the two audio types.

Future work

  • Support multi-GPU training using DDP.

License

Code released under WTFPL