|View source on GitHub
Creates an aggregation factory to perform zeroing.
norm_order: float = math.inf,
tff.aggregators.UnweightedAggregationFactory] = None
) -> _T
Used in the notebooks
|Used in the tutorials
tff.templates.AggregationProcess zeroes out any values whose
norm is greater than that determined by the provided
aggregating the values as specified by
inner_agg_factory. Note that for
weighted aggregation if some value is zeroed, the weight is unchanged. So for
example if you have a zeroed weighted mean and a lot of zeroing occurs, the
average will tend to be pulled toward zero. This is for consistency between
weighted and unweighted aggregation
zeroing_norm can either be a constant (for fixed norm), or an
tff.templates.EstimationProcess (for adaptive norm). If it is an
estimation process, the value returned by its
report method will be used as
the zeroing norm. Its
next method needs to accept a scalar float32 at
clients, corresponding to the norm of value being aggregated. The process can
thus adaptively determine the zeroing norm based on the set of aggregated
values. For example if a
used, the zeroing norm will be an estimate of a quantile of the norms of the
values being aggregated.
value_type provided to the
create method must be a structure of
floats, but they do not all need to be the same, e.g. a mix of
np.float16 dtypes is allowed.
The created process will report measurements
zeroed_count: The number of aggregands zeroed out.
zeroing_norm: The norm used to determine whether to zero out an aggregand.
AggregationFactory takes its weightedness
Either a float (for fixed norm) or an
adaptive norm) that specifies the norm over which the values should be
|A factory specifying the type of aggregation to be done after zeroing.
|A float for the order of the norm. Must be 1., 2., or infinity.
A factory specifying the type of aggregation done
zeroed_count measurement. If
will be used.
|An aggregation factory to perform zeroing.