Git Product home page Git Product logo

exam's Introduction

Content

This repository's purpose is to present some productions for my exam...

It is based on the PyTorch-DP framework (frozen in the 19th of June, 2020 version. Under Apache License 2.0)

  1. A notebook that presents the budget computation of Differential Privacy with PyTorch-DP and links to properties in several articles for justifications. You can either read it or download it to use on your own server or run it online (quite slow to launch) thanks to Binder

  2. An attempt to convert "102-flowers" DL model to a DP version, see flowers/ directory.

  • First, once and for all : download data.

    • mkdir data/ && cd data && wget https://s3.amazonaws.com/content.udacity-data.com/nd089/flower_data.tar.gz
    • tar xvf flower_data.tar.gz && cd ..
  • Train model: python3 train.py or ./train.py (try -h to list optional arguments, like --cpu if no GPU available, --batch-size, --learning-rate, epochs, --disable-dp...)

  • Record stats about accuracy: ./stats.py. Parameters to experiment are hard coded, see the docstring. Results are stored in experiment_stats/ directory.

  • Record stats about GPU memory:

    • flowers_mem_monitor.py may be run directly to add one line in .cvs file.
    • flowers_mem_stats.sh launches flowers_mem_monitor.py for different parameters (modify code to chose their values), results are stored in mem_flowers/
  1. An other attempt on cifar10 dataset.
  • First without DP: cifar10.py
    • (net = home-made simple model imported from my_net.py)
    • net = fully pre-trained VGG16
    • net = not pre-trained VGG16
    • net = pre-trained on "features" only, not on "classifier" layers.
  • Then converted to DP version: dp_cifar10.py
  1. Other stuff
  • Similar functions (than one of 'flowers') about MNIST dataset, see mnist_train.py, mnist_mem_stats.sh, mnist_mem_monitor.py in mnist/ directory.

  • Calculate directly a privacy budget without launching any training with torchdp/scripts/compute_dp_sgd_privcacy.py (This adaptation to PyTorch-DP I wrote from an equivalent script for TensorFlow is now included in PyTorch-DP repository ๐Ÿ˜).

exam's People

Contributors

jmg-74 avatar

Stargazers

 avatar

Watchers

 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.