Skip to content

Genetic algorithm producing adversarial examples that satisfy a shape constraint.

License

Notifications You must be signed in to change notification settings

kellinpelrine/ShapeAttack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShapeAttack

This is an algorithm to produce adversarial examples satisfying a shape constraint, e.g. an adversarial monotonic function.

Author: Kellin Pelrine. Code for RBC model modified from code provided by Fabrizio Zilibotti.



The core is a genetic algorithm. It is a gradient-free method and only requires querying a black box. It benefits substantially from parallelization, which is trivial to implement.

image



One application: testing robustness of macroeconomic models. Shape constraints allow one to search, for example, for adversarial perturbations of a utility function that keep the utility increasing in consumption.

This is illustrated by the following figure. Perturbing the utility function in a simple RBC model from blue (log utility) to red, with a monotone increasing constraint, changes the correlation between output and consumption (as determined by the model) from about 0.75 to 0.01.

image



The main file of interest here is main_cluster. At the top of the file, parpool(4) should be set to the desired number of CPU cores to run on. The program will then run the genetic algorithm to find a perturbation of the utility function like the above. More information, including other tests and explanations of the other files, is contained in the report.

About

Genetic algorithm producing adversarial examples that satisfy a shape constraint.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages