Giter Site home page Giter Site logo

private-ai's Introduction

private-ai

Notebooks for Udacity's Secure and Private AI course.

Dependencies

To run these notebooks you'll need to install Python 3.6+, PySyft, Numpy, PyTorch 1.0, and Jupyter Notebooks. The easiest way for all of this is to create a conda environment:

conda create -n pysyft python=3
conda activate pysyft
conda install numpy jupyter notebook
conda install pytorch torchvision -c pytorch
pip install syft

private-ai's People

Contributors

iamtrask avatar mcleonard avatar mortendahl avatar wilder avatar yanndupis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

private-ai's Issues

Lesson 7. Trusted Aggregator issue: set_storage is not allowed on Tensor created from .data or .detach()

Hi!
I followed the "Project Demo Federated Learning with Trusted Aggregator" video in Lesson 7. It appears to be a problem with this part of the code
model.weight.data.set_(((alices_model.weight.data + bobs_model.weight.data) / 2).get()) cause it reise an error:
RuntimeError: set_storage is not allowed on Tensor created from .data or .detach()

At the same time ((alices_model.weight.data + bobs_model.weight.data) / 2).get() provide a normal tensor as an output.

How is it possible to solve this issue?

Characteristics of my environment:

  • Python 3.7.3

  • Torch 1.1.0.post2

  • Syft 0.1.21a1

  • Jupyter notebook

  • MacOS Mojave 10.14.5

cluster.start() not showing INFO:

I am a newbie to this and so sorry if this question sounds stupid. When I was running the notebook "Secton 4 - Encrypted Deep learning", at the lesson for Encrypted Deep Learning in Keras Step 3, when i run cluster.start(), it does not print out any INFO message. I did not change the code and I just ran it as it is. Since the INFO message was not printed out, I am unable to launch the 3 servers.
Currently, the versions of the respective packages I have is as follows:
syft 0.2.8
syft-proto 0.5.0
tensorflow 1.15.3
tf-encrypted 0.5.9
Would anyone know what is wrong and kindly help me fix the issue? Thanks.

pysyft not installing in my linux manjaro machine.

I'm not being able to install pysyft in my linux manjaro machine by the instructions givrn in the tutorial. Initially it was giving an zstd issue tried installing that and tried again did'nt work basically the line of code from PATE ANALYSIS from syft.frameworks.torch.differential_privacy import pate is throwing the error no package named syft. here are the screenshots.
https://gyazo.com/62dffbc74de72b49491576e2f708aaaf
https://gyazo.com/46afde0adf630d7283e7b7e76d8f705a
https://gyazo.com/9f8119cdb40193319e533399e34d9365

Error in notebook Section 4 - Encrypted Deep Learning

I'm running this on a Google Colab with:

Tensorflow: 1.15.0rc3
Syft: 0.1.29a1
Numpy: 1.16.5

Problem is on this specific line:

model.share(alice, bob, carol)

This is the error I'm getting:

TypeError                                 Traceback (most recent call last)
<ipython-input-14-5b486064ddb2> in <module>()
----> 1 model.share(alice, bob, carol)

TypeError: share() takes from 2 to 3 positional arguments but 4 were given

I'm having a similar issue on Section 4b. But that should be another another post.

Securing Federated Learning

Would it be possible to do a complete example of cryptographic-based secure aggregation for federated learning? You provided some intro to secrete sharing, encryption, and decryption. But would it be possible to complete that example in "completed" called Section 3 - Securing Federated Learning?
Because the last part where it says "Final Project: Federated Learning with Encrypted Gradient Aggregation" is still missing.

Thank you in advance

Requirements list

We have a conflict between the packages installed, as we obtain the error "AttributeError: module 'syft' has no attribute 'TorchHook.'" We have established the following requirement list. Could you provide us with an essential requirement list to create a virtual environment to launch the notebooks with all listed functionalities?

