Giter Site home page Giter Site logo

dp-hp's Introduction

DP-HP

Code for Hermite Polynomial Features for Private Data Generation (published at ICML2022)

Dependencies

Versions numbers are based on our system and may not need to be exact matches.

python 3.6
torch 1.3.1              
torchvision 0.4.2
numpy 1.16.4
scipy 1.3.1
pandas 1.0.1
scikit-learn 0.21.2
matplotlib 3.1.0 (plotting)
seaborn 0.10.0 (more plotting)
sdgym 0.1.0 (handling tabular datasets)
autodp 0.1 (privacy analysis)
backpack-for-pytorch 1.0.1 (efficient DP-SGD for DP-MERF+AE)
tensorboardX 1.7 (some logging)
tensorflow-gpu 1.14.0 (DP-CGAN)

Repository Structure

Comparison between HP features ans RF features (Fig 1)

Execute dp_mehp/error_comaprison_multiple_runs.py.

2D data (Fig 2)

Run dp_mehp/dp_mehp_synth_data_2d.py

Experiments on image data

To run DP-HP experiments, use the following commands:

  1. Obtain .npz files needed: run extract_numpy_data_mats() function in dp_mehp/aux.py

  2. Creating the generated samples and predictive models evaluation

MNIST

  • python3 prod_and_sum_kernel_image.py --log-name *experiment name* --data digits -bs 200 --seed 0 --model-name FC -ep 10 -lr 0.01 --order-hermite-sum 100 --order-hermite-prod 20 --kernel-length-sum 0.005 --kernel-length-prod 0.005 --gamma 5 --prod-dimension 2 for the non-private case

  • python3 prod_and_sum_kernel_image.py --log-name *experiment name* --data digits -bs 200 --seed 0 --ep 10 --lr 0.01 --order-hermite-sum 100 --order-hermite-prod 20 --model-name FC --kernel-length-sum 0.005 --kernel-length-prod 0.005 --gamma 20 --prod-dimension 2 --split --split-sum-ratio 0.8 --is-private for $(1, 10^{-5})$-DP case

FashionMNIST

  • python3 prod_and_sum_kernel_image.py--log-name *experiment name* --data fashion -bs 200 --seed 0 --model-name CNN -ep 10 -lr 0.01 --order-hermite-sum 100 --order-hermite-prod 20 --kernel-length-sum 0.15 --kernel-length-prod 0.15 --gamma 20 --prod-dimension 2 for the non-private case

  • python3 prod_and_sum_kernel_image.py --log-name *experiment name* --data fashion -bs 200 --seed 0 --model-name CNN -ep 10 -lr 0.01 --order-hermite-sum 100 --order-hermite-prod 20 --kernel-length-sum 0.15 --kernel-length-prod 0.15 --gamma 10 --prod-dimension 2 --split --split-sum-ratio 0.8 --is-private for $(1, 10^{-5})$-DP case

  1. Repoducing Fig. 3 and Fig. 6

-Run code_balanced/plot_results.py that loads the results from different models from code_balanced/plots/ folder.

Experiments on tabular data

  1. Results in table 1. are obtained with dp_mehp/discretized_datasets.py

  2. Results in table 2. are obatained with dp_mehp/run_sum_prod_kernel_tabular_data.py

dp-hp's People

Contributors

mvinaroz avatar

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.