transformers/tests
Patrick von Platen dca34695d0
Reformer (#3351)
* first copy & past commit from Bert and morgans LSH code

* add easy way to compare to trax original code

* translate most of function

* make trax lsh self attention deterministic with numpy seed + copy paste code

* add same config

* add same config

* make layer init work

* implemented hash_vectors function for lsh attention

* continue reformer translation

* hf LSHSelfAttentionLayer gives same output as trax layer

* refactor code

* refactor code

* refactor code

* refactor

* refactor + add reformer config

* delete bogus file

* split reformer attention layer into two layers

* save intermediate step

* save intermediate step

* make test work

* add complete reformer block layer

* finish reformer layer

* implement causal and self mask

* clean reformer test and refactor code

* fix merge conflicts

* fix merge conflicts

* update init

* fix device for GPU

* fix chunk length init for tests

* include morgans optimization

* improve memory a bit

* improve comment

* factorize num_buckets

* better testing parameters

* make whole model work

* make lm model work

* add t5 copy paste tokenizer

* add chunking feed forward

* clean config

* add improved assert statements

* make tokenizer work

* improve test

* correct typo

* extend config

* add complexer test

* add new axial position embeddings

* add local block attention layer

* clean tests

* refactor

* better testing

* save intermediate progress

* clean test file

* make shorter input length work for model

* allow variable input length

* refactor

* make forward pass for pretrained model work

* add generation possibility

* finish dropout and init

* make style

* refactor

* add first version of RevNet Layers

* make forward pass work and add convert file

* make uploaded model forward pass work

* make uploaded model forward pass work

* refactor code

* add namedtuples and cache buckets

* correct head masks

* refactor

* made reformer more flexible

* make style

* remove set max length

* add attention masks

* fix up tests

* fix lsh attention mask

* make random seed optional for the moment

* improve memory in reformer

* add tests

* make style

* make sure masks work correctly

* detach gradients

* save intermediate

* correct backprob through gather

* make style

* change back num hashes

* rename to labels

* fix rotation shape

* fix detach

* update

* fix trainer

* fix backward dropout

* make reformer more flexible

* fix conflict

* fix

* fix

* add tests for fixed seed in reformer layer

* fix trainer typo

* fix typo in activations

* add fp16 tests

* add fp16 training

* support fp16

* correct gradient bug in reformer

* add fast gelu

* re-add dropout for embedding dropout

* better naming

* better naming

* renaming

* finalize test branch

* finalize tests

* add more tests

* finish tests

* fix

* fix type trainer

* fix fp16 tests

* fix tests

* fix tests

* fix tests

* fix issue with dropout

* fix dropout seeds

* correct random seed on gpu

* finalize random seed for dropout

* finalize random seed for dropout

* remove duplicate line

* correct half precision bug

* make style

* refactor

* refactor

* docstring

* remove sinusoidal position encodings for reformer

* move chunking to modeling_utils

* make style

* clean config

* make style

* fix tests

* fix auto tests

* pretrained models

* fix docstring

* update conversion file

* Update pretrained_models.rst

* fix rst

* fix rst

* update copyright

* fix test path

* fix test path

* fix small issue in test

* include reformer in generation tests

* add docs for axial position encoding

* finish docs

* Update convert_reformer_trax_checkpoint_to_pytorch.py

* remove isort

* include sams comments

* remove wrong comment in utils

* correct typos

* fix typo

* Update reformer.rst

* applied morgans optimization

* make style

* make gpu compatible

* remove bogus file

* big test refactor

* add example for chunking

* fix typo

* add to README
2020-05-07 10:17:01 +02:00
..
fixtures AutoConfig + other Auto classes honor model_type 2020-01-11 02:46:17 +00:00
__init__.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_activations.py Reformer (#3351) 2020-05-07 10:17:01 +02:00
test_configuration_auto.py Map configs to models and tokenizers 2020-01-13 23:11:44 +00:00
test_configuration_common.py Pass kwargs to configuration (#3147) 2020-03-05 17:16:57 -05:00
test_doc_samples.py make style 2020-03-04 20:18:07 -05:00
test_hf_api.py [cli] {login, upload, s3} display more helpful error messages 2020-04-30 12:51:06 -04:00
test_hf_argparser.py Trainer (#3800) 2020-04-21 20:11:56 -04:00
test_model_card.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_modeling_albert.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00
test_modeling_auto.py Add missing token classification for XLM (#3277) 2020-03-26 10:22:13 -04:00
test_modeling_bart.py [testing] add timeout_decorator (#3543) 2020-05-01 09:05:47 -04:00
test_modeling_bert.py [EncoderDecoder Tests] Improve tests (#4046) 2020-05-04 02:18:36 +02:00
test_modeling_camembert.py Add camembert integration tests (#3375) 2020-03-24 10:18:37 +01:00
test_modeling_common.py Reformer (#3351) 2020-05-07 10:17:01 +02:00
test_modeling_ctrl.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00
test_modeling_distilbert.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00
test_modeling_electra.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00
test_modeling_encoder_decoder.py [EncoderDecoder Tests] Improve tests (#4046) 2020-05-04 02:18:36 +02:00
test_modeling_flaubert.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00
test_modeling_gpt2.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00
test_modeling_marian.py MarianMTModel.from_pretrained('Helsinki-NLP/opus-marian-en-de') (#3908) 2020-04-28 18:22:37 -04:00
test_modeling_openai.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00
test_modeling_reformer.py Reformer (#3351) 2020-05-07 10:17:01 +02:00
test_modeling_roberta.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00
test_modeling_t5.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00
test_modeling_tf_albert.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00
test_modeling_tf_auto.py Add AutoModelForPreTraining 2020-01-27 14:27:07 -05:00
test_modeling_tf_bert.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00
test_modeling_tf_camembert.py Add camembert integration tests (#3375) 2020-03-24 10:18:37 +01:00
test_modeling_tf_common.py [Config, Caching] Remove output_past everywhere and replace by use_cache argument (#3734) 2020-04-14 14:40:28 -04:00
test_modeling_tf_ctrl.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00
test_modeling_tf_distilbert.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00
test_modeling_tf_electra.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00
test_modeling_tf_gpt2.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00
test_modeling_tf_openai_gpt.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00
test_modeling_tf_roberta.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00
test_modeling_tf_t5.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00
test_modeling_tf_transfo_xl.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00
test_modeling_tf_xlm.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00
test_modeling_tf_xlnet.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00
test_modeling_transfo_xl.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00
test_modeling_xlm_roberta.py [ci] Re-run integration ground truth from fairseq 2020-03-03 15:31:40 -05:00
test_modeling_xlm.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00
test_modeling_xlnet.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00
test_optimization_tf.py TF version of the trainer (#4017) 2020-05-06 12:56:52 -04:00
test_optimization.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_pipelines.py Pipeline for Text Generation: GenerationPipeline (#3758) 2020-04-22 09:37:03 -04:00
test_tokenization_albert.py 💄 super 2020-01-15 18:33:50 -05:00
test_tokenization_auto.py Test correct tokenizers after default switch (#3003) 2020-02-24 18:45:53 -05:00
test_tokenization_bert_japanese.py BertJapaneseTokenizer accept options for mecab (#3566) 2020-04-03 11:12:19 -04:00
test_tokenization_bert.py Tokenizers v3.0.0 (#3185) 2020-04-07 00:29:15 +02:00
test_tokenization_common.py [tests] Light cleanup of tempfile in tests/ 2020-04-30 22:30:15 -04:00
test_tokenization_ctrl.py 💄 super 2020-01-15 18:33:50 -05:00
test_tokenization_distilbert.py Updating the TensorFlow models to work as expected with tokenizers v3.0.0 (#3684) 2020-04-08 16:22:44 -04:00
test_tokenization_fast.py Cleanup fast tokenizers integration (#3706) 2020-04-18 13:43:57 +02:00
test_tokenization_gpt2.py Tokenizers v3.0.0 (#3185) 2020-04-07 00:29:15 +02:00
test_tokenization_openai.py 💄 super 2020-01-15 18:33:50 -05:00
test_tokenization_roberta.py Preserve spaces in GPT-2 tokenizers (#2778) 2020-02-13 13:29:43 -05:00
test_tokenization_t5.py 💄 super 2020-01-15 18:33:50 -05:00
test_tokenization_transfo_xl.py 💄 super 2020-01-15 18:33:50 -05:00
test_tokenization_utils.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_tokenization_xlm_roberta.py XLM-R Tokenizer now passes common tests + Integration tests (#3198) 2020-03-18 09:52:49 -04:00
test_tokenization_xlm.py XLM tokenizer should encode with bos token (#3791) 2020-04-17 11:28:55 -04:00
test_tokenization_xlnet.py 💄 super 2020-01-15 18:33:50 -05:00
test_trainer.py Trainer (#3800) 2020-04-21 20:11:56 -04:00
utils.py [ci] Load pretrained models into the default (long-lived) cache 2020-04-30 22:30:15 -04:00