argon2-cffi==21.3.0
argon2-cffi-bindings==21.2.0
ascii-magic==1.6
atomicwrites==1.4.0
attrs==21.4.0
autodp==0.2
backcall==0.2.0
bcrypt==3.2.0
beautifulsoup4==4.11.1
bleach==5.0.0
cachetools==4.2.4
certifi==2021.10.8
cffi==1.15.0
charset-normalizer==2.0.12
colorama==0.4.4
debugpy==1.6.0
decorator==5.1.1
defusedxml==0.7.1
dnspython==2.2.1
email-validator==1.2.1
entrypoints==0.4
fastjsonschema==2.15.3
forbiddenfruit==0.1.4
gevent==21.8.0
greenlet==1.1.2
idna==3.3
importlib-metadata==4.8.2
importlib-resources==5.7.1
iniconfig==1.1.1
ipykernel==6.13.0
ipython==7.33.0
ipython-genutils==0.2.0
ipywidgets==7.7.0
jedi==0.18.1
Jinja2==3.1.2
jsonschema==4.4.0
jupyter==1.0.0
jupyter-client==7.3.0
jupyter-console==6.4.3
jupyter-core==4.10.0
jupyterlab-pygments==0.2.2
jupyterlab-widgets==1.1.0
loguru==0.5.3
MarkupSafe==2.1.1
matplotlib-inline==0.1.3
mistune==0.8.4
mpmath==1.2.1
names==0.3.0
nbclient==0.6.2
nbconvert==6.5.0
nbformat==5.3.0
nest-asyncio==1.5.5
notebook==6.4.11
numpy==1.21.4
packaging==21.2
pandas==1.3.4
pandocfilters==1.5.0
parso==0.8.3
pickleshare==0.7.5
Pillow==9.1.0
platformdirs==2.5.2
pluggy==1.0.0
prometheus-client==0.14.1
prompt-toolkit==3.0.29
protobuf==3.19.1
psutil==5.9.0
py==1.11.0
pyarrow==6.0.0
pycparser==2.21
pydantic==1.8.2
Pygments==2.12.0
PyJWT==2.3.0
pymbolic==2021.1
PyNaCl==1.4.0
pyparsing==2.4.7
pyrsistent==0.18.1
pysyft==0.0.1
pytest==7.1.2
python-dateutil==2.8.2
pytools==2022.1.6
pytz==2022.1
pywin32==304
pywinpty==2.0.5
pyzmq==22.3.0
qtconsole==5.3.0
QtPy==2.1.0
requests==2.26.0
requests-toolbelt==0.9.1
scipy==1.7.3
Send2Trash==1.8.0
six==1.16.0
soupsieve==2.3.2.post1
SQLAlchemy==1.4.27
syft==0.6.0
sympy==1.9
terminado==0.13.3
tinycss2==1.1.1
tomli==2.0.1
torch==1.10.0
tornado==6.1
tqdm==4.62.3
traitlets==5.1.1
typing-extensions==4.0.0
urllib3==1.26.9
wcwidth==0.2.5
webencodings==0.5.1
Werkzeug==2.0.2
widgetsnbextension==3.6.0
win32-setctime==1.1.0
zipp==3.8.0
zope.event==4.5.0
zope.interface==5.4.0

ModuleNotFoundError: No module named 'requests' while importing pate

The following line in the notebook Section 1 - Differential Privacy.ipynb :
from syft.frameworks.torch.differential_privacy import pate

Leads to the following error

`---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
in
----> 1 from syft.frameworks.torch.differential_privacy import pate

~/opt/anaconda3/envs/pysyft/lib/python3.7/site-packages/syft/init.py in
42 # Import grids
43 from syft.grid.private_grid import PrivateGridNetwork
---> 44 from syft.grid.public_grid import PublicGridNetwork
45
46 # Import sandbox

~/opt/anaconda3/envs/pysyft/lib/python3.7/site-packages/syft/grid/public_grid.py in
1 import torch
----> 2 import requests
3 import json
4
5 from typing import Union

ModuleNotFoundError: No module named 'requests'`

My environment:

Python 3.7.6

macOS Catalina 10.15.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.