Skip to content

Commit

Permalink
Regenerated adversarial results with higher number of repeats
Browse files Browse the repository at this point in the history
  • Loading branch information
RylanSchaeffer committed Nov 20, 2023
1 parent 9ecc0e7 commit e735b37
Show file tree
Hide file tree
Showing 28 changed files with 10 additions and 254 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ This repository contains the code and data for our preprint

## Setup

We include a conda environment file but this is honestly overkill. As long as you have `matplotlib`,
`numpy`, `pandas`, `scikit-learn` and `seaborn`, you should be good to go. If you insist on creating
a new conda environment, here are the steps:
We include a conda environment file but this is honestly overkill. You should only need `matplotlib`,
`numpy`, `pandas`, `scikit-learn` and `seaborn`. If you insist on a new conda environment, here are the steps:

(Optional) Update conda:

Expand All @@ -31,19 +30,20 @@ To activate the environment:

## Running

Note: the code was written for simplicity and understandability.
Note: The code was written for simplicity and understandability.
Minimizing code duplication was intentionally not a priority.

### Double Descent in Linear Regression



Run [linear_regression_ablations.py](linear_regression_ablations.py).
To reproduce the double descent and the ablations of each of the three factors,
run [linear_regression_ablations.py](linear_regression_ablations.py).
Note: if you want fast but noisy results, set `num_repeats` to a smaller number.

### Adversarial Training and Test Data in Linear Regression

To study how to create adversarial (test) examples or adversarial training data,
To study how to create adversarial test examples or adversarial training data,
run [linear_regression_adversarial.py](linear_regression_adversarial.py).
Note: if you want fast but noisy results, set `num_repeats` to a smaller number.

<p align="middle">
<img align="top" src="results/real_data_adversarial/California%20Housing/adversarial_test_datum.png" width="45%" />
Expand Down
2 changes: 1 addition & 1 deletion linear_regression_ablations.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

singular_value_cutoffs = np.logspace(-3, 0, 7)

num_repeats = 30
num_repeats = 50
for dataset_name, dataset_fn in regression_datasets:
print("On dataset:", dataset_name)

Expand Down
2 changes: 1 addition & 1 deletion linear_regression_adversarial.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

singular_value_cutoffs = np.logspace(-3, 0, 7)

num_repeats = 30
num_repeats = 50
# Chosen for good logarithmic spacing.
adversarial_test_datum_prefactors = [0.0, 0.1, 0.316, 1.0, 3.16, 10.0, 31.6]
adversarial_train_data_prefactors = [0.0, 0.1, 0.316, 1.0, 3.16, 10.0, 31.6]
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/real_data_adversarial/California Housing/unablated.pdf
Binary file not shown.
Binary file modified results/real_data_adversarial/California Housing/unablated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/real_data_adversarial/Diabetes/adversarial_train_data.pdf
Binary file not shown.
Binary file modified results/real_data_adversarial/Diabetes/adversarial_train_data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/real_data_adversarial/Diabetes/unablated.pdf
Binary file not shown.
Binary file modified results/real_data_adversarial/Diabetes/unablated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/real_data_adversarial/Student-Teacher/unablated.pdf
Binary file not shown.
Binary file modified results/real_data_adversarial/Student-Teacher/unablated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/real_data_adversarial/WHO Life Expectancy/unablated.pdf
Binary file not shown.
Binary file modified results/real_data_adversarial/WHO Life Expectancy/unablated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
244 changes: 0 additions & 244 deletions walkthrough.md

This file was deleted.

0 comments on commit e735b37

Please sign in to comment.