neuro_morpho.logging.text

Logger for writing results to text files.

Classes

TextLogger

Logger for writing results to text files.

Module Contents

class neuro_morpho.logging.text.TextLogger(log_dir: pathlib.Path | str)[source]

Bases: neuro_morpho.logging.base.Logger

Logger for writing results to text files.

This logger saves metrics, parameters, and images to a specified directory.

log_dir
triplet_dir
log_scalar(name: str, value: float, step: int, train: bool) None[source]

Log a scalar value.

Parameters:
  • name (str) – The name of the scalar.

  • value (float) – The value of the scalar.

  • step (int) – The current step.

  • train (bool) – Whether this is a training or testing metric.

log_triplet(in_img: numpy.ndarray, lbl_img: numpy.ndarray, out_img: numpy.ndarray, name: str, step: int, train: bool) None[source]

Log an image triplet (input, label, output).

Parameters:
  • in_img (np.ndarray) – The input image.

  • lbl_img (np.ndarray) – The label image.

  • out_img (np.ndarray) – The output image.

  • name (str) – The name of the triplet.

  • step (int) – The current step.

  • train (bool) – Whether this is a training or testing metric.

log_parameters(metrics: dict[str, str | float | int]) None[source]

Log a dictionary of hyperparameters.

Parameters:

metrics (dict) – The dictionary of hyperparameters.

log_code(folder: str | pathlib.Path) None[source]

Log the code in the given folder.

Parameters:

folder (str | Path) – The folder containing the code to log.