Merken Sie den Termin vor! Google I / O kehrt vom 18. bis 20. Mai zurück Registrieren Sie sich jetzt

tff.simulation.MetricsManager

An abstract base class for metrics managers.

A MetricManager is a utility to log metric data across a number of rounds of some simulation.

Methods

update_metrics

View source

Updates the metrics manager with metrics for a given round.

This method updates the MetricsManager with a given nested structure of tensors metrics_to_append, at a given round number round_num. This method should only support strictly increasing, nonnegative round numbers, but not necessarily contiguous round numbers.

For example, calling this method with round_num = 3 then round_num = 7 is acceptable, but calling the method with round_num = 6 then round_num = 6 (or anything less than 6) is not supported. he round_num must also be nonnegative, so round_num = 0 is supported, but round_num < 0 is not.

The metrics_to_append can be any nested structure of tensors. The actual metrics that are recorded are the leaves of this nested structure, with names given by the path to the leaf.

Args
round_num A nonnegative integer representing the round number associated with metrics_to_append.
metrics_to_append A nested structure of tensors.