Skip to content

Conversation

@ArshdeepSekhon
Copy link
Collaborator

No description provided.

@jinyongyoo
Copy link
Collaborator

jinyongyoo commented Oct 23, 2020

I'm also wondering if it's just possible to achieve the same behavior using --num-examples argument since that is always processed together with a dataset. Having both --num-examples and --test-on-full-dataset seems a bit redundant to me. Instead of --num-examples always being a int, we can maybe allow passing a string like all (or -1 as a Pythonic way to index last element) to specify that we want to attack all samples. Then, in the parse_dataset_from_args function in textattack/commands/attack/attack_args_helpers.py, we can set args.num_examples=len(dataset). That way, we support not only eval command, but also attack and we don't have to worry about keeping track of two arguments.

@jxmorris12
Copy link
Collaborator

I'm also wondering if it's just possible to achieve the same behavior using --num-examples argument since that is always processed together with a dataset. Having both --num-examples and --test-on-full-dataset seems a bit redundant to me. Instead of --num-examples always being a int, we can maybe allow passing a string like all (or -1 as a Pythonic way to index last element) to specify that we want to attack all samples. Then, in the parse_dataset_from_args function in textattack/commands/attack/attack_args_helpers.py, we can set args.num_examples=len(dataset). That way, we support not only eval command, but also attack and we don't have to worry about keeping track of two arguments.

I see what you mean Jeffrey! @ArshdeepSekhon can you add one more thing: a check to make sure both arguments aren't set? Like if someone calls `textattack eval --num-examples=50 --test-on-full-dataset we should throw an error bc we don't know which one to do.

Btw @jinyongyoo I think if we switched to click or another command-line package we'd have better support for this type of thing!

qiyanjun and others added 23 commits October 23, 2020 21:18
small typo in the Update 0_End_to_End.ipynb (3 epochs not 5)
black conf.py
(one manually selected, one autodoc-generated)
add sphinx autodoc generated rest
major docstring clean up / plus reorganize the folder structure under docs
a major shift to rst files generated by sphinx-apidoc
@qiyanjun
Copy link
Member

@ArshdeepSekhon I will close this since you merge similar changes to the #324

@qiyanjun qiyanjun closed this Nov 25, 2020
@Opdoop
Copy link
Contributor

Opdoop commented Nov 27, 2020

In the end, how to eval on entire dataset?
I tried the mentioned three way at textattack 0.2.14

  • --num-examples -1
  • --num-examples all
  • --test-on-full-dataset

Sadly, none of the above works.

@qiyanjun
Copy link
Member

@Opdoop we put this on hold due to final exams.. will update in a week

@qiyanjun qiyanjun reopened this Nov 27, 2020
@ArshdeepSekhon
Copy link
Collaborator Author

Added -1 for attack and eval on entire dataset, sets args.num_examples = len(dataset) if num-examples is specified by user as -1.

@qiyanjun
Copy link
Member

@Opdoop please try now!

@qiyanjun qiyanjun merged commit efe3ac7 into QData:master Nov 28, 2020
@Opdoop
Copy link
Contributor

Opdoop commented Nov 28, 2020

@qiyanjun Success with --num-examples -1
log:

textattack eval --model lstm-imdb --num-examples -1
textattack: train_args.json not found in model path models/classification/lstm/imdb. Defaulting to 2 labels.
textattack: Loading pre-trained TextAttack LSTM: lstm-imdb
Reusing dataset imdb (/home/nano/.cache/huggingface/datasets/imdb/plain_text/1.0.0/90099cb476936b753383ba2ae6ab2eae419b2e87f71cd5189cb9c8e5814d12a3)
textattack: Loading datasets dataset imdb, split test.
textattack: Got 25000 predictions.
textattack: Successes 20535/25000 (82.14%)

One thing I want to confirm, the Successes here means classification result on normal test/val set. Thus the accuracy of the available model lstm-imdb here is 82.14%. Is this correct?

@qiyanjun
Copy link
Member

qiyanjun commented Nov 28, 2020 via email

@jinyongyoo
Copy link
Collaborator

Is it possible to rebase this on the master branch and clean up the commits? Seems like we have way too many commits (169!) coming from master.

@jinyongyoo
Copy link
Collaborator

Nvm didn't see that this PR was already merged.

@qiyanjun
Copy link
Member

@jinyongyoo i wondered that too.. @jinyongyoo @ArshdeepSekhon is it because this is way behind master branch?

@qiyanjun
Copy link
Member

@jinyongyoo i merged it because the request functions are in. And all tests pass. Should we revert?

@Opdoop
Copy link
Contributor

Opdoop commented Nov 28, 2020

@qiyanjun Em... I have seen this doc before. Succesees and Accuracy looks confusing to me. So I just want to confirm these two means the same.

@ArshdeepSekhon
Copy link
Collaborator Author

@qiyanjun Yes this was behind, I rebased it to master

@qiyanjun
Copy link
Member

qiyanjun commented Nov 28, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.