|View source on GitHub|
Creates an aggregation factory to perform L2 clipping.
tff.aggregators.clipping_factory( clipping_norm: Union[float,
tff.aggregators.AggregationFactory, clipped_count_sum_factory: Optional[
tff.aggregators.UnweightedAggregationFactory] = None ) ->
Used in the notebooks
|Used in the tutorials|
tff.templates.AggregationProcess projects the values onto an
L2 ball (also referred to as "clipping") with norm determined by the provided
clipping_norm, before aggregating the values as specified by
clipping_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 clipping 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 clipping norm based on the set of aggregated
values. For example if a
used, the clip will be an estimate of a quantile of the norms of the values
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
tf.float16 dtypes is allowed.
The created process will report measurements
clipped_count: The number of aggregands clipped.
clipping_norm: The norm used to determine whether to clip an aggregand.
AggregationFactory takes its weightedness
Either a float (for fixed norm) or an
||A factory specifying the type of aggregation to be done after clipping.|
A factory specifying the type of aggregation done
|An aggregation factory to perform L2 clipping.|