Skip to main content
Version: Latest

get_path_to_best_clika_state_result

get_path_to_best_clika_state_result(

) ‑> Union[strNoneTuple[Optional[str], Optional[dict]]]

Finds the best epoch results (.pompom file) in an output directory.

Parameters:

  • output_dir (str) - path to output directory of the clika-compression training.
  • key_name (str) - the name of the loss or metric to search for in the summary files.
  • summary_json_group (str) - either 'training' or 'evaluation' - the group of the summary json file.
  • comparator_fn (Callable[[dict, dict], bool]) - a function that compares two values - the first is the previous best and the second is the current file to compare. returns an int, -1 means that the first input (the best epoch so far) was preferable than second input (current epoch). 0 means the two objects are equal. 1 means that the second input (current epoch) was preferable than the first input (the best epoch so far).
  • return_summary (bool) - if True will return the summary file as dict in addition to the path to the summary file.
  • find_lowest (bool) - if True will return the lowest value (for losses), if False will return the highest value (usually for metrics).
  • ignore_warnings (bool) - if True will ignore warnings.

Returns:

  • str: path to the best epoch .pompom file.
  • dict: the summary file as dict (only returned if return_summary is True).