Open
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))