Skip to content

Commit 71803ad

Browse files
committed
DP comment
1 parent 7d76d88 commit 71803ad

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

projects/aries-fl/notebooks/Test/Test DP training.ipynb

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
{
44
"cell_type": "code",
55
"execution_count": 1,
6-
"id": "framed-wheel",
76
"metadata": {},
87
"outputs": [],
98
"source": [
@@ -38,7 +37,6 @@
3837
{
3938
"cell_type": "code",
4039
"execution_count": 2,
41-
"id": "dense-praise",
4240
"metadata": {},
4341
"outputs": [
4442
{
@@ -58,7 +56,6 @@
5856
{
5957
"cell_type": "code",
6058
"execution_count": 3,
61-
"id": "looking-retirement",
6259
"metadata": {},
6360
"outputs": [
6461
{
@@ -201,7 +198,6 @@
201198
{
202199
"cell_type": "code",
203200
"execution_count": 4,
204-
"id": "controversial-tolerance",
205201
"metadata": {},
206202
"outputs": [],
207203
"source": [
@@ -242,7 +238,6 @@
242238
{
243239
"cell_type": "code",
244240
"execution_count": 5,
245-
"id": "framed-seven",
246241
"metadata": {},
247242
"outputs": [
248243
{
@@ -268,7 +263,6 @@
268263
{
269264
"cell_type": "code",
270265
"execution_count": 6,
271-
"id": "sensitive-queen",
272266
"metadata": {
273267
"scrolled": true
274268
},
@@ -287,7 +281,9 @@
287281
"opt = optim.SGD(params=model.parameters(), lr=0.1)\n",
288282
"\n",
289283
"# opt = torch.optim.SGD(model.parameters(), lr=0.05)\n",
290-
" \n",
284+
"\n",
285+
"# Apply Differential Privacy from Opacus library (Renyi DP)\n",
286+
"\n",
291287
"privacy_engine = PrivacyEngine(model, batch_size=333, sample_size=1000, alphas=range(2,32), \n",
292288
" noise_multiplier=1.3, max_grad_norm=1.0,)\n",
293289
"\n",
@@ -297,7 +293,6 @@
297293
{
298294
"cell_type": "code",
299295
"execution_count": 7,
300-
"id": "supposed-yukon",
301296
"metadata": {},
302297
"outputs": [],
303298
"source": [
@@ -330,7 +325,6 @@
330325
{
331326
"cell_type": "code",
332327
"execution_count": 8,
333-
"id": "genuine-pioneer",
334328
"metadata": {},
335329
"outputs": [
336330
{
@@ -357,7 +351,6 @@
357351
{
358352
"cell_type": "code",
359353
"execution_count": null,
360-
"id": "floppy-norfolk",
361354
"metadata": {},
362355
"outputs": [],
363356
"source": []
@@ -379,7 +372,7 @@
379372
"name": "python",
380373
"nbconvert_exporter": "python",
381374
"pygments_lexer": "ipython3",
382-
"version": "3.8.5"
375+
"version": "3.6.12"
383376
}
384377
},
385378
"nbformat": 4,

0 commit comments

Comments
 (0)