Entrypoints#
Configuration-driven model training without custom scripts is available via the following modules.
Each can be supplied to torchrun -m <MODULE>.
fkat.predict#
The fkat.predict entrypoint processes the provided config,
instantiates the trainer, model and data sections and calls trainer.predict().
fkat.test#
The fkat.test entrypoint processes the provided config,
instatiates the trainer, model and data sections and calls trainer.test().
fkat.train#
The fkat.train entrypoint processes the provided config,
instatiates the trainer, model and data sections and calls trainer.fit().
fkat.validate#
The fkat.validate entrypoint processes the provided config,
instatiates the trainer, model and data sections and calls trainer.validate().
Utilities#
If needed a custom entrypoint can be used. In such cases the following utilities could be used:
- fkat.initialize(cfg: DictConfig) SingletonResolver[source]#
Initialize data, model and trainer with supplied configurations.
- Parameters:
cfg (oc.DictConfig) – Configurations supplied by user through yaml file.
- Returns:
SingletonResolverobject that holds initialized data, trainer, model, etc.
- fkat.patch_args() None[source]#
In case we need to pass wildcard arguments (e.g. overrides) as expected by Hydra, but the runtime only allows named arguments we pass them using a bogus “–overrides” flag. This function will take care of removing this flag by the time we call Hydra.
- fkat.setup(cfg: Optional[DictConfig] = None, print_config: bool = False, multiprocessing: str = 'spawn', seed: Optional[int] = None, post_mortem: bool = False, determinism: bool = False, resolvers: Optional[dict[str, 'oc.Resolver']] = None) SingletonResolver[source]#
Setup the training environment.
- Parameters:
cfg (oc.OmegaConf | None) – Full configuration
print_config (bool) – Whether to print configuration to output. Defaults to
Falsemultiprocessing (str) – Multiprocessing mode. Defaults to
spawnseed (int | None) – Random number generator seed to start off when set
post_mortem (bool) – Whether to start pdb debugger when an uncaught exception encoutered. Defaults to
Falsedeterminism (bool) – Whether to enforce deterministric algorithms. Defaults to
False`resolvers (dict[str, oc.Resover] | None) – Custom resolvers to register for configuration processing
- Returns:
SingletonResolverobject that holds initialized data, trainer, model, etc.