Logger

class lightning.fabric.loggers.Logger[source]

Bases: ABC

Base class for experiment loggers.

finalize(status)[source]

Do any processing that is necessary to finalize an experiment.

Parameters:

status (str) – Status that the experiment finished with (e.g. success, failed, aborted)

Return type:

None

log_graph(model, input_array=None)[source]

Record model graph.

Parameters:
  • model (Module) – the model with an implementation of forward.

  • input_array (Optional[Tensor]) – input passes to model.forward

Return type:

None

abstract log_hyperparams(params, *args, **kwargs)[source]

Record hyperparameters.

Parameters:
  • params (Union[dict[str, Any], Namespace]) – Namespace or Dict containing the hyperparameters

  • args (Any) – Optional positional arguments, depends on the specific logger being used

  • kwargs (Any) – Optional keyword arguments, depends on the specific logger being used

Return type:

None

abstract log_metrics(metrics, step=None)[source]

Records metrics. This method logs metrics as soon as it received them.

Parameters:
  • metrics (dict[str, float]) – Dictionary with metric names as keys and measured quantities as values

  • step (Optional[int]) – Step number at which the metrics should be recorded

Return type:

None

save()[source]

Save log data.

Return type:

None

property group_separator: str

Return the default separator used by the logger to group the data into subfolders.

property log_dir: Optional[str]

Return directory the current version of the experiment gets saved, or None if the logger does not save data locally.

abstract property name: Optional[str]

Return the experiment name.

property root_dir: Optional[str]

Return the root directory where all versions of an experiment get saved, or None if the logger does not save data locally.

abstract property version: Optional[Union[int, str]]

Return the experiment version.