p2pfl.management.metric_storage moduleΒΆ
Metric storage.
- class p2pfl.management.metric_storage.GlobalMetricStorage(disable_locks=False)[source]ΒΆ
Bases:
object
Global metric storage. It stores the metrics for each node in each experiment.
Format:
{ "experiment":{ "node_name": { "metric": [(round, value), ...] } }
- 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 (
Union
[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:
object
Local metric storage. It stores the metrics for each node in each round of each experiment.
Format:
{ "experiment": { "round": { "node_name": { "metric": [(step, value), ...] } } } }
- 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 (
Union
[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