Skip to content

Commit

Permalink
release: private evolution for text
Browse files Browse the repository at this point in the history
  • Loading branch information
fjxmlzn committed Jan 9, 2025
1 parent ef284e7 commit 38712b8
Show file tree
Hide file tree
Showing 149 changed files with 5,022 additions and 329 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ _test
_data
docker*
example/image/test_*
bk*
test*

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down Expand Up @@ -130,7 +132,7 @@ celerybeat.pid
*.sage.py

# Environments
.env
*.env
.venv
env/
venv/
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ This repo is a Python library to **generate differentially private (DP) syntheti
* **Differentially Private Synthetic Data via Foundation Model APIs 1: Images**
[[paper (ICLR 2024)]](https://openreview.net/forum?id=YEhQs8POIo) [[paper (arxiv)](https://arxiv.org/abs/2305.15560)]
**Authors:** [[Zinan Lin](https://zinanlin.me/)], [[Sivakanth Gopi](https://www.microsoft.com/en-us/research/people/sigopi/)], [[Janardhan Kulkarni](https://www.microsoft.com/en-us/research/people/jakul/)], [[Harsha Nori](https://www.microsoft.com/en-us/research/people/hanori/)], [[Sergey Yekhanin](http://www.yekhanin.org/)]

* **Differentially Private Synthetic Data via Foundation Model APIs 2: Text**
[[paper (ICML 2024 Spotlight)]](https://proceedings.mlr.press/v235/xie24g.html) [[paper (arxiv)](https://arxiv.org/abs/2403.01749)] [[website](https://alphapav.github.io/augpe-dpapitext)]
**Authors:** [[Chulin Xie](https://alphapav.github.io/)], [[Zinan Lin](https://zinanlin.me/)], [[Arturs Backurs](https://www.mit.edu/~backurs/)], [[Sivakanth Gopi](https://www.microsoft.com/en-us/research/people/sigopi/)], [[Da Yu](https://dayu11.github.io/)], [[Huseyin Inan](https://www.microsoft.com/en-us/research/people/huinan/)], [[Harsha Nori](https://www.microsoft.com/en-us/research/people/hanori/)], [[Haotian Jiang](https://jhtdavid96.wixsite.com/jianghaotian)], [[Huishuai Zhang](https://huishuai-git.github.io/)], [[Yin Tat Lee](https://yintat.com/)], [[Bo Li](https://aisecure.github.io/)], [[Sergey Yekhanin](http://www.yekhanin.org/)]

## Documentation
Please refer to the [documentation](https://microsoft.github.io/DPSDA/) for more details, including the installation instructions, usage, and examples.

## News

* `11/21/2024`: The refactored codebase for image generation has been released. It is completely refactored to be more modular and easier to use and extend. The code originally published with the [paper](https://arxiv.org/abs/2305.15560) has been moved to the [deprecated](https://github.com/microsoft/DPSDA/tree/deprecated) branch, which is no longer maintained.
* `1/8/2025`: **Text generation** based on the paper `Differentially Private Synthetic Data via Foundation Model APIs 2: Text` has been integrated into the library! If you want to reproduce the results in the [paper](https://arxiv.org/abs/2403.01749), please refer to [our original codebase](https://github.com/AI-secure/aug-pe).
* `11/21/2024`: The refactored codebase for **image generation** based on the paper `Differentially Private Synthetic Data via Foundation Model APIs 1: Images` has been released! It is completely refactored to be more modular and easier to use and extend. The code originally published with the [paper](https://arxiv.org/abs/2305.15560) has been moved to the [deprecated](https://github.com/microsoft/DPSDA/tree/deprecated) branch in this repository, which is no longer maintained.

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion doc/build_autodoc.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sphinx-apidoc -f --module-first -d 3 -o source/api ../pe
sphinx-apidoc -e -f --module-first -d 7 -o source/api ../pe ../pe/*/test* ../pe/*/bk*
make clean html
2 changes: 1 addition & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sphinx_rtd_theme==3.0.2
private-evolution[image,dev] @ git+https://github.com/microsoft/DPSDA.git
private-evolution[image,text,dev] @ git+https://github.com/microsoft/DPSDA.git
faiss-gpu
2 changes: 1 addition & 1 deletion doc/source/api/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ API Reference


.. toctree::
:maxdepth: 3
:maxdepth: 7
:caption: Contents:

modules
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ pe
==

.. toctree::
:maxdepth: 3
:maxdepth: 7

pe
7 changes: 7 additions & 0 deletions doc/source/api/pe.api.api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pe.api.api module
=================

.. automodule:: pe.api.api
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions doc/source/api/pe.api.image.improved_diffusion_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pe.api.image.improved\_diffusion\_api module
============================================

.. automodule:: pe.api.image.improved_diffusion_api
:members:
:undoc-members:
:show-inheritance:
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pe.api.image.improved\_diffusion\_lib.gaussian\_diffusion module
================================================================

.. automodule:: pe.api.image.improved_diffusion_lib.gaussian_diffusion
:members:
:undoc-members:
:show-inheritance:
18 changes: 4 additions & 14 deletions doc/source/api/pe.api.image.improved_diffusion_lib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,8 @@ pe.api.image.improved\_diffusion\_lib package
Submodules
----------

pe.api.image.improved\_diffusion\_lib.gaussian\_diffusion module
----------------------------------------------------------------
.. toctree::
:maxdepth: 7

.. automodule:: pe.api.image.improved_diffusion_lib.gaussian_diffusion
:members:
:undoc-members:
:show-inheritance:

pe.api.image.improved\_diffusion\_lib.unet module
-------------------------------------------------

.. automodule:: pe.api.image.improved_diffusion_lib.unet
:members:
:undoc-members:
:show-inheritance:
pe.api.image.improved_diffusion_lib.gaussian_diffusion
pe.api.image.improved_diffusion_lib.unet
7 changes: 7 additions & 0 deletions doc/source/api/pe.api.image.improved_diffusion_lib.unet.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pe.api.image.improved\_diffusion\_lib.unet module
=================================================

.. automodule:: pe.api.image.improved_diffusion_lib.unet
:members:
:undoc-members:
:show-inheritance:
20 changes: 5 additions & 15 deletions doc/source/api/pe.api.image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,15 @@ Subpackages
-----------

.. toctree::
:maxdepth: 3
:maxdepth: 7

pe.api.image.improved_diffusion_lib

Submodules
----------

pe.api.image.improved\_diffusion\_api module
--------------------------------------------

.. automodule:: pe.api.image.improved_diffusion_api
:members:
:undoc-members:
:show-inheritance:

pe.api.image.stable\_diffusion\_api module
------------------------------------------
.. toctree::
:maxdepth: 7

.. automodule:: pe.api.image.stable_diffusion_api
:members:
:undoc-members:
:show-inheritance:
pe.api.image.improved_diffusion_api
pe.api.image.stable_diffusion_api
7 changes: 7 additions & 0 deletions doc/source/api/pe.api.image.stable_diffusion_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pe.api.image.stable\_diffusion\_api module
==========================================

.. automodule:: pe.api.image.stable_diffusion_api
:members:
:undoc-members:
:show-inheritance:
21 changes: 6 additions & 15 deletions doc/source/api/pe.api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,16 @@ Subpackages
-----------

.. toctree::
:maxdepth: 3
:maxdepth: 7

pe.api.image
pe.api.text

Submodules
----------

pe.api.api module
-----------------

.. automodule:: pe.api.api
:members:
:undoc-members:
:show-inheritance:

pe.api.util module
------------------
.. toctree::
:maxdepth: 7

.. automodule:: pe.api.util
:members:
:undoc-members:
:show-inheritance:
pe.api.api
pe.api.util
7 changes: 7 additions & 0 deletions doc/source/api/pe.api.text.llm_augpe_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pe.api.text.llm\_augpe\_api module
==================================

.. automodule:: pe.api.text.llm_augpe_api
:members:
:undoc-members:
:show-inheritance:
15 changes: 15 additions & 0 deletions doc/source/api/pe.api.text.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
pe.api.text package
===================

.. automodule:: pe.api.text
:members:
:undoc-members:
:show-inheritance:

Submodules
----------

.. toctree::
:maxdepth: 7

pe.api.text.llm_augpe_api
7 changes: 7 additions & 0 deletions doc/source/api/pe.api.util.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pe.api.util module
==================

.. automodule:: pe.api.util
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions doc/source/api/pe.callback.callback.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pe.callback.callback module
===========================

.. automodule:: pe.callback.callback
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions doc/source/api/pe.callback.common.compute_fid.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pe.callback.common.compute\_fid module
======================================

.. automodule:: pe.callback.common.compute_fid
:members:
:undoc-members:
:show-inheritance:
18 changes: 4 additions & 14 deletions doc/source/api/pe.callback.common.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,8 @@ pe.callback.common package
Submodules
----------

pe.callback.common.compute\_fid module
--------------------------------------
.. toctree::
:maxdepth: 7

.. automodule:: pe.callback.common.compute_fid
:members:
:undoc-members:
:show-inheritance:

pe.callback.common.save\_checkpoints module
-------------------------------------------

.. automodule:: pe.callback.common.save_checkpoints
:members:
:undoc-members:
:show-inheritance:
pe.callback.common.compute_fid
pe.callback.common.save_checkpoints
7 changes: 7 additions & 0 deletions doc/source/api/pe.callback.common.save_checkpoints.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pe.callback.common.save\_checkpoints module
===========================================

.. automodule:: pe.callback.common.save_checkpoints
:members:
:undoc-members:
:show-inheritance:
18 changes: 4 additions & 14 deletions doc/source/api/pe.callback.image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,8 @@ pe.callback.image package
Submodules
----------

pe.callback.image.sample\_images module
---------------------------------------
.. toctree::
:maxdepth: 7

.. automodule:: pe.callback.image.sample_images
:members:
:undoc-members:
:show-inheritance:

pe.callback.image.save\_all\_images module
------------------------------------------

.. automodule:: pe.callback.image.save_all_images
:members:
:undoc-members:
:show-inheritance:
pe.callback.image.sample_images
pe.callback.image.save_all_images
7 changes: 7 additions & 0 deletions doc/source/api/pe.callback.image.sample_images.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pe.callback.image.sample\_images module
=======================================

.. automodule:: pe.callback.image.sample_images
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions doc/source/api/pe.callback.image.save_all_images.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pe.callback.image.save\_all\_images module
==========================================

.. automodule:: pe.callback.image.save_all_images
:members:
:undoc-members:
:show-inheritance:
12 changes: 5 additions & 7 deletions doc/source/api/pe.callback.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,16 @@ Subpackages
-----------

.. toctree::
:maxdepth: 3
:maxdepth: 7

pe.callback.common
pe.callback.image
pe.callback.text

Submodules
----------

pe.callback.callback module
---------------------------
.. toctree::
:maxdepth: 7

.. automodule:: pe.callback.callback
:members:
:undoc-members:
:show-inheritance:
pe.callback.callback
15 changes: 15 additions & 0 deletions doc/source/api/pe.callback.text.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
pe.callback.text package
========================

.. automodule:: pe.callback.text
:members:
:undoc-members:
:show-inheritance:

Submodules
----------

.. toctree::
:maxdepth: 7

pe.callback.text.save_text_to_csv
7 changes: 7 additions & 0 deletions doc/source/api/pe.callback.text.save_text_to_csv.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pe.callback.text.save\_text\_to\_csv module
===========================================

.. automodule:: pe.callback.text.save_text_to_csv
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions doc/source/api/pe.constant.data.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pe.constant.data module
=======================

.. automodule:: pe.constant.data
:members:
:undoc-members:
:show-inheritance:
9 changes: 3 additions & 6 deletions doc/source/api/pe.constant.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ pe.constant package
Submodules
----------

pe.constant.data module
-----------------------
.. toctree::
:maxdepth: 7

.. automodule:: pe.constant.data
:members:
:undoc-members:
:show-inheritance:
pe.constant.data
7 changes: 7 additions & 0 deletions doc/source/api/pe.data.data.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pe.data.data module
===================

.. automodule:: pe.data.data
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions doc/source/api/pe.data.image.camelyon17.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pe.data.image.camelyon17 module
===============================

.. automodule:: pe.data.image.camelyon17
:members:
:undoc-members:
:show-inheritance:
Loading

0 comments on commit 38712b8

Please sign in to comment.