kiwi.lib.utils
configure_seed(seed: int)
configure_seed
Configure the random seed for all relevant packages.
configure_logging(output_dir: Path = None, verbose: bool = False, quiet: bool = False)
configure_logging
Configure the output logger.
save_config_to_file(config: BaseConfig, file_name: Union[str, Path])
save_config_to_file
Save a configuration object to file.
setup_output_directory(output_dir, run_uuid=None, experiment_id=None, create=True) → str
setup_output_directory
Set up the output directory.
file_to_configuration(config_file: Union[str, Path]) → Dict
file_to_configuration
Utility function to handle converting a configuration file to
arguments_to_configuration(arguments: Dict) → Dict
arguments_to_configuration
Processes command line arguments into a dictionary.
_reset_hydra()
_reset_hydra
Utility function used to handle global hydra state
sort_by_second_value(tuples: List[tuple]) → List[tuple]
sort_by_second_value
Sort a list of tuples by the second value in descending order.
kiwi.lib.utils.
These include: random, numpy, torch, torch.cuda and PYTHONHASHSEED.
seed – the random seed to be set.
Set up the log format, logging level, and output directory of logging.
output_dir – the directory where log output will be stored; defaults to None.
verbose – change logging level to debug.
quiet – change logging level to warning to suppress info logs.
file_name – where to saved the configuration.
config – a pydantic configuration object.
This means either creating one, or verifying that the provided directory exists. Output directories are created using the run and experiment ids.
output_dir – the target output directory.
run_uuid – the hash of the current run.
experiment_id – the id of the current experiment.
create – whether to create the directory.
the path to the resolved output directory.
Utility function to handle converting a configuration file to a dictionary with the correct hydra composition.
Creates an argument dict and calls arguments_to_configuration
config_file – path to a configuration file.
Dictionary of the configuration imported from config file.
Processes command line arguments into a dictionary. Handles hydra file composition and parameter overwrites.
arguments – dictionary with all the cmd_line arguments passed to kiwi.
Dictionary of the config imported from the config file.
kiwi.lib.train
kiwi.metrics