Skip to content

Commit

Permalink
update power/plots (not working)
Browse files Browse the repository at this point in the history
  • Loading branch information
simplymathematics committed Dec 8, 2023
1 parent e17706a commit 3c0deb5
Show file tree
Hide file tree
Showing 6 changed files with 320 additions and 554 deletions.
3 changes: 0 additions & 3 deletions examples/power/.dvc/.gitignore

This file was deleted.

13 changes: 13 additions & 0 deletions examples/power/conf/clean.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
attacks:
FastGradientMethod: FGM
defences:
Control: Control
FeatureSqueezing: FSQ
params:
FGM: attack.init.eps
Control: model.trainer.nb_epoch
FSQ: model.art.pipeline.preprocessor.bit_depth
fillna:
FGM: 0.0
Control: 20
FSQ: 32
8 changes: 0 additions & 8 deletions examples/power/conf/compile.yaml

This file was deleted.

241 changes: 241 additions & 0 deletions examples/power/params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
_target_: deckard.base.experiment.Experiment
attack:
_target_: deckard.base.attack.Attack
attack_size: 10
data:
_target_: deckard.base.data.Data
generate:
_target_: deckard.base.data.generator.DataGenerator
name: torch_mnist
sample:
_target_: deckard.base.data.sampler.SklearnDataSampler
random_state: 0
stratify: true
sklearn_pipeline:
_target_: deckard.base.data.sklearn_pipeline.SklearnDataPipeline
preprocessor:
name: sklearn.preprocessing.StandardScaler
with_mean: true
with_std: true
init:
_target_: deckard.base.attack.AttackInitializer
batch_size: 1024
eps: 0.99
minimal: true
model:
_target_: deckard.base.model.Model
art:
_target_: deckard.base.model.art_pipeline.ArtPipeline
data:
_target_: deckard.base.data.Data
generate:
_target_: deckard.base.data.generator.DataGenerator
name: torch_mnist
sample:
_target_: deckard.base.data.sampler.SklearnDataSampler
random_state: 0
stratify: true
sklearn_pipeline:
_target_: deckard.base.data.sklearn_pipeline.SklearnDataPipeline
preprocessor:
name: sklearn.preprocessing.StandardScaler
with_mean: true
with_std: true
initialize:
clip_values:
- 0
- 255
criterion:
name: torch.nn.CrossEntropyLoss
optimizer:
lr: 0.01
momentum: 0.9
name: torch.optim.SGD
library: pytorch
data:
_target_: deckard.base.data.Data
generate:
_target_: deckard.base.data.generator.DataGenerator
name: torch_mnist
sample:
_target_: deckard.base.data.sampler.SklearnDataSampler
random_state: 0
stratify: true
sklearn_pipeline:
_target_: deckard.base.data.sklearn_pipeline.SklearnDataPipeline
preprocessor:
name: sklearn.preprocessing.StandardScaler
with_mean: true
with_std: true
init:
_target_: deckard.base.model.ModelInitializer
name: torch_example.ResNet18
num_channels: 1
library: pytorch
trainer:
batch_size: 1024
nb_epoch: 1
name: art.attacks.evasion.FastGradientMethod
targeted: false
method: evasion
model:
_target_: deckard.base.model.Model
art:
_target_: deckard.base.model.art_pipeline.ArtPipeline
data:
_target_: deckard.base.data.Data
generate:
_target_: deckard.base.data.generator.DataGenerator
name: torch_mnist
sample:
_target_: deckard.base.data.sampler.SklearnDataSampler
random_state: 0
stratify: true
sklearn_pipeline:
_target_: deckard.base.data.sklearn_pipeline.SklearnDataPipeline
preprocessor:
name: sklearn.preprocessing.StandardScaler
with_mean: true
with_std: true
initialize:
clip_values:
- 0
- 255
criterion:
name: torch.nn.CrossEntropyLoss
optimizer:
lr: 0.01
momentum: 0.9
name: torch.optim.SGD
library: pytorch
data:
_target_: deckard.base.data.Data
generate:
_target_: deckard.base.data.generator.DataGenerator
name: torch_mnist
sample:
_target_: deckard.base.data.sampler.SklearnDataSampler
random_state: 0
stratify: true
sklearn_pipeline:
_target_: deckard.base.data.sklearn_pipeline.SklearnDataPipeline
preprocessor:
name: sklearn.preprocessing.StandardScaler
with_mean: true
with_std: true
init:
_target_: deckard.base.model.ModelInitializer
name: torch_example.ResNet18
num_channels: 1
library: pytorch
trainer:
batch_size: 1024
nb_epoch: 1
data:
_target_: deckard.base.data.Data
generate:
_target_: deckard.base.data.generator.DataGenerator
name: torch_mnist
sample:
_target_: deckard.base.data.sampler.SklearnDataSampler
random_state: 0
stratify: true
sklearn_pipeline:
_target_: deckard.base.data.sklearn_pipeline.SklearnDataPipeline
preprocessor:
name: sklearn.preprocessing.StandardScaler
with_mean: true
with_std: true
device_id: cpu
direction:
- maximize
- minimize
- minimize
- minimize
files:
_target_: deckard.base.files.FileConfig
adv_predictions_file: adv_predictions.json
attack_dir: attacks
attack_file: attack
attack_type: .pkl
data_dir: data
data_file: data
data_type: .pkl
directory: /result/mnist/
model_dir: null
model_file: null
model_type: null
name: default
params_file: params.yaml
predictions_file: predictions.json
reports: reports
score_dict_file: score_dict.json
model:
_target_: deckard.base.model.Model
art:
_target_: deckard.base.model.art_pipeline.ArtPipeline
data:
_target_: deckard.base.data.Data
generate:
_target_: deckard.base.data.generator.DataGenerator
name: torch_mnist
sample:
_target_: deckard.base.data.sampler.SklearnDataSampler
random_state: 0
stratify: true
sklearn_pipeline:
_target_: deckard.base.data.sklearn_pipeline.SklearnDataPipeline
preprocessor:
name: sklearn.preprocessing.StandardScaler
with_mean: true
with_std: true
initialize:
clip_values:
- 0
- 255
criterion:
name: torch.nn.CrossEntropyLoss
optimizer:
lr: 0.01
momentum: 0.9
name: torch.optim.SGD
library: pytorch
data:
_target_: deckard.base.data.Data
generate:
_target_: deckard.base.data.generator.DataGenerator
name: torch_mnist
sample:
_target_: deckard.base.data.sampler.SklearnDataSampler
random_state: 0
stratify: true
sklearn_pipeline:
_target_: deckard.base.data.sklearn_pipeline.SklearnDataPipeline
preprocessor:
name: sklearn.preprocessing.StandardScaler
with_mean: true
with_std: true
init:
_target_: deckard.base.model.ModelInitializer
name: torch_example.ResNet18
num_channels: 1
library: pytorch
trainer:
batch_size: 1024
nb_epoch: 1
optimizers:
- accuracy
- train_time
- adv_accuracy
- adv_fit_time
scorers:
_target_: deckard.base.scorer.ScorerDict
accuracy:
_target_: deckard.base.scorer.ScorerConfig
direction: maximize
name: sklearn.metrics.accuracy_score
log_loss:
_target_: deckard.base.scorer.ScorerConfig
direction: minimize
name: sklearn.metrics.log_loss
stage: ???
Loading

0 comments on commit 3c0deb5

Please sign in to comment.