Skip to content

Commit 12cda97

Browse files
committed
checked and trusted notebooks
1 parent e285a4f commit 12cda97

8 files changed

Lines changed: 6194 additions & 118 deletions

File tree

3-federated-learning/1-Intro-Federated-Learning.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3182,7 +3182,7 @@
31823182
"name": "python",
31833183
"nbconvert_exporter": "python",
31843184
"pygments_lexer": "ipython3",
3185-
"version": "3.10.5"
3185+
"version": "3.9.16"
31863186
}
31873187
},
31883188
"nbformat": 4,

3-federated-learning/2-Homomorphic-Encryption.ipynb

Lines changed: 25 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -3111,7 +3111,7 @@
31113111
},
31123112
{
31133113
"cell_type": "code",
3114-
"execution_count": 2,
3114+
"execution_count": null,
31153115
"id": "bdcbbd53-0049-4b0c-9642-ae21f20d7a1e",
31163116
"metadata": {},
31173117
"outputs": [],
@@ -3127,7 +3127,7 @@
31273127
},
31283128
{
31293129
"cell_type": "code",
3130-
"execution_count": 3,
3130+
"execution_count": null,
31313131
"id": "f1a0cbf9-b445-4117-b2fa-537402b081f9",
31323132
"metadata": {},
31333133
"outputs": [],
@@ -3137,7 +3137,7 @@
31373137
},
31383138
{
31393139
"cell_type": "code",
3140-
"execution_count": 4,
3140+
"execution_count": null,
31413141
"id": "25b32d56-f468-4b79-b351-4dd19bd765bb",
31423142
"metadata": {},
31433143
"outputs": [],
@@ -3148,7 +3148,7 @@
31483148
},
31493149
{
31503150
"cell_type": "code",
3151-
"execution_count": 5,
3151+
"execution_count": null,
31523152
"id": "2fcefbf6-42a7-403a-a03c-884afe922a50",
31533153
"metadata": {},
31543154
"outputs": [],
@@ -3168,7 +3168,7 @@
31683168
},
31693169
{
31703170
"cell_type": "code",
3171-
"execution_count": 6,
3171+
"execution_count": null,
31723172
"id": "2dc11391-39fc-4e84-891f-53d4296894da",
31733173
"metadata": {},
31743174
"outputs": [],
@@ -3191,7 +3191,7 @@
31913191
},
31923192
{
31933193
"cell_type": "code",
3194-
"execution_count": 7,
3194+
"execution_count": null,
31953195
"id": "46f9bfc2-678e-4cc0-80c4-833710be20b4",
31963196
"metadata": {},
31973197
"outputs": [],
@@ -3238,7 +3238,7 @@
32383238
},
32393239
{
32403240
"cell_type": "code",
3241-
"execution_count": 8,
3241+
"execution_count": null,
32423242
"id": "7efb4506-d11d-4fc0-95b3-fcf71fbbae41",
32433243
"metadata": {},
32443244
"outputs": [],
@@ -3272,7 +3272,7 @@
32723272
},
32733273
{
32743274
"cell_type": "code",
3275-
"execution_count": 9,
3275+
"execution_count": null,
32763276
"id": "f56f1247-27de-45e3-8299-a4793e037725",
32773277
"metadata": {},
32783278
"outputs": [],
@@ -3289,18 +3289,10 @@
32893289
},
32903290
{
32913291
"cell_type": "code",
3292-
"execution_count": 10,
3292+
"execution_count": null,
32933293
"id": "5f7bd444-eb7f-4d55-a55e-f7ee737a91b1",
32943294
"metadata": {},
3295-
"outputs": [
3296-
{
3297-
"name": "stdout",
3298-
"output_type": "stream",
3299-
"text": [
3300-
"Alice: Generating paillier keypair\n"
3301-
]
3302-
}
3303-
],
3295+
"outputs": [],
33043296
"source": [
33053297
"print(\"Alice: Generating paillier keypair\")\n",
33063298
"alice = Alice()\n",
@@ -3310,19 +3302,10 @@
33103302
},
33113303
{
33123304
"cell_type": "code",
3313-
"execution_count": 11,
3305+
"execution_count": null,
33143306
"id": "55f86ad0-5fcf-4874-8d58-07c1da3a28a2",
33153307
"metadata": {},
3316-
"outputs": [
3317-
{
3318-
"name": "stdout",
3319-
"output_type": "stream",
3320-
"text": [
3321-
"Alice: Training BC Classifier\n",
3322-
"[elapsed time: 0.02 s]\n"
3323-
]
3324-
}
3325-
],
3308+
"outputs": [],
33263309
"source": [
33273310
"print(\"Alice: Training BC Classifier\")\n",
33283311
"with timer() as t:\n",
@@ -3339,20 +3322,10 @@
33393322
},
33403323
{
33413324
"cell_type": "code",
3342-
"execution_count": 12,
3325+
"execution_count": null,
33433326
"id": "be931707-a0b6-4a0e-bab8-75d64c8e8239",
33443327
"metadata": {},
3345-
"outputs": [
3346-
{
3347-
"name": "stdout",
3348-
"output_type": "stream",
3349-
"text": [
3350-
"Classify with model in the clear -- what Alice would get having Bob's data locally\n",
3351-
"[elapsed time: 0.00 s]\n",
3352-
"Error 0.014\n"
3353-
]
3354-
}
3355-
],
3328+
"outputs": [],
33563329
"source": [
33573330
"print(\n",
33583331
" \"Classify with model in the clear -- \"\n",
@@ -3373,19 +3346,10 @@
33733346
},
33743347
{
33753348
"cell_type": "code",
3376-
"execution_count": 13,
3349+
"execution_count": null,
33773350
"id": "d97d605a-0746-47be-acc6-416f3ffd8295",
33783351
"metadata": {},
3379-
"outputs": [
3380-
{
3381-
"name": "stdout",
3382-
"output_type": "stream",
3383-
"text": [
3384-
"Alice: Encrypting classifier\n",
3385-
"[elapsed time: 0.43 s]\n"
3386-
]
3387-
}
3388-
],
3352+
"outputs": [],
33893353
"source": [
33903354
"print(\"Alice: Encrypting classifier\")\n",
33913355
"with timer() as t:\n",
@@ -3394,18 +3358,10 @@
33943358
},
33953359
{
33963360
"cell_type": "code",
3397-
"execution_count": 14,
3361+
"execution_count": null,
33983362
"id": "c78f1493-5423-4b9d-89cd-60e6186ba483",
33993363
"metadata": {},
3400-
"outputs": [
3401-
{
3402-
"name": "stdout",
3403-
"output_type": "stream",
3404-
"text": [
3405-
"Bob: Scoring with encrypted classifier\n"
3406-
]
3407-
}
3408-
],
3364+
"outputs": [],
34093365
"source": [
34103366
"print(\"Bob: Scoring with encrypted classifier\")\n",
34113367
"bob = Bob(alice.pubkey)\n",
@@ -3414,18 +3370,10 @@
34143370
},
34153371
{
34163372
"cell_type": "code",
3417-
"execution_count": 15,
3373+
"execution_count": null,
34183374
"id": "385c53c9-f399-4d8a-bcd9-2aefe0b22985",
34193375
"metadata": {},
3420-
"outputs": [
3421-
{
3422-
"name": "stdout",
3423-
"output_type": "stream",
3424-
"text": [
3425-
"[elapsed time: 5.77 s]\n"
3426-
]
3427-
}
3428-
],
3376+
"outputs": [],
34293377
"source": [
34303378
"with timer() as t:\n",
34313379
" encrypted_scores = bob.encrypted_evaluate(X_test)"
@@ -3441,21 +3389,12 @@
34413389
},
34423390
{
34433391
"cell_type": "code",
3444-
"execution_count": 16,
3392+
"execution_count": null,
34453393
"id": "5e44043a-08f3-4e95-9d6d-0ebc06c8c98b",
34463394
"metadata": {
34473395
"scrolled": true
34483396
},
3449-
"outputs": [
3450-
{
3451-
"name": "stdout",
3452-
"output_type": "stream",
3453-
"text": [
3454-
"Alice: Decrypting Bob's scores\n",
3455-
"[elapsed time: 0.59 s]\n"
3456-
]
3457-
}
3458-
],
3397+
"outputs": [],
34593398
"source": [
34603399
"print(\"Alice: Decrypting Bob's scores\")\n",
34613400
"with timer() as t:\n",
@@ -3464,18 +3403,10 @@
34643403
},
34653404
{
34663405
"cell_type": "code",
3467-
"execution_count": 17,
3406+
"execution_count": null,
34683407
"id": "ed338750-e553-4b87-81d3-72338dd9116f",
34693408
"metadata": {},
3470-
"outputs": [
3471-
{
3472-
"name": "stdout",
3473-
"output_type": "stream",
3474-
"text": [
3475-
"Error 0.014 -- this is not known to Alice, who does not possess the ground truth labels\n"
3476-
]
3477-
}
3478-
],
3409+
"outputs": [],
34793410
"source": [
34803411
"error = np.mean(np.sign(scores) != y_test)\n",
34813412
"print(\n",
@@ -3511,7 +3442,7 @@
35113442
"name": "python",
35123443
"nbconvert_exporter": "python",
35133444
"pygments_lexer": "ipython3",
3514-
"version": "3.10.5"
3445+
"version": "3.9.16"
35153446
}
35163447
},
35173448
"nbformat": 4,

3-federated-learning/3-OpenMined-private-AI-series.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3132,7 +3132,7 @@
31323132
"name": "python",
31333133
"nbconvert_exporter": "python",
31343134
"pygments_lexer": "ipython3",
3135-
"version": "3.10.5"
3135+
"version": "3.9.16"
31363136
}
31373137
},
31383138
"nbformat": 4,

0 commit comments

Comments
 (0)