diff options
author | Shanqing Cai <cais@google.com> | 2017-12-01 13:56:10 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-12-01 13:59:31 -0800 |
commit | ed9163acfd510c26c49201ec9e360e20a2625ca8 (patch) | |
tree | 5d61ab7de410baa898925f0023792e5015817c17 /third_party/examples/eager/spinn/README.md | |
parent | ae10f63e2fc76faf5835a660043c328d891c41f0 (diff) |
TF Eager: Add SPINN model example for dynamic/recursive NN.
PiperOrigin-RevId: 177636427
Diffstat (limited to 'third_party/examples/eager/spinn/README.md')
-rw-r--r-- | third_party/examples/eager/spinn/README.md | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/third_party/examples/eager/spinn/README.md b/third_party/examples/eager/spinn/README.md new file mode 100644 index 0000000000..c00d8d9015 --- /dev/null +++ b/third_party/examples/eager/spinn/README.md @@ -0,0 +1,54 @@ +# SPINN with TensorFlow eager execution + +SPINN, or Stack-Augmented Parser-Interpreter Neural Network, is a recursive +neural network that utilizes syntactic parse information for natural language +understanding. + +SPINN was originally described by: +Bowman, S.R., Gauthier, J., Rastogi A., Gupta, R., Manning, C.D., & Potts, C. + (2016). A Fast Unified Model for Parsing and Sentence Understanding. + https://arxiv.org/abs/1603.06021 + +Our implementation is based on @jekbradbury's PyTorch implementation at: +https://github.com/jekbradbury/examples/blob/spinn/snli/spinn.py, + +which was released under the BSD 3-Clause License at: +https://github.com/jekbradbury/examples/blob/spinn/LICENSE + +## Content + +Python source file(s): +- `spinn.py`: Model definition and training routines written with TensorFlow + eager execution idioms. + +## To run + +- Make sure you have installed the latest `tf-nightly` or `tf-nightly-gpu` pip + package of TensorFlow in order to access the eager execution feature. + +- Download and extract the raw SNLI data and GloVe embedding vectors. + For example: + + ```bash + curl -fSsL https://nlp.stanford.edu/projects/snli/snli_1.0.zip --create-dirs -o /tmp/spinn-data/snli/snli_1.0.zip + unzip -d /tmp/spinn-data/snli /tmp/spinn-data/snli/snli_1.0.zip + curl -fSsL http://nlp.stanford.edu/data/glove.42B.300d.zip --create-dirs -o /tmp/spinn-data/glove/glove.42B.300d.zip + unzip -d /tmp/spinn-data/glove /tmp/spinn-data/glove/glove.42B.300d.zip + ``` + +- Train model. E.g., + + ```bash + python spinn.py --data_root /tmp/spinn-data --logdir /tmp/spinn-logs + ``` + + During training, model checkpoints and TensorBoard summaries will be written + periodically to the directory specified with the `--logdir` flag. + The training script will reload a saved checkpoint from the directory if it + can find one there. + + To view the summaries with TensorBoard: + + ```bash + tensorboard --logdir /tmp/spinn-logs + ``` |