nvflare.app_common.filters.percentile_privacy module

class PercentilePrivacy(percentile=10, gamma=0.01)[source]

Bases: Filter

Implementation of “largest percentile to share” privacy preserving policy.

Shokri and Shmatikov, Privacy-preserving deep learning, CCS ‘15

Parameters
  • percentile (int, optional) – Only abs diff greater than this percentile is updated. Allowed range 0..100. Defaults to 10.

  • gamma (float, optional) – The upper limit to truncate abs values of weight diff. Defaults to 0.01. Any weight diff with abs<gamma will become 0.

process(shareable: Shareable, fl_ctx: FLContext) Shareable[source]

Compute the percentile on the abs delta_W.

Only share the params where absolute delta_W greater than the percentile value

Parameters
  • shareable – information from client

  • fl_ctx – context provided by workflow

Returns

a shareable containing the truncated weight diff

Return type

Shareable