Rich examples are included to demonstrate the use of Texar. The implementations of cutting-edge models/algorithms also provide references for reproducibility and comparisons.

More examples are continuously added…

Examples by Models/Algorithms

RNN / Seq2seq

Transformer (Self-attention)

  • transformer: Transformer for machine translation
  • vae_text: VAE with a transformer decoder for improved language modeling

Variational Autoencoder (VAE)

GANs / Discriminiator-supervision

Reinforcement Learning

  • seq2seq_rl: Attentional seq2seq trained with policy gradient.
  • seqGAN: Policy gradient for sequence generation
  • rl_gym: Various RL algoritms for games on OpenAI Gym

Memory Network

Classifier / Predictions

Examples by Tasks

Language Modeling

Machine Translation


  • hierarchical_dialog: Hierarchical recurrent encoder-decoder model for conversation response generation.

Text Style Transfer


Sequence Tagging


  • rl_gym: Various RL algoritms for games on OpenAI Gym