Skip to content

Commit

Permalink
Merge branch 'PR#1'
Browse files Browse the repository at this point in the history
  • Loading branch information
johanos1 committed Mar 25, 2024
2 parents fb95cff + 22d672d commit 585fb11
Show file tree
Hide file tree
Showing 39 changed files with 1,052,422 additions and 18 deletions.
38 changes: 38 additions & 0 deletions config/adult.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
run: # Configurations for a specific run
random_seed: 1234 # Integer number of specifying random seed
log_dir: test_adult # String for indicating where to save all the information, including models and computed signals. We can reuse the models saved in the same log_dir.
time_log: True # Indicate whether to log the time for each step

audit: # Configurations for auditing
privacy_game: privacy_loss_model # Indicate the privacy game from privacy_loss_model, avg_privacy_loss_training_algo, privacy_loss_sample
attack_list: [rmia] # String for indicating the membership inference attack. We currently support population, reference.
report_log: test_adult # String that indicates the folder where we save the and auditing report.
device: cuda:0 # String for indicating on which device we conduct the membership inference attack and train reference models.
audit_batch_size: 1000 # Integer number for indicating the batch size for computing signals in the Privacy Meter.
num_shadow_models: 1
f_attack_data_size: 0.01

train: # Configuration for training
type: pytorch # Training framework (we only support pytorch now).
model_name: nn # String for indicating the model type. We support CNN, wrn28-1, wrn28-2, wrn28-10, vgg16, nn and speedyresnet (requires cuda). More model types can be added in model.py.
num_target_model: 1 #Integer number for indicating how many target models we want to audit for the privacy game
device: cuda:0 # String for indicating the device we want to use for training models, e.g., cpu or cuda.
epochs: 100 # Integer number for indicating the epochs for training target model. For speedyresnet, it uses its own number of epochs.
batch_size: 128 # Integer number for indicating batch size for training the target model. For speedyresnet, it uses its own batch size.
optimizer: SGD # String which indicates the optimizer. We support Adam and SGD. For speedyresnet, it uses its own optimizer.
learning_rate: 0.1 # Float number for indicating learning rate for training the target model. For speedyresnet, it uses its own learning_rate.
weight_decay: 0.01 # Float number for indicating weight decay for training the target model. For speedyresnet, it uses its own weight_decay.
test_batch_size: 250 # Integer number for indicating batch size for evaluating the target model.
num_test_size: 1000 # Integer number for indicating the size of the test dataset for evaluating the target model during the training. This should be divisible by test_batch_size.
inputs: 104
outputs: 2

data: # Configuration for data
dataset: adult # String indicates the name of the dataset (i.e., cifar10, cifar100, purchase100, texas1000)
f_train: 0.01 # Float number from 0 to 1 indicating the fraction of the train dataset
f_test: 0.01 # Float number from 0 to 1 indicating the fraction of the test dataset
split_method: no_overlapping # String for indicating the methods of splitting the dataset between train, test, and auditing.
f_audit: 0.3 # Float from 0 to 1, indicating the fraction of the auditing dataset
data_dir: ./data # String about where to save the data.


39 changes: 39 additions & 0 deletions config/cifar10.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
run: # Configurations for a specific run
random_seed: 1234 # Integer number of specifying random seed
log_dir: test_cifar10 # String for indicating where to save all the information, including models and computed signals. We can reuse the models saved in the same log_dir.
time_log: True # Indicate whether to log the time for each step

audit: # Configurations for auditing
privacy_game: privacy_loss_model # Indicate the privacy game from privacy_loss_model, avg_privacy_loss_training_algo, privacy_loss_sample
attack_list: [rmia] # String for indicating the membership inference attack. We currently support population, reference.
report_log: test_cifar10 # String that indicates the folder where we save the and auditing report.
device: cuda:0 # String for indicating on which device we conduct the membership inference attack and train reference models.
audit_batch_size: 1000 # Integer number for indicating the batch size for computing signals in the Privacy Meter.
num_shadow_models: 1
f_attack_data_size: 0.05

train: # Configuration for training
type: pytorch # Training framework (we only support pytorch now).
model_name: nn # String for indicating the model type. We support CNN, wrn28-1, wrn28-2, wrn28-10, vgg16, nn and speedyresnet (requires cuda). More model types can be added in model.py.
num_target_model: 1 #Integer number for indicating how many target models we want to audit for the privacy game
device: cuda:0 # String for indicating the device we want to use for training models, e.g., cpu or cuda.
epochs: 5 # Integer number for indicating the epochs for training target model. For speedyresnet, it uses its own number of epochs.
batch_size: 32 # Integer number for indicating batch size for training the target model. For speedyresnet, it uses its own batch size.
optimizer: SGD # String which indicates the optimizer. We support Adam and SGD. For speedyresnet, it uses its own optimizer.
learning_rate: 0.01 # Float number for indicating learning rate for training the target model. For speedyresnet, it uses its own learning_rate.
momentum: 0.9
weight_decay: 0 # Float number for indicating weight decay for training the target model. For speedyresnet, it uses its own weight_decay.
test_batch_size: 250 # Integer number for indicating batch size for evaluating the target model.
num_test_size: 1000 # Integer number for indicating the size of the test dataset for evaluating the target model during the training. This should be divisible by test_batch_size.
inputs: 104
outputs: 2

data: # Configuration for data
dataset: cifar10 # String indicates the name of the dataset (i.e., cifar10, cifar100, purchase100, texas1000)
f_train: 0.5 # Float number from 0 to 1 indicating the fraction of the train dataset
f_test: 0.5 # Float number from 0 to 1 indicating the fraction of the test dataset
split_method: no_overlapping # String for indicating the methods of splitting the dataset between train, test, and auditing.
f_audit: 0.3 # Float from 0 to 1, indicating the fraction of the auditing dataset
data_dir: ./data # String about where to save the data.


Binary file added data/adult.pkl
Binary file not shown.
6 changes: 6 additions & 0 deletions data/adult/Index
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Index of adult

02 Dec 1996 140 Index
10 Aug 1996 3974305 adult.data
10 Aug 1996 4267 adult.names
10 Aug 1996 2003153 adult.test
Loading

0 comments on commit 585fb11

Please sign in to comment.