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.predict.main(cfg: DictConfig) None[source]#

fkat.test#

The fkat.test entrypoint processes the provided config, instatiates the trainer, model and data sections and calls trainer.test().

fkat.test.main(cfg: DictConfig) None[source]#

fkat.train#

The fkat.train entrypoint processes the provided config, instatiates the trainer, model and data sections and calls trainer.fit().

fkat.train.main(cfg: DictConfig) None[source]#

fkat.validate#

The fkat.validate entrypoint processes the provided config, instatiates the trainer, model and data sections and calls trainer.validate().

fkat.validate.main(cfg: DictConfig) None[source]#

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:

SingletonResolver object 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.run_main(main: Callable[[], None]) None[source]#
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 False

  • multiprocessing (str) – Multiprocessing mode. Defaults to spawn

  • seed (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 False

  • determinism (bool) – Whether to enforce deterministric algorithms. Defaults to False`

  • resolvers (dict[str, oc.Resover] | None) – Custom resolvers to register for configuration processing

Returns:

SingletonResolver object that holds initialized data, trainer, model, etc.