instruction
stringclasses
100 values
code
stringlengths
78
193k
response
stringlengths
259
170k
file
stringlengths
59
203
Expand my code with proper documentation strings
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Berkeley (BAIR) robot pushing dataset. + +Self-Supervised Visual Planning with Temporal Skip Connections +Frederik Ebert, Chelsea Finn, Alex X. Lee, and Sergey Levine. +https://arxiv....
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/bair_robot_pushing.py
Add concise docstrings to each method
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Encoder for audio data.""" import os from subprocess import call @@ -22,6 +23,7 @@ class AudioEncoder(object): + """Encoder class for saving and loading waveforms.""" def...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/audio_encoder.py
Document all public functions with docstrings
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Mozilla Common Voice dataset. + +Note: Generating the full set of examples can take upwards of 5 hours. +As the Common Voice data are distributed in MP3 format, experimenters will nee...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/common_voice.py
Write docstrings that follow conventions
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. +r"""Data generators for bAbi question answering dataset. + + +The dataset consists of 20 tasks for testing text understanding and reasoning +in the bAbI project (https://research.fb.com/...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/babi_qa.py
Add docstrings for production code
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,21 @@ # See the License for the specific language governing permissions and # limitations under the License. +r"""Decode from trained T2T models. + +This binary performs inference using the Estimator API. + +Example usage to decode from dataset: + + t2t-decoder \ + --data_dir ~/data \ + ...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/bin/t2t_decoder.py
Document this script properly
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Cornell Movie Dialog Dataset.""" from __future__ import absolute_import from __future__ import division @@ -33,12 +34,21 @@ @registry.register_problem class DialogCornell32k(dia...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/dialog_cornell.py
Add documentation for all methods
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""TIMIT data generator.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function @@ -39,6 +40,7 @@ def _get_timit(directory)...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/audio.py
Include argument descriptions in docstrings
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,16 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Problem definitions for Allen Brain Atlas problems. + +Notes: + + * TODO(cwbeitel): Want to be able to increase up-sampling ratio and/or + in-paint fraction over the course of tra...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/allen_brain.py
Create documentation for each function signature
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Persona-chat dataset.""" from __future__ import absolute_import from __future__ import division @@ -34,8 +35,18 @@ @registry.register_problem class DialogPersonachat16k(dialog_a...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/dialog_personachat.py
Create docstrings for each class method
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""CIFAR.""" from __future__ import absolute_import from __future__ import division @@ -53,12 +54,25 @@ def _get_cifar(directory, url): + """Download and extract CIFAR to directo...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/cifar.py
Write Python docstrings for this snippet
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for enwik8 data-set.""" from __future__ import absolute_import from __future__ import division @@ -30,6 +31,14 @@ def _maybe_download_corpus(tmp_dir): + """Dow...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/enwik8.py
Write Python docstrings for this snippet
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""IMDB Sentiment Classification Problem.""" from __future__ import absolute_import from __future__ import division @@ -30,6 +31,7 @@ @registry.register_problem class SentimentIMDB...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/imdb.py
Add documentation for all methods
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""OpenSubtitles dataset.""" from __future__ import absolute_import from __future__ import division @@ -34,6 +35,10 @@ @registry.register_problem class DialogOpensubtitles64k2009(d...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/dialog_opensubtitles.py
Generate docstrings with examples
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Abstract class for dialog problems.""" from __future__ import absolute_import from __future__ import division @@ -39,6 +40,7 @@ # An abstract base class for word based chatbot pr...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/dialog_abstract.py
Auto-generate documentation strings for this file
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""CelebA.""" from __future__ import absolute_import from __future__ import division @@ -30,6 +31,7 @@ @registry.register_problem class ImageCeleba(image_utils.ImageProblem): + ""...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/celeba.py
Replace inline comments with docstrings
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Algorithmic data generators.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function @@ -31,12 +32,14 @@ class Algorithmi...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/algorithmic.py
Help me document legacy Python code
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""DailyDialog dataset.""" from __future__ import absolute_import from __future__ import division @@ -32,8 +33,18 @@ @registry.register_problem class DialogDailydialog16k(dialog_ab...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/dialog_dailydialog.py
Write documentation strings for class attributes
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Cipher data generators.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function @@ -26,6 +27,7 @@ @registry.register_proble...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/cipher.py
Add verbose docstrings with examples
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for the Description2Code OpenAI data-set.""" from __future__ import absolute_import from __future__ import division @@ -73,6 +74,7 @@ class Desc2CodeProblem(tex...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/desc2code.py
Add inline docstrings for readability
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""CelebA-HQ.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function @@ -30,6 +31,7 @@ @registry.register_problem class Imag...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/celebahq.py
Add docstrings for production code
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Algorithmic data generators for symbolic math tasks. + +""" from __future__ import absolute_import from __future__ import division @@ -26,8 +29,18 @@ class ExprOp(object): + "...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/algorithmic_math.py
Add docstrings explaining edge cases
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Encoders for DNA data. + +* DNAEncoder: ACTG strings to ints and back +* DelimitedDNAEncoder: for delimited subsequences +""" from __future__ import absolute_import from __future_...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/dna_encoder.py
Help me add docstrings to my project
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -14,6 +14,16 @@ # limitations under the License. # encoding=UTF-8 +"""An unsophisticated data cleaner for en-.. sentence translation pairs. + +This pattern-based English-... cleaner aims fairly aggressively for clean +sentence-like pairs. It discards pairs if the English member has signs of +non-sentence ...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/cleaner_en_xx.py
Add detailed docstrings explaining each function
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for CoNLL dataset.""" from __future__ import absolute_import from __future__ import division @@ -30,8 +31,10 @@ @registry.register_problem class Conll2002Ner(tex...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/conll_ner.py
Create docstrings for reusable components
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Hyperparameters defining different problems. + +""" from __future__ import absolute_import from __future__ import division from __future__ import print_function @@ -30,6 +33,7 @@ ...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/problem_hparams.py
Add verbose docstrings with examples
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""LSUN datasets (bedrooms only for now).""" from __future__ import absolute_import from __future__ import division @@ -37,6 +38,7 @@ def _get_lsun(directory, category, split_name...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/image_lsun.py
Create Google-style docstrings for my code
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,21 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for LAMBADA data-sets. + + +Lmbada as a language modeling task: + https://arxiv.org/abs/1606.06031 + +Lmbada as a reading comprehension task: + https://arxiv.org/abs...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/lambada.py
Document functions with detailed explanations
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for LM1B data-set.""" from __future__ import absolute_import from __future__ import division @@ -32,6 +33,16 @@ def _original_vocab(tmp_dir): + """Returns a se...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/lm1b.py
Include argument descriptions in docstrings
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""ImageNet.""" from __future__ import absolute_import from __future__ import division @@ -56,6 +57,24 @@ def imagenet_pixelrnn_generator(tmp_dir, tra...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/imagenet.py
Improve documentation using docstrings
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Utilities for data generators.""" from __future__ import absolute_import from __future__ import division @@ -44,6 +45,7 @@ def to_example(dictionary): + """Helper: build tf.Ex...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/generator_utils.py
Write docstrings describing each step
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Program Search Problems.""" from __future__ import absolute_import from __future__ import division @@ -32,6 +33,12 @@ @registry.register_problem class ProgramSearchAlgolisp(text...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/program_search.py
Please document this code using docstrings
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for the SNLI data-set.""" from __future__ import absolute_import from __future__ import division @@ -48,6 +49,7 @@ def _download_and_parse_dataset(tmp_dir, trai...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/snli.py
Create structured documentation for my script
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Base class for problem/dataset definitions.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function @@ -50,6 +51,7 @@ cla...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/problem.py
Add docstrings for better understanding
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for LM1B and MNLI combined datasets.""" from __future__ import absolute_import from __future__ import division @@ -27,6 +28,7 @@ @registry.register_problem class...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/lm1b_mnli.py
Generate helpful docstrings for debugging
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Base classes and utilities for image datasets.""" from __future__ import absolute_import from __future__ import division @@ -41,6 +42,14 @@ def image_to_tf_summary_value(image,...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/image_utils.py
Document this script properly
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""MS COCO.""" from __future__ import absolute_import from __future__ import division @@ -46,6 +47,7 @@ def _get_mscoco(directory): + """Download and extract MSCOCO datasets to d...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/mscoco.py
Add docstrings explaining edge cases
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Common classes for automatic speech recognition (ASR) datasets. + +The audio import uses sox to generate normalized waveforms, please install +it as appropriate (e.g. using apt-get or...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/speech_recognition.py
Expand my code with proper documentation strings
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for PTB data-sets.""" from __future__ import absolute_import from __future__ import division @@ -36,6 +37,7 @@ def _read_words(filename): + """Reads words from...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/ptb.py
Add detailed documentation for each class
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""RL environments.""" from __future__ import absolute_import from __future__ import division @@ -46,21 +47,30 @@ # pylint: disable=g-complex-comprehension class Observation(object...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/gym_env.py
Add missing documentation to my Python functions
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for SciTail.""" from __future__ import absolute_import from __future__ import division @@ -33,6 +34,7 @@ @registry.register_problem class SciTail(text_problems.T...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/scitail.py
Create docstrings for reusable components
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for the Recognizing Textual Entailment dataset.""" from __future__ import absolute_import from __future__ import division @@ -32,6 +33,7 @@ @registry.register_pro...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/rte.py
Add standardized docstrings across the file
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Problems for Seq2Edits (see models/research/transformer_seq2edits.py).""" from __future__ import absolute_import from __future__ import division @@ -30,17 +31,20 @@ @modalities.i...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/seq2edits.py
Document functions with detailed explanations
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for the MSR Paraphrase Corpus.""" from __future__ import absolute_import from __future__ import division @@ -31,6 +32,7 @@ @registry.register_problem class MSRPa...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/mrpc.py
Add docstrings for better understanding
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,42 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Multi-problem scheduling in T2T. + +Data sampling schedules are specified by an interpolation method i and a +sequence of tuples (t, pmf), where i can either be 'linear' or 'step', +t...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/multi_problem_v2.py
Add verbose docstrings with examples
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Base classes for paraphrase generation problems.""" from __future__ import absolute_import from __future__ import division @@ -39,6 +40,21 @@ def create_combination(list_of_sen...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/paraphrase_ms_coco.py
Insert docstrings into my code
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Librispeech dataset.""" import os import tarfile @@ -60,6 +61,7 @@ def _collect_data(directory, input_ext, transcription_ext): + """Traverses directory collecting input and ta...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/librispeech.py
Help me add docstrings to my project
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Moving MNIST dataset. + +Unsupervised Learning of Video Representations using LSTMs +Nitish Srivastava, Elman Mansimov, Ruslan Salakhutdinov +https://arxiv.org/abs/1502.04681 + +""" ...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/moving_mnist.py
Add docstrings to meet PEP guidelines
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for SquaAD (https://rajpurkar.github.io/SQuAD-explorer/). +""" from __future__ import absolute_import from __future__ import division @@ -35,6 +37,14 @@ def _ge...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/squad.py
Generate docstrings for this script
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Base class for combining multiple problems for multitask learning.""" from __future__ import absolute_import from __future__ import division @@ -29,6 +30,7 @@ class MixingSched...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/multi_problem.py
Write proper docstrings for these functions
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,32 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""A simple invertible tokenizer. + +Converts from a unicode string to a list of tokens +(represented as Unicode strings). + +This tokenizer has the following desirable properties: + - I...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/tokenizer.py
Provide clean and structured docstrings
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for MultiNLI.""" from __future__ import absolute_import from __future__ import division @@ -39,6 +40,13 @@ def _maybe_download_corpora(tmp_dir): + """Download ...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/multinli.py
Write proper docstrings for these functions
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""MNIST.""" from __future__ import absolute_import from __future__ import division @@ -39,6 +40,7 @@ def _get_mnist(directory): + """Download all MNIST files to directory unless...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/mnist.py
Document this script properly
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for the Question-Answering NLI dataset.""" from __future__ import absolute_import from __future__ import division @@ -32,6 +33,7 @@ @registry.register_problem cl...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/qnli.py
Improve documentation using docstrings
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,24 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Gene expression problems. + +Inputs are bases ACTG (with indices assigned in that order). + +Requires the h5py library. + +File format expected: + * h5 file + * h5 datasets should i...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/gene_expression.py
Help me write clear docstrings
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""This module implements the ice_parsing_* problems.""" # These parse plain text into flattened parse trees and POS tags. # The training data is stored in files named `parsing_train....
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/ice_parsing.py
Include argument descriptions in docstrings
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generator for pointer-generator for word transformer.""" from __future__ import absolute_import from __future__ import division @@ -28,6 +29,12 @@ @registry.register_problem...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/pointer_generator_word.py
Add docstrings with type hints explained
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for translation data-sets.""" from tensor2tensor.data_generators import problem @@ -38,6 +39,10 @@ @registry.register_problem class TranslateEntnRma(translate.T...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/translate_entn.py
Add docstrings to improve code quality
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Github function/text similatrity problems.""" import csv from six import StringIO from tensor2tensor.data_generators import generator_utils @@ -25,6 +26,14 @@ @registry.register_p...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/function_docstring.py
Auto-generate documentation strings for this file
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for the Quora Question Pairs dataset.""" from __future__ import absolute_import from __future__ import division @@ -32,6 +33,7 @@ @registry.register_problem clas...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/quora_qpairs.py
Add docstrings for internal functions
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for translation data-sets.""" from __future__ import absolute_import from __future__ import division @@ -48,6 +49,7 @@ @registry.register_problem class Translate...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/translate_enro.py
Add concise docstrings to each method
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for En-Id translation.""" from __future__ import absolute_import from __future__ import division @@ -73,6 +74,7 @@ @registry.register_problem class TranslateEnid...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/translate_enid.py
Write docstrings that follow conventions
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for translation data-sets.""" from __future__ import absolute_import from __future__ import division @@ -48,6 +49,7 @@ @registry.register_problem class Translate...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/translate_enmk.py
Generate docstrings for this script
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for LM1B and IMDb combined data-set.""" from __future__ import absolute_import from __future__ import division @@ -27,6 +28,7 @@ @registry.register_problem class...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/lm1b_imdb.py
Add concise docstrings to each method
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for translation data-sets.""" from __future__ import absolute_import from __future__ import division @@ -79,6 +80,7 @@ @registry.register_problem class Translate...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/translate_enfr.py
Add docstrings to existing functions
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,11 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Utils to parse HTML content into plaintext.""" import bs4 def get_text_from_html(html): + """Returns a plaintext representation of HTML content.""" try: soup = bs4...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/wikisum/html.py
Write docstrings for this repository
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Stanford Sentiment Treebank Binary Classification Problem.""" from __future__ import absolute_import from __future__ import division @@ -32,6 +33,7 @@ @registry.register_problem ...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/sst_binary.py
Write docstrings for this repository
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Base classes and utilities for video datasets.""" from __future__ import absolute_import from __future__ import division @@ -51,6 +52,18 @@ def video_augmentation(features, hue...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/video_utils.py
Generate docstrings with parameter types
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Utilties for data generation for Wikipedia Revision problem. +""" from __future__ import absolute_import @@ -36,6 +38,21 @@ def include_revision(revision_num, skip_factor=1.1)...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/wiki_revision_utils.py
Auto-generate documentation strings for this file
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for Wiki LM and MNLI combined datasets.""" from __future__ import absolute_import from __future__ import division @@ -33,6 +34,7 @@ @registry.register_problem cl...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/wiki_multi_problems.py
Add docstrings to improve collaboration
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,17 @@ # See the License for the specific language governing permissions and # limitations under the License. +r"""Data extraction/preprocessing for processing wiki history dumps for GEC. + +We use a set of heuristics to distill prose from the wikipedia xml. We produce +source-target pairs of tex...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/wiki_revision.py
Document functions with detailed explanations
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for StanfordNLI.""" from __future__ import absolute_import from __future__ import division @@ -34,6 +35,7 @@ @registry.register_problem class StanfordNLI(text_pr...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/stanford_nli.py
Add return value explanations in docstrings
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Encoders for text data. + +* TextEncoder: base class +* ByteTextEncoder: for ascii text +* TokenTextEncoder: with user-supplied vocabulary file +* SubwordTextEncoder: invertible +""" ...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/text_encoder.py
Add docstrings for production code
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for VQA data sets.""" from __future__ import absolute_import from __future__ import division @@ -44,6 +45,7 @@ def _get_vqa_v2_annotations(directory, ...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/vqa.py
Add structured docstrings to improve clarity
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Utilities for VQA data sets.""" from __future__ import absolute_import from __future__ import division @@ -34,6 +35,21 @@ def _smallest_size_at_least(height, width, smallest_si...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/vqa_utils.py
Create docstrings for API functions
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -14,6 +14,31 @@ # limitations under the License. # pylint: disable=line-too-long +r"""Launch a script in parallel on GCP. + +For each instance (`--num_instances`), the script will copy the code in +`--code_dir` to the instance, run `--setup_command` and then run +`--command_prefix` joined with the task's ...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/wikisum/parallel_launch.py
Add concise docstrings to each method
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,15 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for subject-verb agreement dataset. + +https://arxiv.org/pdf/1611.01368.pdf + +Based on he main paper, predicting verb's number can be done in two setups: +- Language ...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/subject_verb_agreement.py
Auto-generate documentation strings for this file
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Wikisum data generation utilities.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function @@ -58,6 +59,7 @@ @classmethod...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/wikisum/utils.py
Include argument descriptions in docstrings
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Aggregate stats from produce_examples.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function @@ -40,6 +41,7 @@ def aggr...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/wikisum/validate_data.py
Add docstrings for production code
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Wikipedia Summarization Problems.""" from __future__ import absolute_import from __future__ import division @@ -55,6 +56,7 @@ class WikisumBase(problem.Problem): + """Base cla...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/wikisum/wikisum.py
Write docstrings that follow conventions
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for wikitext-103. + +Wikitext-103: Long term dependency language modeling dataset +""" from __future__ import absolute_import from __future__ import division @@ -3...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/wikitext103.py
Generate docstrings with examples
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for the Winograd NLI dataset.""" from __future__ import absolute_import from __future__ import division @@ -32,6 +33,7 @@ @registry.register_problem class Winogr...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/wnli.py
Document helper functions with docstrings
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Multi time series forecasting problem.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function @@ -30,6 +31,7 @@ class Ti...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/timeseries.py
Add verbose docstrings with examples
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Data generators for parsing data-sets.""" from __future__ import absolute_import from __future__ import division @@ -34,6 +35,8 @@ @registry.register_problem class WsjParsing(te...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/wsj_parsing.py
Write Python docstrings for this snippet
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Few utility functions to deal with gym spaces. + +gym.spaces.Box and gym.spaces.Discrete are easiest to support. +""" from __future__ import absolute_import from __future__ import...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/envs/gym_spaces_utils.py
Create docstrings for all classes and functions
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Base classes for text-based language style transfer problems. + +* StyleTransferProblem: abstract class for style transfer problems. +* StyleTransferShakespeare: specific problem impl...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/style_transfer.py
Add docstrings including usage examples
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Utilities to deal with EnvProblem.""" from __future__ import absolute_import from __future__ import division @@ -30,10 +31,12 @@ def done_indices(dones): + """Calculates the i...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/envs/env_problem_utils.py
Add docstrings to make code maintainable
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Gym Tic-Tac-Toe environment. + +Environment acts like the second player and first player is either environment +or the agent. The environment follows a random policy for now. +""" ...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/envs/tic_tac_toe_env.py
Add docstrings to my Python code
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Base classes for text-based Problems. + +* Text2TextProblem: input=text, target=text. +* Text2ClassProblem: input=text, target=class. +* Text2RealProblem: input=text, target=float. +*...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/data_generators/text_problems.py
Generate docstrings with examples
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Commonly re-used transformer layers.""" from __future__ import absolute_import from __future__ import division @@ -35,6 +36,26 @@ def transformer_prepare_encoder(inputs, target_spa...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/layers/transformer_layers.py
Generate documentation strings for clarity
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""transformer (attention seq-seq model) with mixtures of experts. + +""" from __future__ import absolute_import from __future__ import division @@ -52,6 +55,7 @@ @registry.register...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/models/research/transformer_moe.py
Generate docstrings for script automation
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Clean discrete bottleneck as in https://arxiv.org/abs/1805.11063.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function @@ ...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/layers/vq_discrete.py
Write reusable docstrings
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Models for semi-parallel and parallel decoding with the transformer.""" from __future__ import absolute_import from __future__ import division @@ -29,6 +30,7 @@ @registry.registe...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/models/research/transformer_parallel.py
Add docstrings for production code
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,16 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Supercomputer-based language model. + +Uses model-parallelism. + +Each shard (device) has a similar structure with different weights. +Occasional cross-replica-sum across shards. + +E...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/models/research/super_lm.py
Document this module using docstrings
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,32 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Test of the SymShard programming model. + +Symmetric model parallellism. + +Each shard (device) has a similar structure with different weights. +Occasional allreduce (sum) across shar...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/models/research/transformer_symshard.py
Fully document this Python code with docstrings
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""The Seq2Edits model. + +Seq2Edits is an adaptation of the Transformer that predicts span level edits +and pairs them with tags. The Seq2Edits model is described in + + Stahlberg, Fel...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/models/research/transformer_seq2edits.py
Generate descriptive docstrings automatically
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,17 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Neural Shuffle-Exchange Network. + +Implementation of +"Neural Shuffle-Exchange Networks - Sequence Processing in O(n log n) Time" +paper by K.Freivalds, E.Ozolins, A.Sostaks. + +Pape...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/models/research/shuffle_network.py
Help me document legacy Python code
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Simple Generative Adversarial Model with two linear layers. + +Example of how to create a GAN in T2T. +""" from __future__ import absolute_import from __future__ import division @...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/models/vanilla_gan.py
Generate docstrings for exported functions
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""TextCNN (see Convolutional Neural Networks for Sentence Classification).""" from __future__ import absolute_import from __future__ import division @@ -28,8 +29,20 @@ @registry.re...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/models/text_cnn.py
Turn comments into proper docstrings
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Transformer with auxiliary losses from https://arxiv.org/abs/1803.00144.""" from __future__ import absolute_import from __future__ import division @@ -26,6 +27,20 @@ def shift_...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/models/research/transformer_aux.py
Write documentation strings for class attributes
# coding=utf-8 # Copyright 2023 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
--- +++ @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Languaeg modeling experiments in mtf.""" from __future__ import absolute_import @@ -27,6 +28,15 @@ @registry.register_hparams def xmoe_tr_dense_2k(): + """Series of architectu...
https://raw.githubusercontent.com/tensorflow/tensor2tensor/HEAD/tensor2tensor/models/research/moe_experiments.py