11# T2T: Tensor2Tensor Transformers
22
3- [ T2T] ( https://github.com/tensorflow/t2t ) is a modular and extensible library and
4- binaries for supervised learning with TensorFlow and with a focus on sequence
5- tasks. Actively used and maintained by researchers and engineers within Google
6- Brain, T2T strives to maximize idea bandwidth and minimize execution latency.
3+ [ T2T] ( https://github.com/tensorflow/tensor2tensor ) is a modular and extensible
4+ library and binaries for supervised learning with TensorFlow and with a focus on
5+ sequence tasks. Actively used and maintained by researchers and engineers within
6+ Google Brain, T2T strives to maximize idea bandwidth and minimize execution
7+ latency.
78
89T2T is particularly well-suited to researchers working on sequence tasks. We're
910eager to collaborate with you on extending T2T's powers, so please feel free to
1011open an issue on GitHub to kick off a discussion and send along pull requests,
11- See [ our contribution doc] ( CONTRIBUTING.md ) for details and our
12- [ open issues] ( https://github.com/tensorflow/t2t /issues ) .
12+ See [ our contribution doc] ( CONTRIBUTING.md ) for details and our [ open
13+ issues] ( https://github.com/tensorflow/tensor2tensor /issues ) .
1314
1415## T2T overview
1516
@@ -51,18 +52,21 @@ use in the above commands.
5152### Datasets
5253
5354** Datasets** are all standardized on TFRecord files with ` tensorflow.Example `
54- protocol buffers. All datasets are registered and generated with
55- [ ` generator.py ` ] ( data_generators/generator.py ) and many common
56- sequence datasets are already available for generation and use.
55+ protocol buffers. All datasets are registered and generated with the
56+ [ data
57+ generator] ( https://github.com/tensorflow/tensor2tensor/tree/master/tensor2tensor/bin/t2t-datagen )
58+ and many common sequence datasets are already available for generation and use.
5759
5860### Problems and Modalities
5961
6062** Problems** define training-time hyperparameters for the dataset and task,
6163mainly by setting input and output ** modalities** (e.g. symbol, image, audio,
6264label) and vocabularies, if applicable. All problems are defined in
63- [ ` problem_hparams.py ` ] ( data_generators/problem_hparams.py ) . ** Modalities** ,
64- defined in [ ` modality.py ` ] ( utils/modality.py ) , abstract away the input and
65- output data types so that ** models** may deal with modality-independent tensors.
65+ [ ` problem_hparams.py ` ] ( https://github.com/tensorflow/tensor2tensor/tree/master/tensor2tensor/data_generators/problem_hparams.py ) .
66+ ** Modalities** , defined in
67+ [ ` modality.py ` ] ( https://github.com/tensorflow/tensor2tensor/tree/master/tensor2tensor/utils/modality.py ) ,
68+ abstract away the input and output data types so that ** models** may deal with
69+ modality-independent tensors.
6670
6771### Models
6872
@@ -71,19 +75,22 @@ input/output modality or task. Models take dense tensors in and produce dense
7175tensors that may then be transformed in a final step by a ** modality** depending
7276on the task (e.g. fed through a final linear transform to produce logits for a
7377softmax over classes). All models are imported in
74- [ ` models.py ` ] ( models/models.py ) , inherit from ` T2TModel ` - defined in
75- [ ` t2t_model.py ` ] ( utils/t2t_model.py ) - and are registered with
76- [ ` @registry.register_model ` ] ( utils/registry.py ) .
78+ [ ` models.py ` ] ( https://github.com/tensorflow/tensor2tensor/tree/master/tensor2tensor/models/models.py ) ,
79+ inherit from ` T2TModel ` - defined in
80+ [ ` t2t_model.py ` ] ( https://github.com/tensorflow/tensor2tensor/tree/master/tensor2tensor/utils/t2t_model.py )
81+ - and are registered with
82+ [ ` @registry.register_model ` ] ( https://github.com/tensorflow/tensor2tensor/tree/master/tensor2tensor/utils/registry.py ) .
7783
7884### Hyperparameter Sets
7985
8086** Hyperparameter sets** are defined and registered in code with
81- [ ` @registry.register_hparams ` ] ( utils/registry.py ) and are encoded in
87+ [ ` @registry.register_hparams ` ] ( https://github.com/tensorflow/tensor2tensor/tree/master/tensor2tensor/utils/registry.py )
88+ and are encoded in
8289[ ` tf.contrib.training.HParams ` ] ( https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/training/python/training/hparam.py )
8390objects. The ` HParams ` are available to both the problem specification and the
8491model. A basic set of hyperparameters are defined in
85- [ ` common_hparams.py ` ] ( models/common_hparams.py ) and hyperparameter set
86- functions can compose other hyperparameter set functions.
92+ [ ` common_hparams.py ` ] ( https://github.com/tensorflow/tensor2tensor/tree/master/tensor2tensor/ models/common_hparams.py)
93+ and hyperparameter set functions can compose other hyperparameter set functions.
8794
8895### Trainer
8996
@@ -95,7 +102,8 @@ related flags control local and distributed training/evaluation.
95102
96103## Adding a dataset
97104
98- See the data generators [ README] ( data_generators/README.md ) .
105+ See the data generators
106+ [ README] ( https://github.com/tensorflow/tensor2tensor/tree/master/tensor2tensor/data_generators/README.md ) .
99107
100108---
101109
0 commit comments