nvflare.app_common.filters.svt_privacy module

class SVTPrivacy(fraction=0.1, epsilon=0.1, noise_var=0.1, gamma=1e-05, tau=1e-06)[source]

Bases: Filter

Implementation of the standard Sparse Vector Technique (SVT) differential privacy algorithm.

lambda_rho = gamma * 2.0 / epsilon threshold = tau + np.random.laplace(scale=lambda_rho)

Parameters
  • fraction (float, optional) – used to determine dataset threshold. Defaults to 0.1.

  • epsilon (float, optional) – Defaults to 0.1.

  • noise_var (float, optional) – additive noise. Defaults to 0.1.

  • gamma (float, optional) – Defaults to 1e-5.

  • tau (float, optional) – Defaults to 1e-6.

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

Compute the differentially private SVT.

Parameters
  • shareable – information from client

  • fl_ctx – context provided by workflow

Returns

updated shareable

Return type

Shareable