models/research/seq_flow_lite
karun bdd9060e2e
Update README.md (#11070)
2023-09-12 09:46:18 -07:00
..
configs
demo Checkin seq_flow_lite (#10886) 2023-01-06 18:43:00 -08:00
layers Checkin seq_flow_lite (#10886) 2023-01-06 18:43:00 -08:00
models Checkin seq_flow_lite (#10886) 2023-01-06 18:43:00 -08:00
tf_ops Checkin seq_flow_lite (#10886) 2023-01-06 18:43:00 -08:00
tflite_ops Checkin seq_flow_lite (#10886) 2023-01-06 18:43:00 -08:00
third_party Checkin seq_flow_lite (#10815) 2022-10-27 17:08:35 -07:00
utils Checkin seq_flow_lite (#10886) 2023-01-06 18:43:00 -08:00
.bazelrc Check in seq_flow_lite (#10796) 2022-09-26 14:35:57 -07:00
BUILD
CONTRIBUTING.md
README.md Update README.md (#11070) 2023-09-12 09:46:18 -07:00
WORKSPACE Checkin seq_flow_lite (#10886) 2023-01-06 18:43:00 -08:00
export_to_tflite.py
input_fn_reader.py
metric_functions.py
trainer.py Check in seq_flow_lite (#10796) 2022-09-26 14:35:57 -07:00
trainer_v2.py

README.md

Sequence Projection Models

This repository contains implementation of the following papers.

Description

We provide a family of models that projects sequence to fixed sized features. The idea behind is to build embedding-free models that minimize the model size. Instead of using embedding table to lookup embeddings, sequence projection models computes them on the fly.

Authors or Maintainers

  • Prabhu Kaliamoorthi
  • Arun Kandoor
  • Yicheng Fan (@thunderfyc)

Requirements

TensorFlow 2.3 Python 3.6

Training

Train a PRADO model on civil comments dataset

bazel run -c opt :trainer -- \
--config_path=$(pwd)/configs/civil_comments_prado.txt \
--runner_mode=train --logtostderr --output_dir=/tmp/prado

Train a SGNN model to detect languages:

bazel run -c opt sgnn:train -- --logtostderr --output_dir=/tmp/sgnn

Evaluation

Evaluate PRADO model:

bazel run -c opt :trainer -- \
--config_path=$(pwd)/configs/civil_comments_prado.txt \
--runner_mode=eval --logtostderr --output_dir=/tmp/prado

Evaluate SGNN model:

bazel run -c opt sgnn:run_tflite -- --model=/tmp/sgnn/model.tflite "Hello world"

References

  1. Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift
    Sergey Ioffe, Christian Szegedy
    [link]. In ICML, 2015.

  2. Quantization and Training of Neural Networks for Efficient Integer-Arithmetic-Only Inference
    Benoit Jacob, Skirmantas Kligys, Bo Chen, Menglong Zhu, Matthew Tang, Andrew Howard, Hartwig Adam, Dmitry Kalenichenko
    [link]. In CVPR, 2018.

  3. PRADO: Projection Attention Networks for Document Classification On-Device
    Prabhu Kaliamoorthi, Sujith Ravi, Zornitsa Kozareva
    [link]. In EMNLP-IJCNLP, 2019

  4. Self-Governing Neural Networks for On-Device Short Text Classification
    Sujith Ravi, Zornitsa Kozareva
    [link]. In EMNLP, 2018

License

License

This project is licensed under the terms of the Apache License 2.0.