transformers/docs/source
Simon Brandeis c89f1bc92e
Add flags to return scores, hidden states and / or attention weights in GenerationMixin (#9150)
* Define new output dataclasses for greedy generation

* Add output_[...] flags in greedy generation methods

Added output_attentions, output_hidden_states, output_scores flags in
generate and greedy_search methods in GenerationMixin.

* [WIP] Implement logic and tests for output flags in generation

* Update GreedySearchOutput classes & docstring

* Implement greedy search output accumulation logic

Update greedy_search unittests

Fix generate method return value docstring

Properly init flags with the default config

* Update configuration to add output_scores flag

* Fix test_generation_utils

Sort imports and fix isinstance tests for GreedySearchOutputs

* Fix typo in generation_utils

* Add return_dict_in_generate for backwards compatibility

* Add return_dict_in_generate flag in config

* Fix tyPo in configuration

* Fix handling of attentions and hidden_states flags

* Make style & quality

* first attempt attentions

* some corrections

* improve tests

* special models requires special test

* disable xlm test for now

* clean tests

* fix for tf

* isort

* Add output dataclasses for other generation methods

* Add logic to return dict in sample generation

* Complete test for sample generation

- Pass output_attentions and output_hidden_states flags to encoder in
encoder-decoder models
- Fix import satements order in test_generation_utils file

* Add logic to return dict in sample generation

- Refactor tests to avoid using self.assertTrue, which provides
scarce information when the test fails
- Add tests for the three beam_search methods: vanilla, sample and
grouped

* Style doc

* Fix copy-paste error in generation tests

* Rename logits to scores and refactor

* Refactor group_beam_search for consistency

* make style

* add sequences_scores

* fix all tests

* add docs

* fix beam search finalize test

* correct docstring

* clean some files

* Made suggested changes to the documentation

* Style doc ?

* Style doc using the Python util

* Update src/transformers/generation_utils.py

* fix empty lines

* fix all test

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2021-01-06 17:11:42 +01:00
..
_static v4.1.1 docs 2020-12-17 11:28:38 -05:00
imgs Guide to fixed-length model perplexity evaluation (#5449) 2020-07-07 16:04:15 -06:00
internal Add flags to return scores, hidden states and / or attention weights in GenerationMixin (#9150) 2021-01-06 17:11:42 +01:00
main_classes Fix documentation links always pointing to master. (#9217) 2021-01-05 06:18:48 -05:00
model_doc Improve documentation coverage for Phobert (#9427) 2021-01-06 10:04:32 -05:00
benchmarks.rst Fix documentation links always pointing to master. (#9217) 2021-01-05 06:18:48 -05:00
bertology.rst Fix documentation links always pointing to master. (#9217) 2021-01-05 06:18:48 -05:00
conf.py Fix documentation links always pointing to master. (#9217) 2021-01-05 06:18:48 -05:00
contributing.md Update installation page and add contributing to the doc (#5084) 2020-06-17 14:01:10 -04:00
converting_tensorflow_models.rst Fix documentation links always pointing to master. (#9217) 2021-01-05 06:18:48 -05:00
custom_datasets.rst correct docs (#9378) 2021-01-04 17:27:29 +01:00
examples.md per_device instead of per_gpu/error thrown when argument unknown (#4618) 2020-05-27 11:36:55 -04:00
favicon.ico Adding usage examples for common tasks (#2850) 2020-02-25 13:48:24 -05:00
glossary.rst Minor documentation revisions from copyediting (#9266) 2020-12-23 10:15:49 -05:00
index.rst Improve documentation coverage for Phobert (#9427) 2021-01-06 10:04:32 -05:00
installation.md Copyright (#8970) 2020-12-07 18:36:34 -05:00
migration.md Copyright (#8970) 2020-12-07 18:36:34 -05:00
model_sharing.rst finalize (#9431) 2021-01-06 14:36:55 +01:00
model_summary.rst Minor documentation revisions from copyediting (#9266) 2020-12-23 10:15:49 -05:00
multilingual.rst Fix documentation links always pointing to master. (#9217) 2021-01-05 06:18:48 -05:00
notebooks.md Update notebooks (#3620) 2020-04-06 14:32:39 -04:00
perplexity.rst Copyright (#8970) 2020-12-07 18:36:34 -05:00
philosophy.rst Minor documentation revisions from copyediting (#9266) 2020-12-23 10:15:49 -05:00
preprocessing.rst Minor documentation revisions from copyediting (#9266) 2020-12-23 10:15:49 -05:00
pretrained_models.rst Copyright (#8970) 2020-12-07 18:36:34 -05:00
quicktour.rst Minor documentation revisions from copyediting (#9266) 2020-12-23 10:15:49 -05:00
serialization.rst Copyright (#8970) 2020-12-07 18:36:34 -05:00
task_summary.rst Fix documentation links always pointing to master. (#9217) 2021-01-05 06:18:48 -05:00
testing.rst Fix documentation links always pointing to master. (#9217) 2021-01-05 06:18:48 -05:00
tokenizer_summary.rst Minor documentation revisions from copyediting (#9266) 2020-12-23 10:15:49 -05:00
training.rst [docs] outline sharded ddp doc (#9208) 2021-01-05 17:34:15 -08:00