Skip to content

Commit

Permalink
working FGSM config for ASR + lint (#859)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidslater authored Oct 30, 2020
1 parent a8800e1 commit bac7a06
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 10 deletions.
20 changes: 10 additions & 10 deletions armory/data/librispeech/librispeech_dev_clean_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ class LibrispeechConfig(tfds.core.BuilderConfig):
def __init__(self, text_encoder_config=None, **kwargs):
"""Constructs a LibrispeechConfig.
Args:
text_encoder_config: `tfds.features.text.TextEncoderConfig`, configuration
for the `tfds.features.text.TextEncoder` used for the text feature.
**kwargs: keyword arguments forwarded to super.
"""
Args:
text_encoder_config: `tfds.features.text.TextEncoderConfig`, configuration
for the `tfds.features.text.TextEncoder` used for the text feature.
**kwargs: keyword arguments forwarded to super.
"""
name = kwargs.get("name")
if name is None:
name = text_encoder_config.name if text_encoder_config else "plain_text"
Expand All @@ -107,12 +107,12 @@ def __init__(self, text_encoder_config=None, **kwargs):
def _make_builder_configs():
"""Make built-in Librispeech BuilderConfigs.
Uses 3 text encodings (plain_text, subwords with 8k vocab, subwords with 32k
vocab).
Uses 3 text encodings (plain_text, subwords with 8k vocab, subwords with 32k
vocab).
Returns:
`list<tfds.audio.LibrispeechConfig>`
"""
Returns:
`list<tfds.audio.LibrispeechConfig>`
"""
text_encoder_configs = [
None,
tfds.features.text.TextEncoderConfig(
Expand Down
72 changes: 72 additions & 0 deletions scenario_configs/asr_deepspeech_baseline_fgsm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"_description": "Baseline DeepSpeech ASR on LibriSpeech, contributed by MITRE Corporation",
"adhoc": {
"skip_adversarial": false
},
"attack": {
"knowledge": "white",
"kwargs": {
"batch_size": 1,
"eps": 0.2,
"eps_step": 0.1,
"minimal": false,
"num_random_init": 0,
"targeted": true
},
"module": "art.attacks.evasion",
"name": "FastGradientMethod",
"targeted": true,
"targeted_labels": {
"scheme": "string",
"value": "TEST STRING"
},
"use_label": false
},
"dataset": {
"batch_size": 1,
"eval_split": "test_clean",
"framework": "numpy",
"module": "armory.data.datasets",
"name": "librispeech",
"train_split": "train_clean100"
},
"defense": null,
"metric": {
"means": false,
"perturbation": "linf",
"record_metric_per_sample": true,
"task": [
"word_error_rate"
]
},
"model": {
"fit": false,
"fit_kwargs": {
"nb_epochs": 20000
},
"model_kwargs": {},
"module": "armory.baseline_models.pytorch.deep_speech",
"name": "get_art_model",
"predict_kwargs": {
"transcription_output": true
},
"weights_file": null,
"wrapper_kwargs": {
"pretrained_model": "librispeech"
}
},
"scenario": {
"kwargs": {},
"module": "armory.scenarios.audio_asr",
"name": "AutomaticSpeechRecognition"
},
"sysconfig": {
"docker_image": "twosixarmory/pytorch-deepspeech:0.12.2-dev",
"external_github_repo": "hkakitani/deepspeech.pytorch",
"gpus": "all",
"local_repo_path": null,
"output_dir": null,
"output_filename": null,
"use_gpu": false
}
}

0 comments on commit bac7a06

Please sign in to comment.