A look at ibab/tensorflow-wavenet: 5.4k stars on GitHub, written primarily in Python. A TensorFlow implementation of DeepMind's WaveNet paper
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
A TensorFlow implementation of DeepMind's WaveNet paper
This is a TensorFlow implementation of the WaveNet generative neural
network architecture for audio generation.
The WaveNet neural network architecture directly generates a raw audio waveform,
showing excellent results in text-to-speech and general audio generation (see the
DeepMind blog post and paper for details).
The network models the conditional probability to generate the next
sample in the audio waveform, given all previous samples and possibly
additional parameters.
After an audio preprocessing step, the input waveform is quantized to a fixed integer range.
The integer amplitudes are then one-hot encoded to produce a tensor of shape (num_samples, num_channels).
A convolutional layer that only accesses the current and previous inputs then reduces the channel dimension.
The core of the network is constructed as a stack of causal dilated layers, each of which is a
dilated convolution (convolution with holes), which only accesses the current and past audio samples.
The outputs of all layers are combined and extended back to the original number
of channels by a series of dense postprocessing layers, followed by a softmax
function to transform the outputs into a categorical distribution.
The loss function is the cross-entropy between the output for each timestep and the input at the next timestep.
In this repository, the network implementation can be found in model.py.
Requirements
TensorFlow needs to be installed before running the training script.
Code is tested on TensorFlow version 1.0.1 for Python 2.7 and Python 3.5.
In addition, librosa must be installed for reading and writing audio.
To install the required python packages, run
pip install -r requirements.txt
For GPU support, use
pip install -r requirements_gpu.txt
Training the network
You can use any corpus containing .wav files.
We've mainly used the VCTK corpus (around 10.4GB, Alternative host) so far.
In order to train the network, execute
python train.py --data_dir=corpus
to train the network, where corpus is a directory containing .wav files.
The script will recursively collect all .wav files in the directory.
You can see documentation on each of the training settings by running
python train.py --help
You can find the configuration of the model parameters in wavenet_params.json.
These need to stay the same between training and generation.
Global Conditioning
Global conditioning refers to modifying the model such that the id of a set of mutually-exclusive categories is specified during training and generation of .wav file.
In the case of the VCTK, this id is the integer id of the speaker, of which there are over a hundred.
This allows (indeed requires) that a speaker id be specified at time of generation to select which of the speakers it should mimic. For more details see the paper or source code.
Training with Global Conditioning
The instructions above for training refer to training without global conditioning. To train with global conditioning, specify command-line arguments as follows:
It tells the train.py script that
it should build a model that includes global conditioning.
It specifies the
size of the embedding vector that is looked up based on the id of the speaker.
The global conditioning logic in train.py and audio_reader.py is "hard-wired" to the VCTK corpus at the moment in that it expects to be able to determine the speaker id from the pattern of file naming used in VCTK, but can be easily be modified.
Generating audio
Example output
generated by @jyegerlehner based on speaker 280 from the VCTK corpus.
You can use the generate.py script to generate audio using a previously trained model.
where logdir/train/2017-02-13T16-45-34/model.ckpt-80000 needs to be a path to previously saved model (without extension).
The --samples parameter specifies how many audio samples you would like to generate (16000 corresponds to 1 second by default).
The generated waveform can be played back using TensorBoard, or stored as a
.wav file by using the --wav_out_path parameter:
Fast generation is enabled by default.
It uses the implementation from the Fast Wavenet repository.
You can follow the link for an explanation of how it works.
This reduces the time needed to generate samples to a few minutes.
--gc_channels=32 specifies 32 is the size of the embedding vector, and
must match what was specified when training.
--gc_cardinality=377 is required
as 376 is the largest id of a speaker in the VCTK corpus. If some other corpus
is used, then this number should match what is automatically determined and
printed out by the train.py script at training time.
--gc_id=311 specifies the id of speaker, speaker 311, for which a sample is
to be generated.
Running tests
Install the test requirements
pip install -r requirements_test.txt
Run the test suite
./ci/test.sh
Missing features
Currently there is no local conditioning on extra information which would allow
context stacks or controlling what speech is generated.
Does ibab/tensorflow-wavenet have a project website?
No homepage URL was recorded for ibab/tensorflow-wavenet in TopGit's last sync. The README tab above frequently contains screenshots and demo links, or check the repository description on GitHub.
Does ibab/tensorflow-wavenet have any tags?
TopGit's last sync did not record any GitHub topics for ibab/tensorflow-wavenet. GitHub topics appear in the right sidebar of a repository page; that's the authoritative place to check.
How active is development on ibab/tensorflow-wavenet?
The most recent commit recorded on ibab/tensorflow-wavenet was 3.3 years ago, based on the GitHub push timestamp. The repository has 1.3k forks — one of the better signals of community interest.
How many stars does ibab/tensorflow-wavenet have?
ibab/tensorflow-wavenet has 5.4k GitHub stars — refresh the page for the live number, or check github.com/ibab/tensorflow-wavenet. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
What language is ibab/tensorflow-wavenet written in?
ibab/tensorflow-wavenet is written primarily in Python. GitHub's language field is based on the largest share of bytes in the default branch.
What license does ibab/tensorflow-wavenet use?
ibab/tensorflow-wavenet is released under the MIT license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
Where do I read more about ibab/tensorflow-wavenet?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/ibab/tensorflow-wavenet is the definitive source.
Read full README in the tab above.
Want a second opinion on tensorflow-wavenet?
Ask an AI that can read this page — one click and you get its take on tensorflow-wavenet.