bargavj / EvaluatingDPML

This project's goal is to evaluate the privacy leakage of differentially private machine learning models.
MIT License
129 stars 49 forks source link

how to calculate sigma given epsilon value #23

Closed HongshengHu closed 4 years ago

HongshengHu commented 4 years ago

Hi Dr Bargavj,

I looked at your constants.py file and find that the noise multipliers of rdp and gdp are pre-calculated given the specific epsilon.

"rdp_noise_multiplier = { 30: {0.01: 290, 0.05: 70, 0.1: 36, 0.5: 7.6, 1: 3.9, 5: 1.1, 10: 0.79, 50: 0.445, 100: 0.356, 500: 0.206, 1000: 0.157}, 100: {0.01: 525, 0.05: 150, 0.1: 70, 0.5: 13.8, 1: 7, 5: 1.669, 10: 1.056, 50: 0.551, 100: 0.445, 500: 0.275, 1000: 0.219} }" "gdp_noise_multiplier = { 30: {0.01: 190, 0.05: 45, 0.1: 24, 0.5: 5.5, 1: 3, 5: 0.94, 10: 0.701, 50: 0.481, 100: 0.438}, 100: {0.01: 350, 0.05: 82, 0.1: 44, 0.5: 10, 1: 5.4, 5: 1.43, 10: 0.955, 50: 0.564, 100: 0.498} }"

Just wondering how did you get sigma given an epsilon value?

Thanks a lot.

bargavj commented 4 years ago

I have added rdp_vs_gdp.py file which you can run manually with different sigma values to find the noise multipliers for RDP and GDP.

HongshengHu commented 4 years ago

The rdp_vs_gdp.py file works fine. Thanks a lot.

Billy1900 commented 4 years ago

But How could I do it when I want to get sigma given epsilon?

HongshengHu commented 4 years ago

But How could I do it when I want to get sigma given epsilon?

I guess you can only try different sigma to approximate epsilon...I do it in this way.

Billy1900 commented 4 years ago

But How could I do it when I want to get sigma given epsilon?

I guess you can only try different sigma to approximate epsilon...I do it in this way.

Oh, yeah, I only find this way. But how can the author ger the order? manually try? I think maybe bargavj has a better way to compute it. @bargavj

bargavj commented 4 years ago

I think the only way [that I know] is to manually try sigma values to get the required epsilon. For the orders, RDP order is taken from the tf privacy package. Trying out orders between 0 (not included) and 100 works most of the times. For GDP, I try the order between 0 and 100 as well. Since 100 is the upper limit on epsilon that I try for the GDP experiments.