Giter Site home page Giter Site logo

fat's Introduction

On the Tradeoff between Robustness and Fairness

Code for NeurIPS'22 paper, "On the Tradeoff between Robustness and Fairness" by Xinsong Ma, Zekai Wang, Weiwei Liu.

Preferred Prerequisites

  • Python (3.8)
  • Pytorch (1.9.0)
  • numpy (1.21)
  • tensorboard (2.7)
  • CUDA (11.1)

Simple Instructions

Train Resnet50 on CIFAR 100 using AT(Madry) with perturbation raius=0.015

CUDA_VISIBLE_DEVICES='0' python pgd_var.py --epsilon 0.015 --net resnet50 --dataset cifar100 --seed 1 --batch_size 256 --no_regular

Use our FAT on AT(Madry) with regularization = 0.1

CUDA_VISIBLE_DEVICES='0' python pgd_var.py --epsilon 0.015 --net resnet50 --dataset cifar100 --seed 1 --batch_size 256 --alpha 0.1

Train Resnet18 on CIFAR 10 using original TRADES with beta=6.0, perturbation raius=0.062

CUDA_VISIBLE_DEVICES='0' python trades_var.py --epsilon 0.062 --net resnet18 --beta 6.0 --dataset cifar10 --batch_size 256 --seed 1 --no_regular

Use our FAT on TRADES with regularization = 0.1

CUDA_VISIBLE_DEVICES='0' python trades_var.py --epsilon 0.062 --net resnet18 --beta 6.0 --dataset cifar10 --batch_size 256 --seed 1  --alpha 0.1

Evaluate models using FGSM, PGD and CW attack

CUDA_VISIBLE_DEVICES='0' python var_acc_test.py --attack_type fgsm --dataset 'cifar10' --dir_path './test_models'
CUDA_VISIBLE_DEVICES='0' python var_acc_test.py --attack_type pgd20 --dataset 'cifar10' --dir_path './test_models'
CUDA_VISIBLE_DEVICES='0' python var_acc_test.py --attack_type cw --dataset 'cifar10' --dir_path './test_models'

You can replace the device parameter 'CUDA_VISIBLE_DEVICES' and parameter '-- epsilon', '-- seed' if you need.

fat's People

Contributors

wzekai99 avatar

Stargazers

Chenglin Yu avatar Gates Bin avatar ZouXinn avatar  avatar  avatar

Watchers

 avatar

Forkers

hubin111

fat's Issues

The difference between Var and VCAR

Hello, it is my pleasure to read your paper and I have some questions I would like to inquire about, if it is not too much trouble.
First, I want to know the difference between Var and VCAR, and why not using Var as a regularization?
Second, about the proof of the Theorem 6.1, Jensen's inequality, as I know, is f(E(x)) <= E(f(x)), so I do not understand here.
I'm sorry to disturb you and I'm looking forward to your reply. Thanks

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.