Giter Club home page Giter Club logo

dp-custom's Introduction

dp-custom

To quickly reproduce results for DP fine-tuning on CIFAR10, just install the following libraries via pip;

And then just cd into dp_finetuning and run python finetune_classifier_dp.py. To run the accounting (which can be quite slow) pass sigma=-1. There are a number of command-line arguments as described below.

To run hyperparameter tuning with the linear scaling rule, run python linear_scaling.py.

For more general experiment reproduction, run the following command:

python {script}.py\
    --dataset_path ${0}\
    --dataset ${1}\
    --lr ${2}\
    --epsilon ${3}\
    --epochs ${4}\
    --arch ${5}\

For conventional CV experiments (ImageNet, CIFAR10, CIFAR100, FashionMNIST, EMNIST, MNIST, STL10, SVHN) {script} = finetune_classifier_dp. If there are any errors during extracting features please raise a comment to the authors -this

For OOD experiments in Wilds (waterbirds, fmow, domainnet, camelyon) {script} = wilds_finetune_classifier_dp after following directions in the cited papers to download and split the datasets accordingly.

For OOD experiments transferring from CIFAR10/CIFAR100 first add the "--save_weights" flag when running a conventional CV experiment, then use {script} = test_transfer and specify the transfer dataset with --transfer_dataset ${6}. Make sure to download CIFAR10C/CIFAR100C from the cited paper.

Dependencies (non-exhaustive):

  • pytorch
  • numpy
  • torchvision
  • opacus
  • timm
  • tqdm
  • fastdp

dp-custom's People

Contributors

kiddyboots216 avatar

Stargazers

Naptmn avatar  avatar bruce avatar Yaodong Yu avatar Tong Wu avatar Xinyu Tang avatar Virat S avatar  avatar

Watchers

James Cloos avatar  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.