![]() |
Builds tff.templates.MeasuredProcess
for averaging with adaptive zeroing.
tff.utils.build_adaptive_zeroing_mean_process(
value_type: ValueType,
initial_quantile_estimate: float,
target_quantile: float,
multiplier: float,
increment: float,
learning_rate: float,
norm_order: float
)
The returned MeasuredProcess
averages values after zeroing out any values
whose norm is greater than C * r + i
where C is adapted to approximate the
q'th quantile of the distribution of value norms. Its next
function has the
following type signature:
(<{state_type}@SERVER,{value_type}@CLIENTS,{float32}@CLIENTS> ->
Args | |
---|---|
value_type
|
The type of values to be averaged by the MeasuredProcess . Can
be a tff.TensorType or a nested structure of tff.StructType that
bottoms out in tff.TensorType .
|
initial_quantile_estimate
|
The initial value of C .
|
target_quantile
|
The target quantile q . The adaptive process ensures that
C will approximate the q 'th quantile of the distribution of value
norms.
|
multiplier
|
The multiplier r of the quantile estimate C .
|
increment
|
The increment i in the computation of the zeroing threshold.
|
learning_rate
|
The learning rate l for the adaptive process. If the
observed fraction of values whose norm is less than C on a given round
is p , then C will be updated according to C *= exp(l * (q - p)) . It
follows that the maximum possible update is multiplying or dividing by a
factor of exp(l) .
|
norm_order
|
The order of the norm. May be 1, 2, or np.inf. |
Returns | |
---|---|
A MeasuredProcess implementing averaging values with adaptive zeroing with
the type signature described above.
|