Skip to content

Commit

Permalink
adding LIME explainer built with 100 samples
Browse files Browse the repository at this point in the history
  • Loading branch information
aj280192 committed Feb 10, 2022
1 parent 9d84081 commit ceff64d
Show file tree
Hide file tree
Showing 23 changed files with 1,282 additions and 392 deletions.
34 changes: 34 additions & 0 deletions configs/ag_news/albert/lime-100.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"path": "$HOME/experiments/thermostat",
"device": "cuda",
"dataset": {
"name": "ag_news",
"split": "test",
"columns": ['input_ids', 'attention_mask', 'token_type_ids', 'special_tokens_mask', 'labels'],
"batch_size": 1,
"root_dir": "$HOME/experiments/thermostat/datasets",
},
"explainer": {
"name": "LimeBase",
"internal_batch_size": 1,
"n_samples": 100,
"mask_prob": 0.3,
},
"model": {
"name": "textattack/albert-base-v2-ag-news",
"mode_load": "hf",
"path_model": null,
"tokenization": {
"max_length": 512,
"padding": "max_length",
"return_tensors": "np",
"truncation": true,
"special_tokens_mask": true,
}
},
"visualization": {
"columns": ["attributions", "predictions", "input_ids", "labels"],
"gamma": 2.0,
"normalize": true,
}
}
34 changes: 34 additions & 0 deletions configs/ag_news/bert/lime-100.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"path": "$HOME/experiments/thermostat",
"device": "cuda",
"dataset": {
"name": "ag_news",
"split": "test",
"columns": ['input_ids', 'attention_mask', 'token_type_ids', 'special_tokens_mask', 'labels'],
"batch_size": 1,
"root_dir": "$HOME/experiments/thermostat/datasets",
},
"explainer": {
"name": "LimeBase",
"internal_batch_size": 1,
"n_samples": 100,
"mask_prob": 0.3,
},
"model": {
"name": "textattack/bert-base-uncased-ag-news",
"mode_load": "hf",
"path_model": null,
"tokenization": {
"max_length": 512,
"padding": "max_length",
"return_tensors": "np",
"truncation": true,
"special_tokens_mask": true,
}
},
"visualization": {
"columns": ["attributions", "predictions", "input_ids", "labels"],
"gamma": 2.0,
"normalize": true,
}
}
34 changes: 34 additions & 0 deletions configs/ag_news/roberta/lime-100.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"path": "$HOME/experiments/thermostat",
"device": "cuda",
"dataset": {
"name": "ag_news",
"split": "test",
"columns": ['input_ids', 'attention_mask', 'special_tokens_mask', 'labels'],
"batch_size": 1,
"root_dir": "$HOME/experiments/thermostat/datasets",
},
"explainer": {
"name": "LimeBase",
"internal_batch_size": 1,
"n_samples": 100,
"mask_prob": 0.3,
},
"model": {
"name": "textattack/roberta-base-ag-news",
"mode_load": "hf",
"path_model": null,
"tokenization": {
"max_length": 512,
"padding": "max_length",
"return_tensors": "np",
"truncation": true,
"special_tokens_mask": true,
}
},
"visualization": {
"columns": ["attributions", "predictions", "input_ids", "labels"],
"gamma": 2.0,
"normalize": true,
}
}
34 changes: 34 additions & 0 deletions configs/imdb/albert/lime-100.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"path": "$HOME/experiments/thermostat",
"device": "cuda",
"dataset": {
"name": "imdb",
"split": "test",
"columns": ['input_ids', 'attention_mask', 'token_type_ids', 'labels'],
"batch_size": 1,
"root_dir": "$HOME/experiments/thermostat/datasets",
},
"explainer": {
"name": "LimeBase",
"internal_batch_size": 1,
"n_samples": 100,
"mask_prob": 0.3,
},
"model": {
"name": "textattack/albert-base-v2-imdb",
"mode_load": "hf",
"path_model": null,
"tokenization": {
"max_length": 512,
"padding": "max_length",
"return_tensors": "np",
"truncation": true,
"special_tokens_mask": true,
}
},
"visualization": {
"columns": ["attributions", "predictions", "input_ids", "labels"],
"gamma": 2.0,
"normalize": true,
}
}
34 changes: 34 additions & 0 deletions configs/imdb/bert/lime-100.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"path": "$HOME/experiments/thermostat",
"device": "cuda",
"dataset": {
"name": "imdb",
"split": "test",
"columns": ['input_ids', 'attention_mask', 'token_type_ids', 'special_tokens_mask', 'labels'],
"batch_size": 1,
"root_dir": "$HOME/experiments/thermostat/datasets",
},
"explainer": {
"name": "LimeBase",
"internal_batch_size": 1,
"n_samples": 100,
"mask_prob": 0.3,
},
"model": {
"name": "textattack/bert-base-uncased-imdb",
"mode_load": "hf",
"path_model": null,
"tokenization": {
"max_length": 512,
"padding": "max_length",
"return_tensors": "np",
"truncation": true,
"special_tokens_mask": true,
}
},
"visualization": {
"columns": ["attributions", "predictions", "input_ids", "labels"],
"gamma": 2.0,
"normalize": true,
}
}
34 changes: 34 additions & 0 deletions configs/imdb/electra/lime-100.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"path": "$HOME/experiments/thermostat",
"device": "cuda",
"dataset": {
"name": "imdb",
"split": "test",
"columns": ['input_ids', 'attention_mask', 'token_type_ids', 'special_tokens_mask', 'labels'],
"batch_size": 1,
"root_dir": "$HOME/experiments/thermostat/datasets",
},
"explainer": {
"name": "LimeBase",
"internal_batch_size": 1,
"n_samples": 100,
"mask_prob": 0.3,
},
"model": {
"name": "monologg/electra-small-finetuned-imdb",
"mode_load": "hf",
"path_model": null,
"tokenization": {
"max_length": 512,
"padding": "max_length",
"return_tensors": "np",
"truncation": true,
"special_tokens_mask": true,
}
},
"visualization": {
"columns": ["attributions", "predictions", "input_ids", "labels"],
"gamma": 2.0,
"normalize": true,
}
}
34 changes: 34 additions & 0 deletions configs/imdb/roberta/lime-100.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"path": "$HOME/experiments/thermostat",
"device": "cuda",
"dataset": {
"name": "imdb",
"split": "test",
"columns": ['input_ids', 'attention_mask', 'special_tokens_mask', 'labels'],
"batch_size": 1,
"root_dir": "$HOME/experiments/thermostat/datasets",
},
"explainer": {
"name": "LimeBase",
"internal_batch_size": 1,
"n_samples": 100,
"mask_prob": 0.3,
},
"model": {
"name": "textattack/roberta-base-imdb",
"mode_load": "hf",
"path_model": null,
"tokenization": {
"max_length": 512,
"padding": "max_length",
"return_tensors": "np",
"truncation": true,
"special_tokens_mask": true,
}
},
"visualization": {
"columns": ["attributions", "predictions", "input_ids", "labels"],
"gamma": 2.0,
"normalize": true,
}
}
34 changes: 34 additions & 0 deletions configs/imdb/xlnet/lime-100.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"path": "$HOME/experiments/thermostat",
"device": "cuda",
"dataset": {
"name": "imdb",
"split": "test",
"columns": ['input_ids', 'attention_mask', 'token_type_ids', 'labels'],
"batch_size": 1,
"root_dir": "$HOME/experiments/thermostat/datasets",
},
"explainer": {
"name": "LimeBase",
"internal_batch_size": 1,
"n_samples": 100,
"mask_prob": 0.3,
},
"model": {
"name": "textattack/xlnet-base-cased-imdb",
"mode_load": "hf",
"path_model": null,
"tokenization": {
"max_length": 512,
"padding": "max_length",
"return_tensors": "np",
"truncation": true,
"special_tokens_mask": true,
}
},
"visualization": {
"columns": ["attributions", "predictions", "input_ids", "labels"],
"gamma": 2.0,
"normalize": true,
}
}
35 changes: 35 additions & 0 deletions configs/mnli/albert/lime-100.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"path": "$HOME/experiments/thermostat",
"device": "cuda",
"dataset": {
"name": "multi_nli",
"text_field": ["premise", "hypothesis"],
"split": "validation_matched",
"columns": ['input_ids', 'attention_mask', 'token_type_ids', 'special_tokens_mask', 'labels'],
"batch_size": 1,
"root_dir": "$HOME/experiments/thermostat/datasets",
},
"explainer": {
"name": "LimeBase",
"internal_batch_size": 1,
"n_samples": 100,
"mask_prob": 0.3,
},
"model": {
"name": "prajjwal1/albert-base-v2-mnli",
"mode_load": "hf",
"path_model": null,
"tokenization": {
"max_length": 512,
"padding": "max_length",
"return_tensors": "np",
"truncation": true,
"special_tokens_mask": true,
}
},
"visualization": {
"columns": ["attributions", "predictions", "input_ids", "label"],
"gamma": 2.0,
"normalize": true,
}
}
35 changes: 35 additions & 0 deletions configs/mnli/bert/lime-100.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"path": "$HOME/experiments/thermostat",
"device": "cuda",
"dataset": {
"name": "multi_nli",
"text_field": ["premise", "hypothesis"],
"split": "validation_matched",
"columns": ['input_ids', 'attention_mask', 'special_tokens_mask', 'token_type_ids', 'labels'],
"batch_size": 1,
"root_dir": "$HOME/experiments/thermostat/datasets",
},
"explainer": {
"name": "LimeBase",
"internal_batch_size": 1,
"n_samples": 100,
"mask_prob": 0.3,
},
"model": {
"name": "textattack/bert-base-uncased-MNLI",
"mode_load": "hf",
"path_model": null,
"tokenization": {
"max_length": 512,
"padding": "max_length",
"return_tensors": "np",
"truncation": true,
"special_tokens_mask": true,
}
},
"visualization": {
"columns": ["attributions", "predictions", "input_ids", "labels"],
"gamma": 2.0,
"normalize": true,
}
}
35 changes: 35 additions & 0 deletions configs/mnli/electra/lime-100.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"path": "$HOME/experiments/thermostat",
"device": "cuda",
"dataset": {
"name": "multi_nli",
"text_field": ["premise", "hypothesis"],
"split": "validation_matched",
"columns": ['input_ids', 'attention_mask', 'token_type_ids', 'special_tokens_mask', 'labels'],
"batch_size": 1,
"root_dir": "$HOME/experiments/thermostat/datasets",
},
"explainer": {
"name": "LimeBase",
"internal_batch_size": 1,
"n_samples": 100,
"mask_prob": 0.3,
},
"model": {
"name": "howey/electra-base-mnli",
"mode_load": "hf",
"path_model": null,
"tokenization": {
"max_length": 512,
"padding": "max_length",
"return_tensors": "np",
"truncation": true,
"special_tokens_mask": true,
}
},
"visualization": {
"columns": ["attributions", "predictions", "input_ids", "labels"],
"gamma": 2.0,
"normalize": true,
}
}
Loading

0 comments on commit ceff64d

Please sign in to comment.