FedML-AI / FedML-AI/FedML

DP Sensitivity Calculation

Open
#1,586 1 comment 0 reactions 1 assignee Claimed by @han-shanshan View on GitHub
question
Dominant language
Python
Stars
4.1k
Forks
765
PR merge metrics
No merged PRs in 30d

Description

Hi,

I don't understand how to set the sensitivity of DP to determine the noise level for the model weights. For example for a local dp process, can you recommend a way to compute sensitivity for this code block? In literature, it is said that sensitivity is computed by measuring the change in the output of the model by removing or changing an input.

class Laplace:

def __init__(self, *, epsilon, delta=0.0, sensitivity):
self.scale = float(sensitivity) / (float(epsilon) - np.log(1 - float(delta)))

def compute_noise(self, size):
return torch.tensor(np.random.laplace(loc=0.0, scale=self.scale, size=size))

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.