Paper: https://arxiv.org/abs/1706.03762
- Install requirements
pip install -r requirements.txt
- Install sonnet
- Run
run_micro_services.sh
Transformer's architecture is composed of blocks. The uses of Sonnet makes the implementation very modular, and reusable. I tried to keep the blocks as much decouple as possible, following the paper:
-
attention/algorithms/transformers
: Create antf.contrib.learn.Experiment
, and thetf.contrib.data.Dataset
-
attention/modules/cores
: Implementation of the core blocks of Transformer such asMultiHeadAttention
,PointWiseFeedForward
-
attention/modules/decoders
: Implementation of a Decoder block, and a Decoder -
attention/modules/encoders
: Implementation of an Encoder block, and an Encoder. -
attention/models
: Implementation of a full Transformer Block. This Module is responsible to create the Encoder and the Decoder -
attention/services
: Micro Services that create the dataset, or train the model -
attention/utils
: Some classes uses as utility (recursive namespace, mocking object) -
attention/*/tests/
: Test of the Module/Algorithm/MicroService
- Copy inputs
- Dialogue generation
- Code modules
- Test modules
- Construct input function
- Build Estimator
- Run estimator
- Plug into a workflow
- Add validation queue
- Iterate over model improvements