Logging¶
Callbacks for logging argus model training process.
- class argus.callbacks.LoggingToFile(file_path: Union[pathlib.Path, str], create_dir: bool = True, formatter: str = '[%(asctime)s][%(levelname)s]: %(message)s', append: bool = False)[source]¶
Write the argus model training progress into a file.
It adds a standard Python logger to log all losses and metrics values during training. The logger is used to output other messages, like info from callbacks and errors.
- Parameters
file_path (str) – Path to the logging file.
create_dir (bool, optional) – Create the directory for the logging file if it does not exist. Defaults to True.
formatter (str, optional) – Standard Python logging formatter to format the log messages. Defaults to ‘%(asctime)s %(levelname)s %(message)s’.
append (bool, optional) – Append the log file if it already exists or rewrite it. Defaults to False.
- class argus.callbacks.LoggingToCSV(file_path: Union[pathlib.Path, str], create_dir: bool = True, separator: str = ',', write_header: bool = True, append: bool = False)[source]¶
Write the argus model training progress into a CSV file.
It logs all losses and metrics values during training into a .csv file for for further analysis or visualization.
- Parameters
file_path (str) – Path to the .csv logging file.
create_dir (bool, optional) – Create the directory for the logging file if it does not exist. Defaults to True.
separator (str, optional) – Values separator character to use. Defaults to ‘,’.
write_header (bool, optional) – Write the column headers. Defaults to True.
append (bool, optional) – Append the log file if it already exists or rewrite it. Defaults to False.