loggers

loggers#

class fkat.pytorch.callbacks.loggers.CallbackLogger(trainer: lightning.pytorch.trainer.trainer.Trainer | None, loggers: Optional[list[fkat.pytorch.loggers.LightningLogger]] = None)[source]

A wrapper on top of the collection of Logger instances, providing methods to log metrics, artifacts, and tags across all registered loggers simultaneously.

loggers

List of loggers

Type:

list[LightningLogger]

Parameters:

trainer (L.Trainer) – PyTorch Lightning trainer instance used to initialize loggers

log_artifact(local_path: str, artifact_path: Optional[str] = None) None[source]

Log a local file as an artifact.

Parameters:
  • local_path (str) – Path to the file on the local filesystem to be logged

  • artifact_path (str, optional) – Remote path where the artifact should be stored If None, a default location should be used

log_batch(metrics: Optional[dict[str, float]] = None, params: Optional[dict[str, Any]] = None, tags: Optional[dict[str, str]] = None, timestamp: Optional[int] = None, step: Optional[int] = None) None[source]

Log multiple metrics and/or tags in a single batch operation.

Parameters:
  • metrics (dict[str, float], optional) – Dictionary mapping metric names to their float values

  • params (dict[str, Any], optional) – Dictionary mapping params names to their values

  • tags (dict[str, str], optional) – Dictionary mapping tag names to their string values

  • timestamp (int, optional) – Unix timestamp for when the batch was logged

  • step (int, optional) – Training step or iteration number

log_tag(key: str, value: str) None[source]

Log a single key-value tag.

Parameters:
  • key (str) – The identifier/name of the tag

  • value (str) – The value associated with the tag

loggers: list[fkat.pytorch.loggers.LightningLogger]
tags() dict[str, Any][source]

Get current tags

class fkat.pytorch.callbacks.loggers.MLFlowCallbackLogger(trainer: Optional[Trainer] = None, client: Optional[MlflowClient] = None, synchronous: Optional[bool] = None, run_id: Optional[str] = None)[source]

Mlflow logger class that supports distributed logging of tags, metrics and artifacts.

Parameters:

trainer (L.Trainer) – PTL trainer object

log_artifact(local_path: str, artifact_path: Optional[str] = None) None[source]
log_batch(metrics: Optional[dict[str, float]] = None, params: Optional[dict[str, Any]] = None, tags: Optional[dict[str, str]] = None, timestamp: Optional[int] = None, step: Optional[int] = None) None[source]
log_tag(key: str, value: str) None[source]
tags() dict[str, Any][source]