privacy

Library for training machine learning models with privacy for training data

Github星跟蹤圖

TensorFlow Privacy

This repository contains the source code for TensorFlow Privacy, a Python
library that includes implementations of TensorFlow optimizers for training
machine learning models with differential privacy. The library comes with
tutorials and analysis tools for computing the privacy guarantees provided.

The TensorFlow Privacy library is under continual development, always welcoming
contributions. In particular, we always welcome help towards resolving the
issues currently open.

Setting up TensorFlow Privacy

Dependencies

This library uses TensorFlow to define machine
learning models. Therefore, installing TensorFlow (>= 1.14) is a pre-requisite.
You can find instructions here. For
better performance, it is also recommended to install TensorFlow with GPU
support (detailed instructions on how to do this are available in the TensorFlow
installation documentation).

In addition to TensorFlow and its dependencies, other prerequisites are:

  • scipy >= 0.17

  • mpmath (for testing)

  • tensorflow_datasets (for the RNN tutorial lm_dpsgd_tutorial.py only)

Installing TensorFlow Privacy

First, clone this GitHub repository into a directory of your choice:

git clone https://github.com/tensorflow/privacy

You can then install the local package in "editable" mode in order to add it to
your PYTHONPATH:

cd privacy
pip install -e .

If you'd like to make contributions, we recommend first forking the repository
and then cloning your fork rather than cloning this repository directly.

Contributing

Contributions are welcomed! Bug fixes and new features can be initiated through
GitHub pull requests. To speed the code review process, we ask that:

  • When making code contributions to TensorFlow Privacy, you follow the PEP8 with two spaces coding style (the same as the one used by TensorFlow) in
    your pull requests. In most cases this can be done by running autopep8 -i --indent-size 2 <file> on the files you have edited.

  • You should also check your code with pylint and TensorFlow's pylint
    configuration file
    by running pylint --rcfile=/path/to/the/tf/rcfile <edited file.py>.

  • When making your first pull request, you
    sign the Google CLA

  • We do not accept pull requests that add git submodules because of
    the problems that arise when maintaining git submodules

Tutorials directory

To help you get started with the functionalities provided by this library, we
provide a detailed walkthrough here that
will teach you how to wrap existing optimizers
(e.g., SGD, Adam, ...) into their differentially private counterparts using
TensorFlow (TF) Privacy. You will also learn how to tune the parameters
introduced by differentially private optimization and how to
measure the privacy guarantees provided using analysis tools included in TF
Privacy.

In addition, the
tutorials/ folder comes with scripts demonstrating how to use the library
features. The list of tutorials is described in the README included in the
tutorials directory.

NOTE: the tutorials are maintained carefully. However, they are not considered
part of the API and they can change at any time without warning. You should not
write 3rd party code that imports the tutorials and expect that the interface
will not break.

Research directory

This folder contains code to reproduce results from research papers related to
privacy in machine learning. It is not maintained as carefully as the tutorials
directory, but rather intended as a convenient archive.

Remarks

The content of this repository supersedes the following existing folder in the
tensorflow/models repository

Contacts

If you have any questions that cannot be addressed by raising an issue, feel
free to contact:

  • Galen Andrew (@galenmandrew)
  • Steve Chien (@schien1729)
  • Nicolas Papernot (@npapernot)

Copyright 2019 - Google LLC

主要指標

概覽
名稱與所有者tensorflow/privacy
主編程語言Python
編程語言Python (語言數: 4)
平台
許可證Apache License 2.0
所有者活动
創建於2018-12-21 18:46:46
推送於2025-06-13 04:33:41
最后一次提交2025-06-12 21:32:56
發布數18
最新版本名稱v0.9.0 (發布於 )
第一版名稱v.0.0.1 (發布於 )
用户参与
星數2k
關注者數58
派生數462
提交數899
已啟用問題?
問題數186
打開的問題數93
拉請求數169
打開的拉請求數37
關閉的拉請求數167
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?