Skip to content

[DRAFT] Add draft docstrings and default parameters to metric learning

Daniel Thomas Murnane requested to merge DM_stage_defaults into dev

This is a proposal on how to handle three big problems in the library at the moment (as mentioned in this comment and this issue):

  1. It's not clear where to find a good set of default hyperparameters for each stage - currently the examples are the go-to, but that seems a bit ad-hoc
  2. There is no docstring for the stages, and therefore no clear documentation
  3. Each stage is unconstrained in the hyperparameters it can take. This makes maintenance difficult. This doesn't quite solve this, as for compatibility I add in defaults, and kwargs to capture any extra hyperparameters.

This MR is not complete, since changing stages in this way will then require instantiating classes with

stage = Stage(**config)

rather than

stage = Stage(config)

which will need a few changes in the main scripts train, infer and eval. Consider this a proposal to be discussed and iterated on.

Merge request reports