• Stars
    star
    1,827
  • Rank 25,408 (Top 0.6 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created over 7 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A TensorFlow Implementation of Tacotron: A Fully End-to-End Text-To-Speech Synthesis Model

A (Heavily Documented) TensorFlow Implementation of Tacotron: A Fully End-to-End Text-To-Speech Synthesis Model

Requirements

  • NumPy >= 1.11.1
  • TensorFlow >= 1.3
  • librosa
  • tqdm
  • matplotlib
  • scipy

Data

We train the model on three different speech datasets.

  1. LJ Speech Dataset
  2. Nick Offerman's Audiobooks
  3. The World English Bible

LJ Speech Dataset is recently widely used as a benchmark dataset in the TTS task because it is publicly available. It has 24 hours of reasonable quality samples. Nick's audiobooks are additionally used to see if the model can learn even with less data, variable speech samples. They are 18 hours long. The World English Bible is a public domain update of the American Standard Version of 1901 into modern English. Its original audios are freely available here. Kyubyong split each chapter by verse manually and aligned the segmented audio clips to the text. They are 72 hours in total. You can download them at Kaggle Datasets.

Training

  • STEP 0. Download LJ Speech Dataset or prepare your own data.
  • STEP 1. Adjust hyper parameters in hyperparams.py. (If you want to do preprocessing, set prepro True`.
  • STEP 2. Run python train.py. (If you set prepro True, run python prepro.py first)
  • STEP 3. Run python eval.py regularly during training.

Sample Synthesis

We generate speech samples based on Harvard Sentences as the original paper does. It is already included in the repo.

  • Run python synthesize.py and check the files in samples.

Training Curve

Attention Plot

Generated Samples

Pretrained Files

  • Keep in mind 200k steps may not be enough for the best performance.
  • LJ 200k
  • WEB 200k

Notes

  • It's important to monitor the attention plots during training. If the attention plots look good (alignment looks linear), and then they look bad (the plots will look similar to what they looked like in the begining of training), then training has gone awry and most likely will need to be restarted from a checkpoint where the attention looked good, because we've learned that it's unlikely that the loss will ever recover. This deterioration of attention will correspond with a spike in the loss.

  • In the original paper, the authors said, "An important trick we discovered was predicting multiple, non-overlapping output frames at each decoder step" where the number of of multiple frame is the reduction factor, r. We originally interpretted this as predicting non-sequential frames during each decoding step t. Thus were using the following scheme (with r=5) during decoding.

    t    frame numbers
    -----------------------
    0    [ 0  1  2  3  4]
    1    [ 5  6  7  8  9]
    2    [10 11 12 13 14]
    ...
    

    After much experimentation, we were unable to have our model learning anything useful. We then switched to predicting r sequential frames during each decoding step.

    t    frame numbers
    -----------------------
    0    [ 0  1  2  3  4]
    1    [ 5  6  7  8  9]
    2    [10 11 12 13 14]
    ...
    

    With this setup we noticed improvements in the attention and have since kept it.

  • Perhaps the most important hyperparemeter is the learning rate. With an intitial learning rate of 0.002 we were never able to learn a clean attention, the loss would frequently explode. With an initial learning rate of 0.001 we were able to learn a clean attention and train for much longer get decernable words during synthesis.

  • Check other TTS models such as DCTTS or deep voice 3.

Differences from the original paper

  • We use Noam style warmup and decay.
  • We implement gradient clipping.
  • Our training batches are bucketed.
  • After the last convolutional layer of the post-processing net, we apply an affine transformation to bring the dimensionality up to 128 from 80, because the required dimensionality of highway net is 128. In the original highway networks paper, the authors mention that the dimensionality of the input can also be increased with zero-padding, but they used the affine transformation in all their experiments. We do not know what the Tacotron authors chose.

Papers that referenced this repo

Jan. 2018, Kyubyong Park & Tommy Mulc

More Repositories

1

transformer

A TensorFlow Implementation of the Transformer: Attention Is All You Need
Python
4,237
star
2

nlp_tasks

Natural Language Processing Tasks and References
3,017
star
3

wordvectors

Pre-trained word vectors of 30+ languages
Python
2,205
star
4

numpy_exercises

Numpy exercises.
Python
1,687
star
5

dc_tts

A TensorFlow Implementation of DC-TTS: yet another text-to-speech model
Python
1,159
star
6

sudoku

Can Neural Networks Crack Sudoku?
Python
823
star
7

g2p

g2p: English Grapheme To Phoneme Conversion
Python
783
star
8

tensorflow-exercises

TensorFlow Exercises - focusing on the comparison with NumPy.
Python
535
star
9

css10

CSS10: A Collection of Single Speaker Speech Datasets for 10 Languages
HTML
457
star
10

deepvoice3

Tensorflow Implementation of Deep Voice 3
Python
452
star
11

neural_chinese_transliterator

Can CNNs transliterate Pinyin into Chinese characters correctly?
Python
334
star
12

pytorch_exercises

Jupyter Notebook
313
star
13

bert_ner

Ner with Bert
Python
281
star
14

nlp_made_easy

Explains nlp building blocks in a simple manner.
Jupyter Notebook
251
star
15

word_prediction

Word Prediction using Convolutional Neural Networks
Python
251
star
16

g2pC

g2pC: A Context-aware Grapheme-to-Phoneme Conversion module for Chinese
Python
235
star
17

g2pK

g2pK: g2p module for Korean
Python
230
star
18

expressive_tacotron

Tensorflow Implementation of Expressive Tacotron
Python
198
star
19

speaker_adapted_tts

Making a TTS model with 1 minute of speech samples within 10 minutes
184
star
20

neural_japanese_transliterator

Can neural networks transliterate Romaji into Japanese correctly?
Python
173
star
21

tacotron_asr

Speech Recognition Using Tacotron
Python
165
star
22

quasi-rnn

Character-level Neural Translation using Quasi-RNNs
Python
134
star
23

label_smoothing

Corrupted labels and label smoothing
Jupyter Notebook
128
star
24

name2nat

name2nat: a Python package for nationality prediction from a name
Python
98
star
25

bert-token-embeddings

Jupyter Notebook
97
star
26

cross_vc

Cross-lingual Voice Conversion
Python
95
star
27

mtp

Multi-lingual Text Processing
95
star
28

pron_dictionaries

pronunciation dictionaries for multiple languages
Python
83
star
29

msg_reply

a simple message reply suggestion system
Python
79
star
30

word_ordering

Can neural networks order a scramble of words correctly?
Python
73
star
31

kss

Python
71
star
32

neural_tokenizer

Tokenize English sentences using neural networks.
Python
64
star
33

bytenet_translation

A TensorFlow Implementation of Machine Translation In Neural Machine Translation in Linear Time
Python
60
star
34

KoParadigm

KoParadigm: Korean Inflectional Paradigm Generator
Python
54
star
35

specAugment

Tensor2tensor experiment with SpecAugment
Python
47
star
36

vq-vae

A Tensorflow Implementation of VQ-VAE Speaker Conversion
Python
43
star
37

lm_finetuning

Language Model Fine-tuning for Moby Dick
Python
42
star
38

texture_generation

An Implementation of 'Texture Synthesis Using Convolutional Neural Networks' with Kylberg Texture Dataset
Python
33
star
39

cjk_trans

Pre-trained Machine Translation Models of Korean from/to ECJ
29
star
40

h2h_converter

Convert Sino-Korean words written in Hangul to Chinese characters, which is called hanja in Korean, using neural networks
Python
28
star
41

integer_sequence_learning

RNN Approaches to Integer Sequence Learning--the famous Kaggle competition
Python
27
star
42

up_and_running_with_Tensorflow

A simple tutorial of TensorFlow + TensorFlow / NumPy exercises
Jupyter Notebook
13
star
43

neurobind

Yet Another Model Using Neural Networks for Predicting Binding Preferences of for Test DNA Sequences
Python
11
star
44

kollocate

Collocation Search of Korean
Python
10
star
45

kyubyong

9
star
46

WhereAmI

Where Am I? - If you want to meet me.
5
star
47

spam_detection

Spam Dectection Under Semi-supervised settings
5
star
48

helo_word

A Neural Grammatical Error Correction System Built On Better Pre-training and Sequential Transfer Learning
Python
2
star