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, data_kinds: [<class 'str'>] = None, replace=True)[source]

Bases: DXOFilter

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.

  • data_kinds (str, optional) – Defaults to None.

  • replace (bool) – whether to sample with replacement. Defaults to True.

process_dxo(dxo: DXO, shareable: Shareable, fl_ctx: FLContext) None | DXO[source]

Compute the differentially private SVT.

Parameters:
  • dxo – information from client

  • shareable – that the dxo belongs to

  • fl_ctx – context provided by workflow

Returns: filtered result.