p2pfl.management.metric_storage moduleΒΆ
Metric storage.
- class p2pfl.management.metric_storage.GlobalMetricStorage(disable_locks=False)[source]ΒΆ
Bases:
objectGlobal metric storage. It stores the metrics for each node in each experiment.
Format:
{ "experiment":{ "node_name": { "metric": [(round, value), ...] } }
- Parameters:
disable_locks (
bool)
- add_log(exp_name, round, metric, node, val)[source]ΒΆ
Add a log entry.
- Parameters:
exp_name (
str) β Experiment name.round (
int) β Round number.metric (
str) β Metric name.node (
str) β Node name.val (
int|float) β Value of the metric.
- Return type:
None
- get_all_logs()[source]ΒΆ
Obtain all logs.
- Return type:
dict[str,dict[str,dict[str,list[tuple[int,float]]]]]- Returns:
All logs
- class p2pfl.management.metric_storage.LocalMetricStorage(disable_locks=False)[source]ΒΆ
Bases:
objectLocal metric storage. It stores the metrics for each node in each round of each experiment.
Format:
{ "experiment": { "round": { "node_name": { "metric": [(step, value), ...] } } } }
- Parameters:
disable_locks (
bool)
- add_log(exp_name, round, metric, node, val, step)[source]ΒΆ
Add a log entry.
- Parameters:
exp_name (
str) β Experiment name.round (
int) β Round number.metric (
str) β Metric name.node (
str) β Node name.val (
int|float) β Value of the metric.step (
int) β Step number.
- Return type:
None
- get_all_logs()[source]ΒΆ
Obtain all logs.
- Return type:
dict[str,dict[int,dict[str,dict[str,list[tuple[int,float]]]]]]- Returns:
All logs
- get_experiment_logs(exp)[source]ΒΆ
Obtain logs for an experiment.
- Parameters:
exp (
str) β Experiment number- Return type:
dict[int,dict[str,dict[str,list[tuple[int,float]]]]]- Returns:
Experiment logs