Skip to main content

A Library for Private, Secure Deep Learning

Project description

Introduction

codecov Binder Chat on Slack FOSSA Status

PySyft is a Python library for secure and private Deep Learning. PySyft decouples private data from model training, using Federated Learning, Differential Privacy, and Encrypted Computation (like Multi-Party Computation (MPC) and Homomorphic Encryption (HE)) within the main Deep Learning frameworks like PyTorch and TensorFlow. Join the movement on Slack.

PySyft in Detail

A more detailed explanation of PySyft can be found in the white paper on Arxiv

PySyft has also been explained in videos on YouTube:

Pre-Installation

Optionally, we recommend that you install PySyft within the Conda virtual environment, for its simplicity in installation. If you are using Windows, we suggest installing Anaconda and using the Anaconda Prompt to work from the command line.

conda create -n pysyft python=3.7
conda activate pysyft # some older version of conda require "source activate pysyft" instead.
conda install jupyter notebook==5.7.8 tornado==4.5.3

Note: Use Python 3.6-3.7. Tensorflow does not support Python 3.8 hence it might lead to installation errors.

Another alternative is to use python venvs. Those are our preferred environments for development purposes. We provide a direct install instructions in our makefile.

make venv

Installation

PySyft supports Python >= 3.6 and PyTorch 1.4

pip install 'syft[udacity]'

This will auto-install the PyTorch and TF Encrypted dependencies, which are required for running the tutorials from Udacity's "Secure & Private AI" course (recommended).

You can install syft without these dependencies with the usual pip install syft, but you will need to install framework dependencies (i.e. PyTorch, TensorFlow, or TF Encrypted) yourself. If you feel you've received an unexpected installation error related to PyTorch or TF Encrypted, please open an issue on Github or reach out to #team_pysyft in Slack.

You can also install PySyft from source on a variety of operating systems by following this installation guide.

Documentation

Latest official documentation is hosted here: https://pysyft.readthedocs.io/

Run Local Notebook Server

All the examples can be played with by running the command

make notebook

This assumes you want to use a local virtual environment. It installs it independently to the conda environment in case you installed one, or any other virtual environment you might have set up.

Once the jupyter notebook launches on your browser select the pysyft kernel.

Use the Docker image

Instead of installing all the dependencies on your computer, you can run a notebook server (which comes with Pysyft installed) using Docker. All you will have to do is start the container like this:

$ docker container run openmined/pysyft-notebook

You can use the provided link to access the jupyter notebook (the link is only accessible from your local machine).

NOTE: If you are using Docker Desktop for Mac, the port needs to be forwarded to localhost. In that case run docker with: bash $ docker container run -p 8888:8888 openmined/pysyft-notebook to forward port 8888 from the container's interface to port 8888 on localhost and then access the notebook via http://127.0.0.1:8888/?token=...

You can also set the directory from which the server will serve notebooks (default is /workspace).

$ docker container run -e WORKSPACE_DIR=/root openmined/pysyft-notebook

You could also build the image on your own and run it locally:

$ cd docker-images/pysyft-notebook/
$ docker image build -t pysyft-notebook .
$ docker container run pysyft-notebook

More information about how to use this image can be found on docker hub

Try out the Tutorials

A comprehensive list of tutorials can be found here

These tutorials cover how to perform techniques such as federated learning and differential privacy using PySyft.

High-level Architecture

alt text

Start Contributing

The guide for contributors can be found here. It covers all that you need to know to start contributing code to PySyft in an easy way.

Also join the rapidly growing community of 7000+ on Slack. The slack community is very friendly and great about quickly answering questions about the use and development of PySyft!

Troubleshooting

We have written an installation example in this colab notebook, you can use it as is to start working with PySyft on the colab cloud, or use this setup to fix your installation locally.

Organizational Contributions

We are very grateful for contributions to PySyft from the following organizations!

Udacity coMind Arkhn Dropout Labs

Support

For support in using this library, please join the #lib_pysyft Slack channel. If you’d like to follow along with any code changes to the library, please join the #code_pysyft Slack channel. Click here to join our Slack community!

Disclaimer

Do NOT use this code to protect data (private or otherwise) - at present it is very insecure. Come back in a couple of months.

License

Apache License 2.0

FOSSA Status

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

syft-0.2.8.tar.gz (327.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

syft-0.2.8-py3-none-any.whl (415.7 kB view details)

Uploaded Python 3

File details

Details for the file syft-0.2.8.tar.gz.

File metadata

  • Download URL: syft-0.2.8.tar.gz
  • Upload date:
  • Size: 327.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.3

File hashes

Hashes for syft-0.2.8.tar.gz
Algorithm Hash digest
SHA256 95f52b91c5e1f125e729522b2d270afaa4e5b5d68594b2cff59f4bc2e34846ad
MD5 31fb13a5ff09e1cfb9be77cc210d7d1f
BLAKE2b-256 32f0d2921c4b5b16736ef088b5f7e5080a5575f811b316cbf6cea871745ed31b

See more details on using hashes here.

File details

Details for the file syft-0.2.8-py3-none-any.whl.

File metadata

  • Download URL: syft-0.2.8-py3-none-any.whl
  • Upload date:
  • Size: 415.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.3

File hashes

Hashes for syft-0.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 4551543cd22a4efec11a6266efcd0f123e4c7d05ce85c1202629e2a59ffc81e2
MD5 c9461011c795577fe2de5e353e089e4b
BLAKE2b-256 69ebe7ad7f909c53477f9fbe732aaa5cf036122428268e5239b18344604bc8f8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page