SamuelMarks / ml-glaucoma

ML programs for glaucoma diagnoses.
https://sydneyscientific.org
4 stars 1 forks source link

PyTorch first & second pass conditioning #13

Closed SamuelMarks closed 5 years ago

SamuelMarks commented 5 years ago

I want to support PyTorch, and potentially others in future.

Ways of adding support:

  1. First pass; make implementations conditional. Disadvantage: file length gets long. Advantage: all implementations of each algorithm are in the one file.
  2. Replicate directory structure, and have a root. So callbacks.py becomes callbacks/__init__.py which just contains imports based off conditions (like this 'first pass' commit), and callbacks/tf_keras & callbacks/torch are created. Disadvantage: explosion of files.
  3. Abstract classes, separated into 3 repositories, one repo for tensorflow, one for PyTorch, and one central one that imports them all
  4. Create wrappers for every framework feature, so the same function call can happen regardless of ML framework/library (let's not do this!)

What do you think?