pyknos
pyknos copied to clipboard
Revamp model specification and parameterization
get_models from nflows doesn't scale, is annoying
Instead, as a minimum, we want a pluggable system (=extensible) for defining models that is based on templating.
- A designated directory, e.g.
zooorlibcontains modules that group parameterizable functions. Lookup is done viagetattr. The user gets to specify in global configuration where else to look for models. A model's identifier is the namespace + function name. Parameters can be read from similarly-named dictionaries, serialized as e.g. yaml files (example). - Models can be reused simply by copying and renaming.
For extra points:
- extend the configuration system to training hyperparameters, logging, etc. As an example, consider the respective sections here.
- study thinc's configuration system and potentially adopt it (needs to cover functionality described above). It's based on Google's gin though they it's "simpler and emphasizes a different workflow via a subset of Gin’s functionality".
What we don't want, under ANY circumstance: magic numbers sprinkled in the code, long command lines that disappear in the console's log (at best). What we want: declarative configuration with a measure of imperative flexibility (this is exactly what gin/thinc.config provide, see thinc's intro notebook).
The system should eventually be reusable in sbi.
A good practice test would be to create the models used in nsf for the uci dataset: linear_transform, base_transform and transform