train ipet with zero training examples
See original GitHub issueHi,
I am training ipet with zero training examples, I run the following command.
python3 cli.py --method ipet --pattern_ids 0 1 2 3 4 --data_dir /share/home/zqzeng/wmni/data/ag_news_csv/ag_news_csv --model_type roberta --model_name_or_path /share/home/zqzeng/transformers/roberta-large --task_name agnews --output_dir /share/home/zqzeng/wmni/data/output/unsupervised-ipet --do_train --do_eval --pet_repetitions 1 --ipet_n_most_likely 100 --reduction mean --train_examples 0
And I got the following result:
2021-11-09 20:22:31,904 - INFO - tasks - Creating features from dataset file at ag_news_csv/ (num_examples=0, set_type=train)
2021-11-09 20:22:34,978 - INFO - tasks - Returning 120000 train examples with label dist.: [('3', 30000), ('4', 30000), ('2', 30000), ('1', 30000)]
I followed the flow of the program and found that the whole train examples(120000) was uesd to train each individual model.
When I used “–train_examples 10”, it’s normal, as shown below:
2021-11-09 20:19:13,402 - INFO - tasks - Creating features from dataset file at ag_news_csv/ (num_examples=10, set_type=train)
2021-11-09 20:19:16,127 - INFO - tasks - Returning 10 train examples with label dist.: [('1', 3), ('4', 4), ('2', 2), ('3', 1)]
Does the zero training examples don’t work?
I would be grateful for your prompt reply.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
The results of each iteration are as shown below. g0
g1
g2
final
According to the figure 4 in your paper, I think maybe I should use 4 or 5 iterations.
Interesting… I’ll check why we didn’t get a similar error as soon as I find the time. Regardless, the final accuracy should be much better than the one you’ve reported. There are a couple of differences between your command and the one that we have used, so I cannot tell what exactly causes the difference. Could you tell me the results after each iteration (the contents of the
result_test.txt
file in each iteration’s directory)? That will help to identify the point where things diverge.A couple of notes regarding possible differences:
--pet_repetitions 3
, whereas you’ve been using--pet_repetitions 1
. Using more models stabilizes results.--lm_training
(with a ratio of 1:3 training examples and unlabeled examples).--ipet_generations
). You can check that in our paper.Finally, you may get different results due to random selection of examples and model initialization (but those should not account for more than 5% difference in performance). If you want to reproduce our exact results and none of the above helps, you can check out the
v1.1.0
branch that contains the script that we have used for iPET.