ksuit.trackers.base_tracker

Classes

BaseTracker

Base class for all experiment trackers.

Module Contents

class ksuit.trackers.base_tracker.BaseTracker(metric_property_provider, path_provider)

Base class for all experiment trackers.

Initialize the BaseTracker.

Parameters:
  • metric_property_provider (ksuit.providers.MetricPropertyProvider) – The metric property provider gives additional information such as whether higher values are better.

  • path_provider (ksuit.providers.PathProvider) – Gives access to paths (e.g., output_path: where checkpoints/logs are stored).

logger
metric_property_provider
path_provider
summary
init(accelerator, run_name, stage_name, stage_hp, run_id, output_uri)

Initialize the tracker for a specific run.

Parameters:
  • accelerator (str) – The accelerator used for training (e.g., “cpu”, “cuda”).

  • run_name (str) – The name of the run.

  • stage_name (str | None) – The stage of the run.

  • stage_hp (dict) – The hyperparameters for the run stage.

  • run_id (str) – The ID of the run.

  • output_uri (str) – The URI where the output will be stored.

Return type:

None

log(data)

Log data to the tracker.

Parameters:

data (dict[str, Any]) – The data to log. This should be a dictionary where the values are the data to log.

Return type:

None

close()

Close the file used by the tracker and save the summary.

Return type:

None

set_summary(key, value)

Set a summary value. :param key: The key for the summary value. :param value: The value to set.

Parameters:
  • key (str)

  • value (Any)

Return type:

None

update_summary(data)

Update the summary with new data.

Parameters:

data (dict) – The data to update the summary with. This should be a dictionary where the values are the data to log.

summarize_logvalues()

Summarize the log values from the entries. This method is called after the training is finished and summarizes the log values. It computes the min/max values for each log value and stores them in the summary.

Return type:

None