Adding FastPitch/PyT (modified version of FastSpeech)
This commit is contained in:
parent
e3a110be6b
commit
6d72839a6c
9
PyTorch/SpeechSynthesis/FastPitch/.dockerignore
Normal file
9
PyTorch/SpeechSynthesis/FastPitch/.dockerignore
Normal file
|
@ -0,0 +1,9 @@
|
|||
*~
|
||||
*.pyc
|
||||
__pycache__
|
||||
output
|
||||
LJSpeech-1.1*
|
||||
runs*
|
||||
pretrained_models
|
||||
|
||||
.git
|
9
PyTorch/SpeechSynthesis/FastPitch/.gitignore
vendored
Normal file
9
PyTorch/SpeechSynthesis/FastPitch/.gitignore
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
*.swp
|
||||
*.swo
|
||||
*.pyc
|
||||
__pycache__
|
||||
scripts_joc/
|
||||
runs*/
|
||||
notebooks/
|
||||
LJSpeech-1.1/
|
||||
output*
|
7
PyTorch/SpeechSynthesis/FastPitch/Dockerfile
Normal file
7
PyTorch/SpeechSynthesis/FastPitch/Dockerfile
Normal file
|
@ -0,0 +1,7 @@
|
|||
ARG FROM_IMAGE_NAME=nvcr.io/nvidia/pytorch:20.03-py3
|
||||
FROM ${FROM_IMAGE_NAME}
|
||||
|
||||
ADD requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
WORKDIR /workspace/fastpitch
|
||||
COPY . .
|
29
PyTorch/SpeechSynthesis/FastPitch/LICENSE
Normal file
29
PyTorch/SpeechSynthesis/FastPitch/LICENSE
Normal file
|
@ -0,0 +1,29 @@
|
|||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2020, NVIDIA Corporation
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
777
PyTorch/SpeechSynthesis/FastPitch/README.md
Normal file
777
PyTorch/SpeechSynthesis/FastPitch/README.md
Normal file
|
@ -0,0 +1,777 @@
|
|||
# FastPitch 1.0 for PyTorch
|
||||
|
||||
This repository provides a script and recipe to train the FastPitch model to achieve state-of-the-art accuracy and is tested and maintained by NVIDIA.
|
||||
|
||||
## Table Of Contents
|
||||
|
||||
- [Model overview](#model-overview)
|
||||
* [Model architecture](#model-architecture)
|
||||
* [Default configuration](#default-configuration)
|
||||
* [Feature support matrix](#feature-support-matrix)
|
||||
* [Features](#features)
|
||||
* [Mixed precision training](#mixed-precision-training)
|
||||
* [Enabling mixed precision](#enabling-mixed-precision)
|
||||
* [Glossary](#glossary)
|
||||
- [Setup](#setup)
|
||||
* [Requirements](#requirements)
|
||||
- [Quick Start Guide](#quick-start-guide)
|
||||
- [Advanced](#advanced)
|
||||
* [Scripts and sample code](#scripts-and-sample-code)
|
||||
* [Parameters](#parameters)
|
||||
* [Training parameters](#training-parameters)
|
||||
* [Audio and SFST parameters](#audio-and-sfst-parameters)
|
||||
* [FastPitch parameters](#fastpitch parameters)
|
||||
* [Command-line options](#command-line-options)
|
||||
* [Getting the data](#getting-the-data)
|
||||
* [Dataset guidelines](#dataset-guidelines)
|
||||
* [Multi-dataset](#multi-dataset)
|
||||
* [Training process](#training-process)
|
||||
* [Inference process](#inference-process)
|
||||
* [Deploying the FastPitch model using Triton Inference Server](#deploying-the-fastpitch-model-using-triton-inference)
|
||||
* [Performance analysis for Triton Inference Server](#performance-analysis-for-triton-inference-server)
|
||||
* [Running the Triton Inference Server and client](#running-the-triton-inference-server-and-client)
|
||||
- [Performance](#performance)
|
||||
* [Benchmarking](#benchmarking)
|
||||
* [Training performance benchmark](#training-performance-benchmark)
|
||||
* [Inference performance benchmark](#inference-performance-benchmark)
|
||||
* [Results](#results)
|
||||
* [Training accuracy results](#training-accuracy-results)
|
||||
* [Training accuracy: NVIDIA DGX-1 (8x V100 16G)](#training-accuracy-nvidia-dgx-1-8x-v100-16g)
|
||||
* [Training stability test](#training-stability-test)
|
||||
* [Training performance results](#training-performance-results)
|
||||
* [Training performance: NVIDIA DGX-1 (8x V100 16G)](#training-performance-nvidia-dgx-1-8x-v100-16g)
|
||||
* [Expected training time](#expected-training-time)
|
||||
* [Training performance: NVIDIA DGX-2 (16x V100 32G)](#training-performance-nvidia-dgx-2-16x-v100-32g)
|
||||
* [Inference performance results](#inference-performance-results)
|
||||
* [Inference performance: NVIDIA DGX-1 (1x V100 16G)](#inference-performance-nvidia-dgx-1-1x-v100-16g)
|
||||
* [Inference performance: NVIDIA T4](#inference-performance-nvidia-t4)
|
||||
- [Release notes](#release-notes)
|
||||
* [Changelog](#changelog)
|
||||
* [Known issues](#known-issues)
|
||||
|
||||
## Model overview
|
||||
|
||||
A full text-to-speech (TTS) system is a pipeline of two neural network
|
||||
models:
|
||||
* a mel-spectrogram generator such as [FastPitch](#) or [Tacotron 2](https://arxiv.org/abs/1712.05884), and
|
||||
* a waveform synthesizer such as [WaveGlow](https://arxiv.org/abs/1811.00002) (see [NVIDIA example code](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/SpeechSynthesis/Tacotron2)).
|
||||
|
||||
It enables users to synthesize natural sounding speech from raw transcripts.
|
||||
|
||||
The FastPitch model generates mel-spectrograms from raw input text and allows to exert additional control over the synthesized utterances, such as:
|
||||
* supply pitch cues to control the prosody
|
||||
* alter the pace of speech
|
||||
The FastPitch model is based on the [FastSpeech](https://arxiv.org/abs/1905.09263) model(?). The main differences between FastPitch and FastSpeech are that FastPitch:
|
||||
* explicitly learns to predict pitch (f0),
|
||||
* achieves higher quality, trains faster and no longer needs knowledge distillation from a teacher model,
|
||||
* character durations are extracted with a Tacotron 2 model.
|
||||
|
||||
The model is trained on a publicly
|
||||
available [LJ Speech dataset](https://keithito.com/LJ-Speech-Dataset/).
|
||||
|
||||
This model is trained with mixed precision using Tensor Cores on NVIDIA Volta and Turing GPUs. Therefore, researchers can get results 2.2x faster than training without Tensor Cores, while experiencing the benefits of mixed precision training. This model is tested against each NGC monthly container release to ensure consistent accuracy and performance over time.
|
||||
|
||||
### Model architecture
|
||||
|
||||
FastPitch is a fully feedforward Transformer model that predicts mel-spectrograms
|
||||
from raw text. The model is composed of an encoder, pitch predictor, duration predictor, and a decoder.
|
||||
After encoding, the signal is augmented with pitch information and discretely upsampled.
|
||||
The goal of the decoder is to smooth out the upsampled signal, and construct a mel-spectrogram.
|
||||
The entire process is parallel.
|
||||
|
||||
|
||||
|
||||
|
||||
<div style="text-align:center" align="center">
|
||||
<img src="./img/fastpitch_model.png" alt="FastPitch model architecture" />
|
||||
</br>
|
||||
<em>Figure 1. Architecture of FastPitch (source: [FastPitch: Paper title TODO](#))</em>
|
||||
</div>
|
||||
|
||||
### Default configuration
|
||||
|
||||
The FastPitch model supports multi-GPU and mixed precision training with dynamic loss
|
||||
scaling (see Apex code
|
||||
[here](https://github.com/NVIDIA/apex/blob/master/apex/fp16_utils/loss_scaler.py)),
|
||||
as well as mixed precision inference.
|
||||
|
||||
The following features were implemented in this model:
|
||||
|
||||
* data-parallel multi-GPU training,
|
||||
* dynamic loss scaling with backoff for Tensor Cores (mixed precision)
|
||||
training,
|
||||
* gradient accumulation for reproducible results regardless of the number of GPUs.
|
||||
|
||||
To speed-up FastPitch training,
|
||||
reference mel-spectrograms, character durations, and pitch cues
|
||||
are generated during the pre-processing step and read
|
||||
directly from the disk during training. For more information on data pre-processing refer to [Dataset guidelines
|
||||
](#dataset-guidelines) and the [paper](#).
|
||||
|
||||
### Feature support matrix
|
||||
|
||||
The following features are supported by this model.
|
||||
|
||||
| Feature | FastPitch |
|
||||
| :------------------------------------------------------------------|------------:|
|
||||
|[AMP](https://nvidia.github.io/apex/amp.html) | Yes |
|
||||
|[Apex DistributedDataParallel](https://nvidia.github.io/apex/parallel.html) | Yes |
|
||||
|
||||
#### Features
|
||||
|
||||
AMP - a tool that enables Tensor Core-accelerated training. For more information,
|
||||
refer to [Enabling mixed precision](#enabling-mixed-precision).
|
||||
|
||||
Apex DistributedDataParallel - a module wrapper that enables easy multiprocess
|
||||
distributed data parallel training, similar to `torch.nn.parallel.DistributedDataParallel`.
|
||||
`DistributedDataParallel` is optimized for use with NCCL. It achieves high
|
||||
performance by overlapping communication with computation during `backward()`
|
||||
and bucketing smaller gradient transfers to reduce the total number of transfers
|
||||
required.
|
||||
|
||||
### Mixed precision training
|
||||
|
||||
Mixed precision is the combined use of different numerical precisions in a computational method. [Mixed precision](https://arxiv.org/abs/1710.03740) training offers significant computational speedup by performing operations in half-precision format while storing minimal information in single-precision to retain as much information as possible in critical parts of the network. Since the introduction of [Tensor Cores](https://developer.nvidia.com/tensor-cores) in the Volta and Turing architecture, significant training speedups are experienced by switching to mixed precision -- up to 3x overall speedup on the most arithmetically intense model architectures. Using mixed precision training requires two steps:
|
||||
1. Porting the model to use the FP16 data type where appropriate.
|
||||
2. Adding loss scaling to preserve small gradient values.
|
||||
|
||||
The ability to train deep learning networks with lower precision was introduced in the Pascal architecture and first supported in [CUDA 8](https://devblogs.nvidia.com/parallelforall/tag/fp16/) in the NVIDIA Deep Learning SDK.
|
||||
|
||||
For information about:
|
||||
- How to train using mixed precision, see the [Mixed Precision Training](https://arxiv.org/abs/1710.03740) paper and [Training With Mixed Precision](https://docs.nvidia.com/deeplearning/performance/mixed-precision-training/index.html) documentation.
|
||||
- Techniques used for mixed precision training, see the [Mixed-Precision Training of Deep Neural Networks](https://devblogs.nvidia.com/mixed-precision-training-deep-neural-networks/) blog.
|
||||
- How to access and enable AMP for TensorFlow, see [Using TF-AMP](https://docs.nvidia.com/deeplearning/dgx/tensorflow-user-guide/index.html#tfamp) from the TensorFlow User Guide.
|
||||
- APEX tools for mixed precision training, see the [NVIDIA Apex: Tools for Easy Mixed-Precision Training in PyTorch](https://devblogs.nvidia.com/apex-pytorch-easy-mixed-precision-training/).
|
||||
|
||||
#### Enabling mixed precision
|
||||
|
||||
Mixed precision is enabled in PyTorch by using the Automatic Mixed Precision
|
||||
(AMP) library from [APEX](https://github.com/NVIDIA/apex) that casts variables
|
||||
to half-precision upon retrieval, while storing variables in single-precision
|
||||
format. Furthermore, to preserve small gradient magnitudes in backpropagation,
|
||||
a [loss scaling](https://docs.nvidia.com/deeplearning/performance/mixed-precision-training/index.html#lossscaling)
|
||||
step must be included when applying gradients. In PyTorch, loss scaling can be
|
||||
easily applied by using the `scale_loss()` method provided by AMP. The scaling value
|
||||
to be used can be [dynamic](https://nvidia.github.io/apex/fp16_utils.html#apex.fp16_utils.DynamicLossScaler) or fixed.
|
||||
|
||||
By default, the `train_fastpitch.sh` script will
|
||||
launch mixed precision training with Tensor Cores. You can change this
|
||||
behaviour by removing the `--amp-run` flag from the `train.py` script.
|
||||
|
||||
To enable mixed precision, the following steps were performed:
|
||||
* Import AMP from APEX:
|
||||
```bash
|
||||
from apex import amp
|
||||
```
|
||||
|
||||
* Initialize AMP:
|
||||
```bash
|
||||
model, optimizer = amp.initialize(model, optimizer, opt_level="O1")
|
||||
```
|
||||
|
||||
* If running on multi-GPU, wrap the model with `DistributedDataParallel`:
|
||||
```bash
|
||||
from apex.parallel import DistributedDataParallel as DDP
|
||||
model = DDP(model)
|
||||
```
|
||||
|
||||
* Scale loss before backpropagation (assuming loss is stored in a variable
|
||||
called `losses`):
|
||||
|
||||
* Default backpropagate for FP32:
|
||||
```bash
|
||||
losses.backward()
|
||||
```
|
||||
|
||||
* Scale loss and backpropagate with AMP:
|
||||
```bash
|
||||
with optimizer.scale_loss(losses) as scaled_losses:
|
||||
scaled_losses.backward()
|
||||
```
|
||||
|
||||
|
||||
### Glossary
|
||||
|
||||
**Forced alignment**
|
||||
Segmentation of a recording into lexical units like characters, words, or phonemes. The segmentation is hard and defines exact starting end ending times for every unit.
|
||||
|
||||
**Fundamental frequency**
|
||||
The lowest vibration frequency of a periodic soundwave, for example, produced by a vibrating instrument. It is perceived as the loudest. In the context of speech, it refers to the frequency of vibration of vocal chords. Abbreviated as *f0*.
|
||||
|
||||
**Pitch**
|
||||
A perceived frequency of vibration of music or sound.
|
||||
|
||||
**Transformer**
|
||||
The paper [Attention Is All You Need](https://arxiv.org/abs/1706.03762) introduces a novel architecture called Transformer, which repeatedly applies the attention mechanism. It transforms one sequence into another.
|
||||
|
||||
## Setup
|
||||
|
||||
The following section lists the requirements that you need to meet in order to start training the FastPitch model.
|
||||
|
||||
### Requirements
|
||||
|
||||
This repository contains Dockerfile which extends the PyTorch NGC container and encapsulates some dependencies. Aside from these dependencies, ensure you have the following components:
|
||||
- [NVIDIA Docker](https://github.com/NVIDIA/nvidia-docker)
|
||||
- [PyTorch 20.03-py3 NGC container](https://ngc.nvidia.com/registry/nvidia-pytorch)
|
||||
or newer
|
||||
- [NVIDIA Volta](https://www.nvidia.com/en-us/data-center/volta-gpu-architecture/) or [Turing](https://www.nvidia.com/en-us/geforce/turing/) based GPU
|
||||
|
||||
For more information about how to get started with NGC containers, see the following sections from the NVIDIA GPU Cloud Documentation and the Deep Learning Documentation:
|
||||
- [Getting Started Using NVIDIA GPU Cloud](https://docs.nvidia.com/ngc/ngc-getting-started-guide/index.html)
|
||||
- [Accessing And Pulling From The NGC Container Registry](https://docs.nvidia.com/deeplearning/frameworks/user-guide/index.html#accessing_registry)
|
||||
- [Running PyTorch](https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/running.html#running)
|
||||
|
||||
For those unable to use the PyTorch NGC container, to set up the required environment or create your own container, see the versioned [NVIDIA Container Support Matrix](https://docs.nvidia.com/deeplearning/frameworks/support-matrix/index.html).
|
||||
|
||||
## Quick Start Guide
|
||||
|
||||
To train your model using mixed precision with Tensor Cores or using FP32, perform the following steps using the default parameters of the FastPitch model on the LJSpeech 1.1 dataset. For the specifics concerning training and inference, see the [Advanced](#advanced) section.
|
||||
|
||||
1. Clone the repository.
|
||||
```bash
|
||||
git clone https://github.com/NVIDIA/DeepLearningExamples.git
|
||||
cd DeepLearningExamples/PyTorch/SpeechSynthesis/FastPitch
|
||||
```
|
||||
|
||||
2. Build and run the FastPitch PyTorch NGC container.
|
||||
|
||||
By default the container will use the first available GPU. Modify the script to include other available devices.
|
||||
```bash
|
||||
bash scripts/docker/build.sh
|
||||
bash scripts/docker/interactive.sh
|
||||
```
|
||||
|
||||
3. Download and preprocess the dataset.
|
||||
|
||||
Use the scripts to automatically download and preprocess the training, validation and test datasets:
|
||||
```bash
|
||||
bash scripts/download_dataset.sh
|
||||
bash scripts/prepare_dataset.sh
|
||||
```
|
||||
|
||||
The data is downloaded to the `./LJSpeech-1.1` directory (on the host). The
|
||||
`./LJSpeech-1.1` directory is mounted under the `/workspace/fastpitch/LJSpeech-1.1`
|
||||
location in the NGC container. The complete dataset has the following structure:
|
||||
```bash
|
||||
./LJSpeech-1.1
|
||||
├── durations # Character durations estimates for forced alignment training
|
||||
├── mels # Pre-calculated target mel-spectrograms
|
||||
├── metadata.csv # Mapping of waveforms to utterances
|
||||
├── pitch_char # Average fundamental frequencies, aligned and averaged for every character
|
||||
├── pitch_char_stats__ljs_audio_text_train_filelist.json # Mean and std of pitch for training data
|
||||
├── README
|
||||
└── wavs # Raw waveforms
|
||||
```
|
||||
|
||||
4. Start training.
|
||||
```bash
|
||||
bash scripts/train.sh
|
||||
```
|
||||
The training will produce a FastPitch model capable of generating mel-spectrograms from raw text.
|
||||
It will be serialized as a single `.pt` checkpoint file, along with a series of intermediate checkpoints.
|
||||
|
||||
5. Start validation/evaluation.
|
||||
|
||||
Ensure your training loss values are comparable to those listed in the table in the
|
||||
[Results](#results) section. Note that the validation loss is evaluated with ground truth durations for letters (not the predicted ones). The loss values are stored in the `./output/nvlog.json` log file, `./output/{train,val,test}` as TensorBoard logs, and printed to the standard output (`stdout`) during training.
|
||||
The main reported loss is a weighted sum of losses for mel-, pitch-, and duration- predicting modules.
|
||||
|
||||
The audio can be generated by following the [Inference process](#inference-process) section below.
|
||||
The synthesized audio should be similar to the samples in the `./audio` directory.
|
||||
|
||||
6. Start inference/predictions.
|
||||
|
||||
To synthesize audio, you will need to train a WaveGlow model, which generates waveforms based on mel-spectrograms generated with FastPitch. To train WaveGlow, follow the instructions in [NVIDIA/DeepLearningExamples/Tacotron2](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/SpeechSynthesis/Tacotron2). A pre-trained WaveGlow checkpoint should be placed into the `./pretrained_models` directory.
|
||||
|
||||
You can perform inference using the respective `.pt` checkpoints that are passed as `--fastpitch`
|
||||
and `--waveglow` arguments:
|
||||
```bash
|
||||
python inference.py --cuda --wn-channels 256 --amp-run \
|
||||
--fastpitch output/<FastPitch checkpoint> \
|
||||
--waveglow pretrained_models/waveglow/<waveglow checkpoint> \
|
||||
-i phrases/devset10.tsv \
|
||||
-o output/wavs_devset10
|
||||
```
|
||||
|
||||
The speech is generated from lines of text in the file that is passed with
|
||||
`-i` argument. To run
|
||||
inference in mixed precision, use the `--amp-run` flag. The output audio will
|
||||
be stored in the path specified by the `-o` argument. Consult the `inference.py` to learn more options, such as setting the batch size.
|
||||
|
||||
|
||||
## Advanced
|
||||
|
||||
The following sections provide greater details of the dataset, running training and inference, and the training results.
|
||||
|
||||
### Scripts and sample code
|
||||
|
||||
The repository holds code for FastPitch (training and inference) and WaveGlow (inference only).
|
||||
The code specific to a particular model is located in that model’s directory - `./fastpitch` and `./waveglow` - and common functions live in the `./common` directory. The model-specific scripts are as follows:
|
||||
|
||||
* `<model_name>/model.py` - the model architecture, definition of forward and
|
||||
inference functions
|
||||
* `<model_name>/arg_parser.py` - argument parser for parameters specific to a
|
||||
given model
|
||||
* `<model_name>/data_function.py` - data loading functions
|
||||
* `<model_name>/loss_function.py` - loss function for the model
|
||||
|
||||
The common scripts contain layer definitions common to both models
|
||||
(`common/layers.py`), some utility scripts (`common/utils.py`) and scripts
|
||||
for audio processing (`common/audio_processing.py` and `common/stft.py`).
|
||||
|
||||
In the root directory `./` of this repository, the `./train.py` script is used for
|
||||
training while inference can be executed with the `./inference.py` script. The
|
||||
scripts `./models.py`, `./data_functions.py` and `./loss_functions.py` call
|
||||
the respective scripts in the `<model_name>` directory, depending on what
|
||||
model is trained using the `train.py` script.
|
||||
|
||||
The structure of the repository follows closely to that of the [NVIDIA Tacotron2 Deep Learning example](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/SpeechSynthesis/Tacotron2). It allows to combine both models within a single project in more advanced use cases.
|
||||
|
||||
### Parameters
|
||||
|
||||
In this section, we list the most important hyperparameters and command-line arguments,
|
||||
together with their default values that are used to train FastPitch.
|
||||
|
||||
#### Training parameters
|
||||
|
||||
* `--epochs` - number of epochs (default: 1500)
|
||||
* `--learning-rate` - learning rate (default: 0.1)
|
||||
* `--batch-size` - batch size (default: 32)
|
||||
* `--amp-run` - use mixed precision training
|
||||
|
||||
#### Audio and STFT parameters
|
||||
|
||||
* `--sampling-rate` - sampling rate in Hz of input and output audio (22050)
|
||||
* `--filter-length` - (1024)
|
||||
* `--hop-length` - hop length for FFT, i.e., sample stride between consecutive FFTs (256)
|
||||
* `--win-length` - window size for FFT (1024)
|
||||
* `--mel-fmin` - lowest frequency in Hz (0.0)
|
||||
* `--mel-fmax` - highest frequency in Hz (8.000)
|
||||
|
||||
#### FastPitch parameters
|
||||
|
||||
* `--pitch-predictor-loss-scale` - rescale the loss of the pitch predictor module to dampen
|
||||
its influence on the shared encoder
|
||||
* `--duration-predictor-loss-scale` - rescale the loss of the duration predictor module to dampen
|
||||
its influence on the shared encoder
|
||||
* `--pitch` - enable pitch conditioning and prediction
|
||||
|
||||
### Command-line options
|
||||
|
||||
To see the full list of available options and their descriptions, use the `-h`
|
||||
or `--help` command line option, for example:
|
||||
```bash
|
||||
python train.py --help
|
||||
```
|
||||
|
||||
The following example output is printed when running the model:
|
||||
|
||||
```bash
|
||||
DLL 2020-03-30 10:41:12.562594 - epoch 1 | iter 1/19 | loss 36.99 | mel loss 35.25 | 142370.52 items/s | elapsed 2.50 s | lrate 1.00E-01 -> 3.16E-06
|
||||
DLL 2020-03-30 10:41:13.202835 - epoch 1 | iter 2/19 | loss 37.26 | mel loss 35.98 | 561459.27 items/s | elapsed 0.64 s | lrate 3.16E-06 -> 6.32E-06
|
||||
DLL 2020-03-30 10:41:13.831189 - epoch 1 | iter 3/19 | loss 36.93 | mel loss 35.41 | 583530.16 items/s | elapsed 0.63 s | lrate 6.32E-06 -> 9.49E-06
|
||||
```
|
||||
|
||||
### Getting the data
|
||||
|
||||
The FastPitch and WaveGlow models were trained on the LJSpeech-1.1 dataset.
|
||||
The `./scripts/download_dataset.sh` script will automatically download and extract the dataset to the `./LJSpeech-1.1` directory.
|
||||
|
||||
#### Dataset guidelines
|
||||
|
||||
The LJSpeech dataset has 13,100 clips that amount to about 24 hours of speech of a single, female speaker. Since the original dataset does not define a train/dev/test split of the data, we provide a split in the form of three file lists:
|
||||
```bash
|
||||
./filelists
|
||||
├── ljs_mel_ali_pitch_text_test_filelist.txt
|
||||
├── ljs_mel_ali_pitch_text_train_filelist.txt
|
||||
└── ljs_mel_ali_pitch_text_val_filelist.txt
|
||||
```
|
||||
|
||||
***NOTE: When combining FastPitch/WaveGlow with external models trained on LJSpeech-1.1, make sure that your train/dev/test split matches. Different organizations may use custom splits. A mismatch poses a risk of leaking the training data through model weights during validation and testing.***
|
||||
|
||||
FastPitch predicts character durations just like [FastSpeech](https://arxiv.org/abs/1905.09263) does.
|
||||
This calls for training with forced alignments, expressed as the number of output mel-spectrogram frames for every input character.
|
||||
To this end, a pre-trained
|
||||
[Tacotron 2 model](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/SpeechSynthesis/Tacotron2)
|
||||
is used. Its attention matrix
|
||||
relates the input characters with the output mel-spectrogram frames.
|
||||
|
||||
For every mel-spectrogram frame, its fundamental frequency in Hz is estimated with [Praat](http://praat.org).
|
||||
Those values are then averaged over every character, in order to provide sparse
|
||||
pitch cues for the model. Character boundaries are calculated from durations
|
||||
extracted previously with Tacotron 2.
|
||||
|
||||
<div style="text-align:center" align="center">
|
||||
<img src="./img/pitch.png" alt="Pitch estimates extracted with Praat" />
|
||||
<br>
|
||||
<em>Figure 2. Pitch estimates for mel-spectrogram frames of phrase "in being comparatively"
|
||||
averaged over characters. Silent letters have duration 0 and are omitted.</em>
|
||||
</div>
|
||||
|
||||
#### Multi-dataset
|
||||
|
||||
Follow these steps to use datasets different from the default LJSpeech dataset.
|
||||
|
||||
1. Prepare a directory with .wav files.
|
||||
```bash
|
||||
./my_dataset
|
||||
└── wavs
|
||||
```
|
||||
|
||||
2. Prepare filelists with transcripts and paths to .wav files. They define training/validation split of the data (test is currently unused):
|
||||
```
|
||||
./filelists
|
||||
├── my_dataset_mel_ali_pitch_text_train_filelist.txt
|
||||
└── my_dataset_mel_ali_pitch_text_val_filelist.txt
|
||||
```
|
||||
|
||||
Those filelists should list a single utterance per line as:
|
||||
```bash
|
||||
`<audio file path>|<transcript>`
|
||||
```
|
||||
The `<audio file path>` is the relative path to the path provided by the `--dataset-path` option of `train.py`.
|
||||
|
||||
3. Run the pre-processing script to calculate mel-spectrograms, durations and pitch:
|
||||
```bash
|
||||
python extract_mels.py --cuda \
|
||||
--dataset-path ./my_dataset \
|
||||
--wav-text-filelist ./filelists/my_dataset_mel_ali_pitch_text_train_filelist.txt \
|
||||
--extract-mels \
|
||||
--extract-durations \
|
||||
--extract-pitch-char \
|
||||
--tacotron2-checkpoint ./pretrained_models/tacotron2/state_dict.pt"
|
||||
|
||||
python extract_mels.py --cuda \
|
||||
--dataset-path ./my_dataset \
|
||||
--wav-text-filelist ./filelists/my_dataset_mel_ali_pitch_text_val_filelist.txt \
|
||||
--extract-mels \
|
||||
--extract-durations \
|
||||
--extract-pitch-char \
|
||||
--tacotron2-checkpoint ./pretrained_models/tacotron2/state_dict.pt"
|
||||
```
|
||||
|
||||
In order to use the prepared dataset, pass the following to the `train.py` script:
|
||||
```bash
|
||||
--dataset-path ./my_dataset` \
|
||||
--training-files ./filelists/my_dataset_mel_ali_pitch_text_train_filelist.txt \
|
||||
--validation files ./filelists/my_dataset_mel_ali_pitch_text_val_filelist.txt
|
||||
```
|
||||
|
||||
### Training process
|
||||
|
||||
FastPitch is trained to generate mel-spectrograms from raw text input. It uses short time Fourier transform (STFT)
|
||||
to generate target mel-spectrograms from audio waveforms to be the training targets.
|
||||
|
||||
The training loss is averaged over an entire training epoch, whereas the
|
||||
validation loss is averaged over the validation dataset. Performance is
|
||||
reported in total output mel-spectrogram frames per second and recorded as `train_frames/s` (after each iteration) and `avg_train_frames/s` (averaged over epoch) in the output log file `./output/nvlog.json`.
|
||||
The result is averaged over an entire training epoch and summed over all GPUs that were
|
||||
included in the training.
|
||||
|
||||
Even though the training script uses all available GPUs, you can change
|
||||
this behavior by setting the `CUDA_VISIBLE_DEVICES` variable in your
|
||||
environment or by setting the `NV_GPU` variable at the Docker container launch
|
||||
([see section "GPU isolation"](https://github.com/NVIDIA/nvidia-docker/wiki/nvidia-docker#gpu-isolation)).
|
||||
|
||||
### Inference process
|
||||
|
||||
You can run inference using the `./inference.py` script. This script takes
|
||||
text as input and runs FastPitch and then WaveGlow inference to produce an
|
||||
audio file. It requires pre-trained checkpoints of both models
|
||||
and input text as a text file, with one phrase per line.
|
||||
|
||||
Having pre-trained models in place, run the sample inference on LJSpeech-1.1 test-set with:
|
||||
```bash
|
||||
bash scripts/inference_example.sh
|
||||
```
|
||||
Examine the `inference_examples.sh` script to adjust paths to pre-trained models,
|
||||
and call `python inference.py --help` to learn all available options.
|
||||
Synthesized audio samples will be saved in the output folder.
|
||||
The audio files
|
||||
<a href="./audio/audio_fp16.wav">audio/audio_fp16.wav</a>
|
||||
and <a href="./audio/audio_fp32.wav">audio/audio_fp32.wav</a> were generated using checkpoints from
|
||||
mixed precision and FP32 training, respectively.
|
||||
The audio files
|
||||
<audio src="./audio/audio_fp16.wav"”/>
|
||||
and <audio src="./audio/audio_fp32.wav"/> were generated using checkpoints from
|
||||
mixed precision and FP32 training, respectively.
|
||||
|
||||
FastPitch allows us to linearly adjust the pace of synthesized speech like [FastSpeech](https://arxiv.org/abs/1905.09263).
|
||||
For instance, pass `--pace 0.5` to slow down twice.
|
||||
|
||||
For every input character, the model predicts a pitch cue - an average pitch over a character in Hz.
|
||||
Pitch can be adjusted by transforming those pitch cues. A few simple examples are provided below.
|
||||
|
||||
| Transformation | Flag | Samples |
|
||||
| :---------------------------------|:------------------------------|:---------:|
|
||||
| Amplify pitch |`--pitch-transform-amplify` | [link](./audio/sample_fp16_amplify.wav) |
|
||||
| Invert pitch |`--pitch-transform-invert` | [link](./audio/sample_fp16_invert.wav) |
|
||||
| Raise/lower pitch by <hz> |`--pitch-transform-shift <hz>` | [link](./audio/sample_fp16_shift.wav) |
|
||||
| Flatten the pitch |`--pitch-transform-flatten` | [link](./audio/sample_fp16_flatten.wav) |
|
||||
| Change the pace (1.0 = unchanged) |`--pace <value>` | [link](./audio/sample_fp16_pace.wav) |
|
||||
|
||||
Modify these examples directly in `inference.py` to achieve more interesting results.
|
||||
|
||||
You can find all the available options by calling `python inference.py --help`.
|
||||
|
||||
|
||||
## Performance
|
||||
|
||||
### Benchmarking
|
||||
|
||||
The following section shows how to run benchmarks measuring the model
|
||||
performance in training and inference mode.
|
||||
|
||||
#### Training performance benchmark
|
||||
|
||||
To benchmark the training performance on a specific batch size, run:
|
||||
|
||||
**FastPitch**
|
||||
|
||||
* For 1 GPU
|
||||
* FP16
|
||||
```bash
|
||||
python train.py \
|
||||
--amp-run \
|
||||
--cuda \
|
||||
--cudnn-enabled \
|
||||
-o <output-dir> \
|
||||
--log-file <output-dir>/nvlog.json \
|
||||
--dataset-path <dataset-path> \
|
||||
--training-files <train-filelist-path> \
|
||||
--validation-files <val-filelist-path> \
|
||||
--pitch-mean-std <pitch-stats-path> \
|
||||
--load-mel-from-disk \
|
||||
--epochs 10 \
|
||||
--warmup-steps 1000 \
|
||||
-lr 0.1 \
|
||||
-bs 64 \
|
||||
--optimizer lamb \
|
||||
--grad-clip-thresh 1000.0 \
|
||||
--dur-predictor-loss-scale 0.1 \
|
||||
--pitch-predictor-loss-scale 0.1 \
|
||||
--weight-decay 1e-6 \
|
||||
--gradient-accumulation-steps 4
|
||||
```
|
||||
|
||||
* FP32
|
||||
```bash
|
||||
python train.py \
|
||||
--cuda \
|
||||
--cudnn-enabled \
|
||||
-o <output-dir> \
|
||||
--log-file <output-dir>/nvlog.json \
|
||||
--dataset-path <dataset-path> \
|
||||
--training-files <train-filelist-path> \
|
||||
--validation-files <val-filelist-path> \
|
||||
--pitch-mean-std <pitch-stats-path> \
|
||||
--load-mel-from-disk \
|
||||
--epochs 10 \
|
||||
--warmup-steps 1000 \
|
||||
-lr 0.1 \
|
||||
-bs 32 \
|
||||
--optimizer lamb \
|
||||
--grad-clip-thresh 1000.0 \
|
||||
--dur-predictor-loss-scale 0.1 \
|
||||
--pitch-predictor-loss-scale 0.1 \
|
||||
--weight-decay 1e-6 \
|
||||
--gradient-accumulation-steps 8
|
||||
```
|
||||
|
||||
* For multiple GPUs
|
||||
* FP16
|
||||
```bash
|
||||
python -m multiproc train.py \
|
||||
--amp-run \
|
||||
--cuda \
|
||||
--cudnn-enabled \
|
||||
-o <output-dir> \
|
||||
--log-file <output-dir>/nvlog.json \
|
||||
--dataset-path <dataset-path> \
|
||||
--training-files <train-filelist-path> \
|
||||
--validation-files <val-filelist-path> \
|
||||
--pitch-mean-std <pitch-stats-path> \
|
||||
--load-mel-from-disk \
|
||||
--epochs 10 \
|
||||
--warmup-steps 1000 \
|
||||
-lr 0.1 \
|
||||
-bs 32 \
|
||||
--optimizer lamb \
|
||||
--grad-clip-thresh 1000.0 \
|
||||
--dur-predictor-loss-scale 0.1 \
|
||||
--pitch-predictor-loss-scale 0.1 \
|
||||
--weight-decay 1e-6 \
|
||||
--gradient-accumulation-steps 1
|
||||
```
|
||||
|
||||
* FP32
|
||||
```bash
|
||||
python -m multiproc train.py \
|
||||
--cuda \
|
||||
--cudnn-enabled \
|
||||
-o <output-dir> \
|
||||
--log-file <output-dir>/nvlog.json \
|
||||
--dataset-path <dataset-path> \
|
||||
--training-files <train-filelist-path> \
|
||||
--validation-files <val-filelist-path> \
|
||||
--pitch-mean-std <pitch-stats-path> \
|
||||
--load-mel-from-disk \
|
||||
--epochs 10 \
|
||||
--warmup-steps 1000 \
|
||||
-lr 0.1 \
|
||||
-bs 32 \
|
||||
--optimizer lamb \
|
||||
--grad-clip-thresh 1000.0 \
|
||||
--dur-predictor-loss-scale 0.1 \
|
||||
--pitch-predictor-loss-scale 0.1 \
|
||||
--weight-decay 1e-6 \
|
||||
--gradient-accumulation-steps 1
|
||||
```
|
||||
|
||||
Each of these scripts runs for 10 epochs and for each epoch measures the
|
||||
average number of items per second. The performance results can be read from
|
||||
the `nvlog.json` files produced by the commands.
|
||||
|
||||
#### Inference performance benchmark
|
||||
|
||||
To benchmark the inference performance, run:
|
||||
|
||||
* For FP16
|
||||
```
|
||||
python inference.py --cuda --amp-run \
|
||||
--fastpitch output/checkpoint_FastPitch_1500.pt \
|
||||
--waveglow pretrained_models/waveglow/waveglow_256channels_ljs_v2.pt \
|
||||
--wn-channels 256 \
|
||||
--include-warmup \
|
||||
--batch-size 1 \
|
||||
--repeats 100 \
|
||||
--input phrases/benchmark_8_128.tsv \
|
||||
--log_file output/nvlog_inference.json
|
||||
```
|
||||
|
||||
* For FP32
|
||||
```
|
||||
python inference.py --cuda \
|
||||
--fastpitch output/checkpoint_FastPitch_1500.pt \
|
||||
--waveglow pretrained_models/waveglow/waveglow_256channels_ljs_v2.pt \
|
||||
--wn-channels 256 \
|
||||
--include-warmup \
|
||||
--batch-size 1 \
|
||||
--pitch \
|
||||
--repeats 100 \
|
||||
--input phrases/benchmark_8_128.tsv \
|
||||
--log_file output/nvlog_inference.json
|
||||
```
|
||||
|
||||
The output log files will contain performance numbers for the FastPitch model
|
||||
(number of output mel-spectrogram frames per second, reported as `generator_frames/s
|
||||
`)
|
||||
and for WaveGlow (number of output samples per second, reported as ` waveglow_samples/s
|
||||
`).
|
||||
The `inference.py` script will run a few warm-up iterations before running the benchmark. Inference will be averaged over 100 runs, as set by the `--repeats` flag.
|
||||
|
||||
### Results
|
||||
|
||||
The following sections provide details on how we achieved our performance
|
||||
and accuracy in training and inference.
|
||||
|
||||
#### Training accuracy results
|
||||
|
||||
##### Training accuracy: NVIDIA DGX-1 (8x V100 16G)
|
||||
|
||||
Our results were obtained by running the `./platform/train_fastpitch_{AMP,FP32}_DGX1_16GB_8GPU.sh` training script in the PyTorch 20.03-py3 NGC container on NVIDIA DGX-1 with 8x V100 16G GPUs.
|
||||
|
||||
All of the results were produced using the `train.py` script as described in the
|
||||
[Training process](#training-process) section of this document.
|
||||
|
||||
| Loss (Model/Epoch) | 0 | 250 | 500 | 750 | 1000 | 1250 | 1500 |
|
||||
| :------------------: | -----: | ----: | ----: | ----: | -----: | -----: | -----: |
|
||||
| FastPitch FP16 | 35.839 | 0.491 | 0.339 | 0.29 | 0.265 | 0.249 | 0.239 |
|
||||
| FastPitch FP32 | 34.781 | 0.497 | 0.340 | 0.292 | 0.266 | 0.250 | 0.239 |
|
||||
|
||||
##### Training stability test
|
||||
|
||||
#### Training performance results
|
||||
|
||||
##### Training performance: NVIDIA DGX-1 (8x V100 16G)
|
||||
|
||||
Our results were obtained by running the `./platform/train_fastpitch_{AMP,FP32}_DGX1_16GB_8GPU.sh`
|
||||
training script in the PyTorch 20.03-py3 NGC container on NVIDIA DGX-1 with
|
||||
8x V100 16G GPUs. Performance numbers, in output mel-spectrograms per second, were averaged over
|
||||
an entire training epoch.
|
||||
|
||||
|Number of GPUs|Batch size per GPU|Number of mels used with mixed precision|Number of mels used with FP32|Speed-up with mixed precision|Multi-GPU strong scaling with mixed precision|Multi-GPU strong scaling with FP32|
|
||||
|---:|----------------:|-------:|-------:|-----:|-----:|-----:|
|
||||
| 1 |64@FP16, 32@FP32 | 109769 | 40636 | 2.70 | 1.00 | 1.00 |
|
||||
| 4 |64@FP16, 32@FP32 | 361195 | 150921 | 2.39 | 3.29 | 3.71 |
|
||||
| 8 |32@FP16, 32@FP32 | 562136 | 278778 | 2.02 | 5.12 | 6.86 |
|
||||
|
||||
To achieve these same results, follow the steps in the [Quick Start Guide](#quick-start-guide).
|
||||
|
||||
##### Expected training time
|
||||
|
||||
The following table shows the expected training time for convergence for 1500 epochs:
|
||||
|
||||
|Number of GPUs|Batch size per GPU|Time to train with mixed precision (Hrs)|Time to train with FP32 (Hrs)|Speed-up with mixed precision|
|
||||
|---:|----------------:|-----:|-----:|-----:|
|
||||
| 1 |64@FP16, 32@FP32 | 27.0 | 73.7 | 2.73 |
|
||||
| 4 |64@FP16, 32@FP32 | 8.4 | 19.7 | 2.36 |
|
||||
| 8 |32@FP16, 32@FP32 | 5.5 | 10.8 | 1.97 |
|
||||
|
||||
|
||||
Note that most of the quality is achieved after the initial 500 epochs.
|
||||
|
||||
#### Inference performance results
|
||||
|
||||
The following tables show inference statistics for the FastPitch and WaveGlow
|
||||
text-to-speech system, gathered from 1000 inference runs, on a single V100 and a single T4,
|
||||
respectively. Latency is measured from the start of FastPitch inference to
|
||||
the end of WaveGlow inference. Throughput is measured
|
||||
as the number of generated audio samples per second at 22KHz. RTF is the real-time factor
|
||||
which tells how many seconds of speech are generated in 1 second of wall-clock time.
|
||||
The used WaveGlow model is a 256-channel model [published on NGC](https://ngc.nvidia.com/catalog/models/nvidia:waveglow_ljs_256channels).
|
||||
|
||||
Our results were obtained by running the `./scripts/inference_benchmark.sh` script in
|
||||
the PyTorch 20.03-py3 NGC container. Note that to reproduce the results,
|
||||
you need to provide pre-trained checkpoints for FastPitch and WaveGlow. Edit the script to provide your checkpoint filenames.
|
||||
|
||||
Note that performance numbers are related to the length of input. The numbers reported below were taken with a moderate length of 128 characters. For longer utterances even better numbers are expected, as the generator is fully parallel.
|
||||
|
||||
##### Inference performance: NVIDIA DGX-1 (1x V100 16G)
|
||||
|
||||
The input utterance has 128 characters, synthesized audio has 8.05 s.
|
||||
|
||||
|Batch size|Precision|Avg latency (s)|Latency tolerance interval 90% (s)|Latency tolerance interval 95% (s)|Latency tolerance interval 99% (s)|Throughput (samples/sec)|Speed-up with mixed precision|Avg RTF|
|
||||
|------:|------------:|--------------:|--------------:|--------------:|--------------:|----------------:|---------------:|----------:|
|
||||
| 1 | FP16 | 0.253 | 0.254 | 0.255 | 0.255 | 702,735 | 1.51 | 31.87 |
|
||||
| 4 | FP16 | 0.572 | 0.575 | 0.575 | 0.576 | 1,243,094 | 2.55 | 14.09 |
|
||||
| 8 | FP16 | 1.118 | 1.121 | 1.121 | 1.123 | 1,269,479 | 2.70 | 7.20 |
|
||||
| 1 | FP32 | 0.382 | 0.384 | 0.384 | 0.385 | 464,920 | - | 21.08 |
|
||||
| 4 | FP32 | 1.458 | 1.461 | 1.461 | 1.462 | 486,756 | - | 5.52 |
|
||||
| 8 | FP32 | 3.015 | 3.023 | 3.024 | 3.027 | 470,741 | - | 2.67 |
|
||||
|
||||
|
||||
##### Inference performance: NVIDIA T4
|
||||
|
||||
The input utterance has 128 characters, synthesized audio has 8.05 s.
|
||||
|
||||
|Batch size|Precision|Avg latency (s)|Latency tolerance interval 90% (s)|Latency tolerance interval 95% (s)|Latency tolerance interval 99% (s)|Throughput (samples/sec)|Speed-up with mixed precision|Avg RTF|
|
||||
|------:|------------:|--------------:|--------------:|--------------:|--------------:|----------------:|---------------:|----------:|
|
||||
| 1 | FP16 | 0.952 | 0.958 | 0.960 | 0.962 | 186,349 | 1.30 | 8.45 |
|
||||
| 4 | FP16 | 4.187 | 4.209 | 4.213 | 4.221 | 169,473 | 1.21 | 1.92 |
|
||||
| 8 | FP16 | 7.799 | 7.824 | 7.829 | 7.839 | 181,978 | 1.38 | 1.03 |
|
||||
| 1 | FP32 | 1.238 | 1.245 | 1.247 | 1.250 | 143,292 | - | 6.50 |
|
||||
| 4 | FP32 | 5.083 | 5.109 | 5.114 | 5.124 | 139,613 | - | 1.58 |
|
||||
| 8 | FP32 | 10.756 | 10.797 | 10.805 | 10.820 | 131,951 | - | 0.75 |
|
||||
|
||||
|
||||
## Release notes
|
||||
|
||||
### Changelog
|
||||
|
||||
May 2020
|
||||
- Initial release
|
||||
|
||||
### Known issues
|
||||
|
||||
There are no known issues in this release.
|
BIN
PyTorch/SpeechSynthesis/FastPitch/audio/sample_fp16.wav
Normal file
BIN
PyTorch/SpeechSynthesis/FastPitch/audio/sample_fp16.wav
Normal file
Binary file not shown.
BIN
PyTorch/SpeechSynthesis/FastPitch/audio/sample_fp16_amplify.wav
Normal file
BIN
PyTorch/SpeechSynthesis/FastPitch/audio/sample_fp16_amplify.wav
Normal file
Binary file not shown.
BIN
PyTorch/SpeechSynthesis/FastPitch/audio/sample_fp16_flatten.wav
Normal file
BIN
PyTorch/SpeechSynthesis/FastPitch/audio/sample_fp16_flatten.wav
Normal file
Binary file not shown.
BIN
PyTorch/SpeechSynthesis/FastPitch/audio/sample_fp16_invert.wav
Normal file
BIN
PyTorch/SpeechSynthesis/FastPitch/audio/sample_fp16_invert.wav
Normal file
Binary file not shown.
BIN
PyTorch/SpeechSynthesis/FastPitch/audio/sample_fp16_pace.wav
Normal file
BIN
PyTorch/SpeechSynthesis/FastPitch/audio/sample_fp16_pace.wav
Normal file
Binary file not shown.
BIN
PyTorch/SpeechSynthesis/FastPitch/audio/sample_fp16_shift.wav
Normal file
BIN
PyTorch/SpeechSynthesis/FastPitch/audio/sample_fp16_shift.wav
Normal file
Binary file not shown.
BIN
PyTorch/SpeechSynthesis/FastPitch/audio/sample_fp32.wav
Normal file
BIN
PyTorch/SpeechSynthesis/FastPitch/audio/sample_fp32.wav
Normal file
Binary file not shown.
120
PyTorch/SpeechSynthesis/FastPitch/common/audio_processing.py
Normal file
120
PyTorch/SpeechSynthesis/FastPitch/common/audio_processing.py
Normal file
|
@ -0,0 +1,120 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
import torch
|
||||
import numpy as np
|
||||
from scipy.signal import get_window
|
||||
import librosa.util as librosa_util
|
||||
|
||||
|
||||
def window_sumsquare(window, n_frames, hop_length=200, win_length=800,
|
||||
n_fft=800, dtype=np.float32, norm=None):
|
||||
"""
|
||||
# from librosa 0.6
|
||||
Compute the sum-square envelope of a window function at a given hop length.
|
||||
|
||||
This is used to estimate modulation effects induced by windowing
|
||||
observations in short-time fourier transforms.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
window : string, tuple, number, callable, or list-like
|
||||
Window specification, as in `get_window`
|
||||
|
||||
n_frames : int > 0
|
||||
The number of analysis frames
|
||||
|
||||
hop_length : int > 0
|
||||
The number of samples to advance between frames
|
||||
|
||||
win_length : [optional]
|
||||
The length of the window function. By default, this matches `n_fft`.
|
||||
|
||||
n_fft : int > 0
|
||||
The length of each analysis frame.
|
||||
|
||||
dtype : np.dtype
|
||||
The data type of the output
|
||||
|
||||
Returns
|
||||
-------
|
||||
wss : np.ndarray, shape=`(n_fft + hop_length * (n_frames - 1))`
|
||||
The sum-squared envelope of the window function
|
||||
"""
|
||||
if win_length is None:
|
||||
win_length = n_fft
|
||||
|
||||
n = n_fft + hop_length * (n_frames - 1)
|
||||
x = np.zeros(n, dtype=dtype)
|
||||
|
||||
# Compute the squared window at the desired length
|
||||
win_sq = get_window(window, win_length, fftbins=True)
|
||||
win_sq = librosa_util.normalize(win_sq, norm=norm)**2
|
||||
win_sq = librosa_util.pad_center(win_sq, n_fft)
|
||||
|
||||
# Fill the envelope
|
||||
for i in range(n_frames):
|
||||
sample = i * hop_length
|
||||
x[sample:min(n, sample + n_fft)] += win_sq[:max(0, min(n_fft, n - sample))]
|
||||
return x
|
||||
|
||||
|
||||
def griffin_lim(magnitudes, stft_fn, n_iters=30):
|
||||
"""
|
||||
PARAMS
|
||||
------
|
||||
magnitudes: spectrogram magnitudes
|
||||
stft_fn: STFT class with transform (STFT) and inverse (ISTFT) methods
|
||||
"""
|
||||
|
||||
angles = np.angle(np.exp(2j * np.pi * np.random.rand(*magnitudes.size())))
|
||||
angles = angles.astype(np.float32)
|
||||
angles = torch.autograd.Variable(torch.from_numpy(angles))
|
||||
signal = stft_fn.inverse(magnitudes, angles).squeeze(1)
|
||||
|
||||
for i in range(n_iters):
|
||||
_, angles = stft_fn.transform(signal)
|
||||
signal = stft_fn.inverse(magnitudes, angles).squeeze(1)
|
||||
return signal
|
||||
|
||||
|
||||
def dynamic_range_compression(x, C=1, clip_val=1e-5):
|
||||
"""
|
||||
PARAMS
|
||||
------
|
||||
C: compression factor
|
||||
"""
|
||||
return torch.log(torch.clamp(x, min=clip_val) * C)
|
||||
|
||||
|
||||
def dynamic_range_decompression(x, C=1):
|
||||
"""
|
||||
PARAMS
|
||||
------
|
||||
C: compression factor used to compress
|
||||
"""
|
||||
return torch.exp(x) / C
|
126
PyTorch/SpeechSynthesis/FastPitch/common/layers.py
Normal file
126
PyTorch/SpeechSynthesis/FastPitch/common/layers.py
Normal file
|
@ -0,0 +1,126 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
import torch
|
||||
import torch.nn.functional as F
|
||||
from librosa.filters import mel as librosa_mel_fn
|
||||
from common.audio_processing import dynamic_range_compression, dynamic_range_decompression
|
||||
from common.stft import STFT
|
||||
|
||||
|
||||
class LinearNorm(torch.nn.Module):
|
||||
def __init__(self, in_dim, out_dim, bias=True, w_init_gain='linear'):
|
||||
super(LinearNorm, self).__init__()
|
||||
self.linear_layer = torch.nn.Linear(in_dim, out_dim, bias=bias)
|
||||
|
||||
torch.nn.init.xavier_uniform_(
|
||||
self.linear_layer.weight,
|
||||
gain=torch.nn.init.calculate_gain(w_init_gain))
|
||||
|
||||
def forward(self, x):
|
||||
return self.linear_layer(x)
|
||||
|
||||
|
||||
class ConvNorm(torch.nn.Module):
|
||||
def __init__(self, in_channels, out_channels, kernel_size=1, stride=1,
|
||||
padding=None, dilation=1, bias=True, w_init_gain='linear', batch_norm=False):
|
||||
super(ConvNorm, self).__init__()
|
||||
if padding is None:
|
||||
assert(kernel_size % 2 == 1)
|
||||
padding = int(dilation * (kernel_size - 1) / 2)
|
||||
|
||||
self.conv = torch.nn.Conv1d(in_channels, out_channels,
|
||||
kernel_size=kernel_size, stride=stride,
|
||||
padding=padding, dilation=dilation,
|
||||
bias=bias)
|
||||
self.norm = torch.nn.BatchNorm1D(out_channels) if batch_norm else None
|
||||
|
||||
torch.nn.init.xavier_uniform_(
|
||||
self.conv.weight,
|
||||
gain=torch.nn.init.calculate_gain(w_init_gain))
|
||||
|
||||
def forward(self, signal):
|
||||
if self.norm is None:
|
||||
return self.conv(signal)
|
||||
else:
|
||||
return self.norm(self.conv(signal))
|
||||
|
||||
|
||||
class ConvReLUNorm(torch.nn.Module):
|
||||
def __init__(self, in_channels, out_channels, kernel_size=1, dropout=0.0):
|
||||
super(ConvReLUNorm, self).__init__()
|
||||
self.conv = torch.nn.Conv1d(in_channels, out_channels,
|
||||
kernel_size=kernel_size,
|
||||
padding=(kernel_size // 2))
|
||||
self.norm = torch.nn.LayerNorm(out_channels)
|
||||
self.dropout = torch.nn.Dropout(dropout)
|
||||
|
||||
def forward(self, signal):
|
||||
out = F.relu(self.conv(signal))
|
||||
out = self.norm(out.transpose(1, 2)).transpose(1, 2)
|
||||
return self.dropout(out)
|
||||
|
||||
|
||||
class TacotronSTFT(torch.nn.Module):
|
||||
def __init__(self, filter_length=1024, hop_length=256, win_length=1024,
|
||||
n_mel_channels=80, sampling_rate=22050, mel_fmin=0.0,
|
||||
mel_fmax=8000.0):
|
||||
super(TacotronSTFT, self).__init__()
|
||||
self.n_mel_channels = n_mel_channels
|
||||
self.sampling_rate = sampling_rate
|
||||
self.stft_fn = STFT(filter_length, hop_length, win_length)
|
||||
mel_basis = librosa_mel_fn(
|
||||
sampling_rate, filter_length, n_mel_channels, mel_fmin, mel_fmax)
|
||||
mel_basis = torch.from_numpy(mel_basis).float()
|
||||
self.register_buffer('mel_basis', mel_basis)
|
||||
|
||||
def spectral_normalize(self, magnitudes):
|
||||
output = dynamic_range_compression(magnitudes)
|
||||
return output
|
||||
|
||||
def spectral_de_normalize(self, magnitudes):
|
||||
output = dynamic_range_decompression(magnitudes)
|
||||
return output
|
||||
|
||||
def mel_spectrogram(self, y):
|
||||
"""Computes mel-spectrograms from a batch of waves
|
||||
PARAMS
|
||||
------
|
||||
y: Variable(torch.FloatTensor) with shape (B, T) in range [-1, 1]
|
||||
|
||||
RETURNS
|
||||
-------
|
||||
mel_output: torch.FloatTensor of shape (B, n_mel_channels, T)
|
||||
"""
|
||||
assert(torch.min(y.data) >= -1)
|
||||
assert(torch.max(y.data) <= 1)
|
||||
|
||||
magnitudes, phases = self.stft_fn.transform(y)
|
||||
magnitudes = magnitudes.data
|
||||
mel_output = torch.matmul(self.mel_basis, magnitudes)
|
||||
mel_output = self.spectral_normalize(mel_output)
|
||||
return mel_output
|
106
PyTorch/SpeechSynthesis/FastPitch/common/log_helper.py
Normal file
106
PyTorch/SpeechSynthesis/FastPitch/common/log_helper.py
Normal file
|
@ -0,0 +1,106 @@
|
|||
import atexit
|
||||
import os
|
||||
import numpy as np
|
||||
|
||||
from tensorboardX import SummaryWriter
|
||||
|
||||
import dllogger as DLLogger
|
||||
from dllogger import StdOutBackend, JSONStreamBackend, Verbosity
|
||||
|
||||
|
||||
def stdout_step_format(step):
|
||||
if isinstance(step, str):
|
||||
return step
|
||||
fields = []
|
||||
if len(step) > 0:
|
||||
fields.append("epoch {:>4}".format(step[0]))
|
||||
if len(step) > 1:
|
||||
fields.append("iter {:>3}".format(step[1]))
|
||||
if len(step) > 2:
|
||||
fields[-1] += "/{}".format(step[2])
|
||||
return " | ".join(fields)
|
||||
|
||||
|
||||
def stdout_metric_format(metric, metadata, value):
|
||||
name = metadata["name"] if "name" in metadata.keys() else metric + " : "
|
||||
unit = metadata["unit"] if "unit" in metadata.keys() else None
|
||||
format = "{" + metadata["format"] + "}" if "format" in metadata.keys() else "{}"
|
||||
fields = [name, format.format(value) if value is not None else value, unit]
|
||||
fields = filter(lambda f: f is not None, fields)
|
||||
return "| " + " ".join(fields)
|
||||
|
||||
|
||||
def init_dllogger(log_fpath=None, dummy=False):
|
||||
if dummy:
|
||||
DLLogger.init(backends=[])
|
||||
return
|
||||
DLLogger.init(backends=[
|
||||
JSONStreamBackend(Verbosity.DEFAULT, log_fpath),
|
||||
StdOutBackend(Verbosity.VERBOSE, step_format=stdout_step_format,
|
||||
metric_format=stdout_metric_format)
|
||||
]
|
||||
)
|
||||
DLLogger.metadata("train_loss", {"name": "loss", "format": ":>5.2f"})
|
||||
DLLogger.metadata("train_mel_loss", {"name": "mel loss", "format": ":>5.2f"})
|
||||
DLLogger.metadata("avg_train_loss", {"name": "avg train loss", "format": ":>5.2f"})
|
||||
DLLogger.metadata("avg_train_mel_loss", {"name": "avg train mel loss", "format": ":>5.2f"})
|
||||
DLLogger.metadata("val_loss", {"name": " avg val loss", "format": ":>5.2f"})
|
||||
DLLogger.metadata("val_mel_loss", {"name": " avg val mel loss", "format": ":>5.2f"})
|
||||
DLLogger.metadata(
|
||||
"val_ema_loss",
|
||||
{"name": " EMA val loss", "format": ":>5.2f"})
|
||||
DLLogger.metadata(
|
||||
"val_ema_mel_loss",
|
||||
{"name": " EMA val mel loss", "format": ":>5.2f"})
|
||||
DLLogger.metadata(
|
||||
"train_frames/s", {"name": None, "unit": "frames/s", "format": ":>10.2f"})
|
||||
DLLogger.metadata(
|
||||
"avg_train_frames/s", {"name": None, "unit": "frames/s", "format": ":>10.2f"})
|
||||
DLLogger.metadata(
|
||||
"val_frames/s", {"name": None, "unit": "frames/s", "format": ":>10.2f"})
|
||||
DLLogger.metadata(
|
||||
"val_ema_frames/s", {"name": None, "unit": "frames/s", "format": ":>10.2f"})
|
||||
DLLogger.metadata(
|
||||
"took", {"name": "took", "unit": "s", "format": ":>3.2f"})
|
||||
DLLogger.metadata("lrate_change", {"name": "lrate"})
|
||||
|
||||
|
||||
class TBLogger(object):
|
||||
"""
|
||||
xyz_dummies: stretch the screen with empty plots so the legend would
|
||||
always fit for other plots
|
||||
"""
|
||||
def __init__(self, local_rank, log_dir, name, interval=1, dummies=False):
|
||||
self.enabled = (local_rank == 0)
|
||||
self.interval = interval
|
||||
self.cache = {}
|
||||
if local_rank == 0:
|
||||
self.summary_writer = SummaryWriter(
|
||||
log_dir=os.path.join(log_dir, name),
|
||||
flush_secs=120, max_queue=200)
|
||||
atexit.register(self.summary_writer.close)
|
||||
if dummies:
|
||||
for key in ('aaa', 'zzz'):
|
||||
self.summary_writer.add_scalar(key, 0.0, 1)
|
||||
|
||||
def log_value(self, step, key, val, stat='mean'):
|
||||
if self.enabled:
|
||||
if key not in self.cache:
|
||||
self.cache[key] = []
|
||||
self.cache[key].append(val)
|
||||
if len(self.cache[key]) == self.interval:
|
||||
agg_val = getattr(np, stat)(self.cache[key])
|
||||
self.summary_writer.add_scalar(key, agg_val, step)
|
||||
del self.cache[key]
|
||||
|
||||
def log_meta(self, step, meta):
|
||||
for k, v in meta.items():
|
||||
self.log_value(step, k, v.item())
|
||||
|
||||
def log_grads(self, step, model):
|
||||
if self.enabled:
|
||||
norms = [p.grad.norm().item() for p in model.parameters()
|
||||
if p.grad is not None]
|
||||
for stat in ('max', 'min', 'mean'):
|
||||
self.log_value(step, f'grad_{stat}', getattr(np, stat)(norms),
|
||||
stat=stat)
|
141
PyTorch/SpeechSynthesis/FastPitch/common/stft.py
Normal file
141
PyTorch/SpeechSynthesis/FastPitch/common/stft.py
Normal file
|
@ -0,0 +1,141 @@
|
|||
"""
|
||||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2017, Prem Seetharaman
|
||||
All rights reserved.
|
||||
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this
|
||||
list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
"""
|
||||
|
||||
import torch
|
||||
import numpy as np
|
||||
import torch.nn.functional as F
|
||||
from torch.autograd import Variable
|
||||
from scipy.signal import get_window
|
||||
from librosa.util import pad_center, tiny
|
||||
from common.audio_processing import window_sumsquare
|
||||
|
||||
|
||||
class STFT(torch.nn.Module):
|
||||
"""adapted from Prem Seetharaman's https://github.com/pseeth/pytorch-stft"""
|
||||
def __init__(self, filter_length=800, hop_length=200, win_length=800,
|
||||
window='hann'):
|
||||
super(STFT, self).__init__()
|
||||
self.filter_length = filter_length
|
||||
self.hop_length = hop_length
|
||||
self.win_length = win_length
|
||||
self.window = window
|
||||
self.forward_transform = None
|
||||
scale = self.filter_length / self.hop_length
|
||||
fourier_basis = np.fft.fft(np.eye(self.filter_length))
|
||||
|
||||
cutoff = int((self.filter_length / 2 + 1))
|
||||
fourier_basis = np.vstack([np.real(fourier_basis[:cutoff, :]),
|
||||
np.imag(fourier_basis[:cutoff, :])])
|
||||
|
||||
forward_basis = torch.FloatTensor(fourier_basis[:, None, :])
|
||||
inverse_basis = torch.FloatTensor(
|
||||
np.linalg.pinv(scale * fourier_basis).T[:, None, :].copy())
|
||||
|
||||
if window is not None:
|
||||
assert(filter_length >= win_length)
|
||||
# get window and zero center pad it to filter_length
|
||||
fft_window = get_window(window, win_length, fftbins=True)
|
||||
fft_window = pad_center(fft_window, filter_length)
|
||||
fft_window = torch.from_numpy(fft_window).float()
|
||||
|
||||
# window the bases
|
||||
forward_basis *= fft_window
|
||||
inverse_basis *= fft_window
|
||||
|
||||
self.register_buffer('forward_basis', forward_basis.float())
|
||||
self.register_buffer('inverse_basis', inverse_basis.float())
|
||||
|
||||
def transform(self, input_data):
|
||||
num_batches = input_data.size(0)
|
||||
num_samples = input_data.size(1)
|
||||
|
||||
self.num_samples = num_samples
|
||||
|
||||
# similar to librosa, reflect-pad the input
|
||||
input_data = input_data.view(num_batches, 1, num_samples)
|
||||
input_data = F.pad(
|
||||
input_data.unsqueeze(1),
|
||||
(int(self.filter_length / 2), int(self.filter_length / 2), 0, 0),
|
||||
mode='reflect')
|
||||
input_data = input_data.squeeze(1)
|
||||
|
||||
forward_transform = F.conv1d(
|
||||
input_data,
|
||||
Variable(self.forward_basis, requires_grad=False),
|
||||
stride=self.hop_length,
|
||||
padding=0)
|
||||
|
||||
cutoff = int((self.filter_length / 2) + 1)
|
||||
real_part = forward_transform[:, :cutoff, :]
|
||||
imag_part = forward_transform[:, cutoff:, :]
|
||||
|
||||
magnitude = torch.sqrt(real_part**2 + imag_part**2)
|
||||
phase = torch.autograd.Variable(
|
||||
torch.atan2(imag_part.data, real_part.data))
|
||||
|
||||
return magnitude, phase
|
||||
|
||||
def inverse(self, magnitude, phase):
|
||||
recombine_magnitude_phase = torch.cat(
|
||||
[magnitude*torch.cos(phase), magnitude*torch.sin(phase)], dim=1)
|
||||
|
||||
inverse_transform = F.conv_transpose1d(
|
||||
recombine_magnitude_phase,
|
||||
Variable(self.inverse_basis, requires_grad=False),
|
||||
stride=self.hop_length,
|
||||
padding=0)
|
||||
|
||||
if self.window is not None:
|
||||
window_sum = window_sumsquare(
|
||||
self.window, magnitude.size(-1), hop_length=self.hop_length,
|
||||
win_length=self.win_length, n_fft=self.filter_length,
|
||||
dtype=np.float32)
|
||||
# remove modulation effects
|
||||
approx_nonzero_indices = torch.from_numpy(
|
||||
np.where(window_sum > tiny(window_sum))[0])
|
||||
window_sum = torch.autograd.Variable(
|
||||
torch.from_numpy(window_sum), requires_grad=False)
|
||||
window_sum = window_sum.cuda() if magnitude.is_cuda else window_sum
|
||||
inverse_transform[:, :, approx_nonzero_indices] /= window_sum[approx_nonzero_indices]
|
||||
|
||||
# scale by hop ratio
|
||||
inverse_transform *= float(self.filter_length) / self.hop_length
|
||||
|
||||
inverse_transform = inverse_transform[:, :, int(self.filter_length/2):]
|
||||
inverse_transform = inverse_transform[:, :, :-int(self.filter_length/2):]
|
||||
|
||||
return inverse_transform
|
||||
|
||||
def forward(self, input_data):
|
||||
self.magnitude, self.phase = self.transform(input_data)
|
||||
reconstruction = self.inverse(self.magnitude, self.phase)
|
||||
return reconstruction
|
19
PyTorch/SpeechSynthesis/FastPitch/common/text/LICENSE
Normal file
19
PyTorch/SpeechSynthesis/FastPitch/common/text/LICENSE
Normal file
|
@ -0,0 +1,19 @@
|
|||
Copyright (c) 2017 Keith Ito
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
74
PyTorch/SpeechSynthesis/FastPitch/common/text/__init__.py
Normal file
74
PyTorch/SpeechSynthesis/FastPitch/common/text/__init__.py
Normal file
|
@ -0,0 +1,74 @@
|
|||
""" from https://github.com/keithito/tacotron """
|
||||
import re
|
||||
from common.text import cleaners
|
||||
from common.text.symbols import symbols
|
||||
|
||||
|
||||
# Mappings from symbol to numeric ID and vice versa:
|
||||
_symbol_to_id = {s: i for i, s in enumerate(symbols)}
|
||||
_id_to_symbol = {i: s for i, s in enumerate(symbols)}
|
||||
|
||||
# Regular expression matching text enclosed in curly braces:
|
||||
_curly_re = re.compile(r'(.*?)\{(.+?)\}(.*)')
|
||||
|
||||
|
||||
def text_to_sequence(text, cleaner_names):
|
||||
'''Converts a string of text to a sequence of IDs corresponding to the symbols in the text.
|
||||
|
||||
The text can optionally have ARPAbet sequences enclosed in curly braces embedded
|
||||
in it. For example, "Turn left on {HH AW1 S S T AH0 N} Street."
|
||||
|
||||
Args:
|
||||
text: string to convert to a sequence
|
||||
cleaner_names: names of the cleaner functions to run the text through
|
||||
|
||||
Returns:
|
||||
List of integers corresponding to the symbols in the text
|
||||
'''
|
||||
sequence = []
|
||||
|
||||
# Check for curly braces and treat their contents as ARPAbet:
|
||||
while len(text):
|
||||
m = _curly_re.match(text)
|
||||
if not m:
|
||||
sequence += _symbols_to_sequence(_clean_text(text, cleaner_names))
|
||||
break
|
||||
sequence += _symbols_to_sequence(_clean_text(m.group(1), cleaner_names))
|
||||
sequence += _arpabet_to_sequence(m.group(2))
|
||||
text = m.group(3)
|
||||
|
||||
return sequence
|
||||
|
||||
|
||||
def sequence_to_text(sequence):
|
||||
'''Converts a sequence of IDs back to a string'''
|
||||
result = ''
|
||||
for symbol_id in sequence:
|
||||
if symbol_id in _id_to_symbol:
|
||||
s = _id_to_symbol[symbol_id]
|
||||
# Enclose ARPAbet back in curly braces:
|
||||
if len(s) > 1 and s[0] == '@':
|
||||
s = '{%s}' % s[1:]
|
||||
result += s
|
||||
return result.replace('}{', ' ')
|
||||
|
||||
|
||||
def _clean_text(text, cleaner_names):
|
||||
for name in cleaner_names:
|
||||
cleaner = getattr(cleaners, name)
|
||||
if not cleaner:
|
||||
raise Exception('Unknown cleaner: %s' % name)
|
||||
text = cleaner(text)
|
||||
return text
|
||||
|
||||
|
||||
def _symbols_to_sequence(symbols):
|
||||
return [_symbol_to_id[s] for s in symbols if _should_keep_symbol(s)]
|
||||
|
||||
|
||||
def _arpabet_to_sequence(text):
|
||||
return _symbols_to_sequence(['@' + s for s in text.split()])
|
||||
|
||||
|
||||
def _should_keep_symbol(s):
|
||||
return s in _symbol_to_id and s is not '_' and s is not '~'
|
90
PyTorch/SpeechSynthesis/FastPitch/common/text/cleaners.py
Normal file
90
PyTorch/SpeechSynthesis/FastPitch/common/text/cleaners.py
Normal file
|
@ -0,0 +1,90 @@
|
|||
""" from https://github.com/keithito/tacotron """
|
||||
|
||||
'''
|
||||
Cleaners are transformations that run over the input text at both training and eval time.
|
||||
|
||||
Cleaners can be selected by passing a comma-delimited list of cleaner names as the "cleaners"
|
||||
hyperparameter. Some cleaners are English-specific. You'll typically want to use:
|
||||
1. "english_cleaners" for English text
|
||||
2. "transliteration_cleaners" for non-English text that can be transliterated to ASCII using
|
||||
the Unidecode library (https://pypi.python.org/pypi/Unidecode)
|
||||
3. "basic_cleaners" if you do not want to transliterate (in this case, you should also update
|
||||
the symbols in symbols.py to match your data).
|
||||
'''
|
||||
|
||||
import re
|
||||
from unidecode import unidecode
|
||||
from .numbers import normalize_numbers
|
||||
|
||||
|
||||
# Regular expression matching whitespace:
|
||||
_whitespace_re = re.compile(r'\s+')
|
||||
|
||||
# List of (regular expression, replacement) pairs for abbreviations:
|
||||
_abbreviations = [(re.compile('\\b%s\\.' % x[0], re.IGNORECASE), x[1]) for x in [
|
||||
('mrs', 'misess'),
|
||||
('mr', 'mister'),
|
||||
('dr', 'doctor'),
|
||||
('st', 'saint'),
|
||||
('co', 'company'),
|
||||
('jr', 'junior'),
|
||||
('maj', 'major'),
|
||||
('gen', 'general'),
|
||||
('drs', 'doctors'),
|
||||
('rev', 'reverend'),
|
||||
('lt', 'lieutenant'),
|
||||
('hon', 'honorable'),
|
||||
('sgt', 'sergeant'),
|
||||
('capt', 'captain'),
|
||||
('esq', 'esquire'),
|
||||
('ltd', 'limited'),
|
||||
('col', 'colonel'),
|
||||
('ft', 'fort'),
|
||||
]]
|
||||
|
||||
|
||||
def expand_abbreviations(text):
|
||||
for regex, replacement in _abbreviations:
|
||||
text = re.sub(regex, replacement, text)
|
||||
return text
|
||||
|
||||
|
||||
def expand_numbers(text):
|
||||
return normalize_numbers(text)
|
||||
|
||||
|
||||
def lowercase(text):
|
||||
return text.lower()
|
||||
|
||||
|
||||
def collapse_whitespace(text):
|
||||
return re.sub(_whitespace_re, ' ', text)
|
||||
|
||||
|
||||
def convert_to_ascii(text):
|
||||
return unidecode(text)
|
||||
|
||||
|
||||
def basic_cleaners(text):
|
||||
'''Basic pipeline that lowercases and collapses whitespace without transliteration.'''
|
||||
text = lowercase(text)
|
||||
text = collapse_whitespace(text)
|
||||
return text
|
||||
|
||||
|
||||
def transliteration_cleaners(text):
|
||||
'''Pipeline for non-English text that transliterates to ASCII.'''
|
||||
text = convert_to_ascii(text)
|
||||
text = lowercase(text)
|
||||
text = collapse_whitespace(text)
|
||||
return text
|
||||
|
||||
|
||||
def english_cleaners(text):
|
||||
'''Pipeline for English text, including number and abbreviation expansion.'''
|
||||
text = convert_to_ascii(text)
|
||||
text = lowercase(text)
|
||||
text = expand_numbers(text)
|
||||
text = expand_abbreviations(text)
|
||||
text = collapse_whitespace(text)
|
||||
return text
|
65
PyTorch/SpeechSynthesis/FastPitch/common/text/cmudict.py
Normal file
65
PyTorch/SpeechSynthesis/FastPitch/common/text/cmudict.py
Normal file
|
@ -0,0 +1,65 @@
|
|||
""" from https://github.com/keithito/tacotron """
|
||||
|
||||
import re
|
||||
|
||||
|
||||
valid_symbols = [
|
||||
'AA', 'AA0', 'AA1', 'AA2', 'AE', 'AE0', 'AE1', 'AE2', 'AH', 'AH0', 'AH1', 'AH2',
|
||||
'AO', 'AO0', 'AO1', 'AO2', 'AW', 'AW0', 'AW1', 'AW2', 'AY', 'AY0', 'AY1', 'AY2',
|
||||
'B', 'CH', 'D', 'DH', 'EH', 'EH0', 'EH1', 'EH2', 'ER', 'ER0', 'ER1', 'ER2', 'EY',
|
||||
'EY0', 'EY1', 'EY2', 'F', 'G', 'HH', 'IH', 'IH0', 'IH1', 'IH2', 'IY', 'IY0', 'IY1',
|
||||
'IY2', 'JH', 'K', 'L', 'M', 'N', 'NG', 'OW', 'OW0', 'OW1', 'OW2', 'OY', 'OY0',
|
||||
'OY1', 'OY2', 'P', 'R', 'S', 'SH', 'T', 'TH', 'UH', 'UH0', 'UH1', 'UH2', 'UW',
|
||||
'UW0', 'UW1', 'UW2', 'V', 'W', 'Y', 'Z', 'ZH'
|
||||
]
|
||||
|
||||
_valid_symbol_set = set(valid_symbols)
|
||||
|
||||
|
||||
class CMUDict:
|
||||
'''Thin wrapper around CMUDict data. http://www.speech.cs.cmu.edu/cgi-bin/cmudict'''
|
||||
def __init__(self, file_or_path, keep_ambiguous=True):
|
||||
if isinstance(file_or_path, str):
|
||||
with open(file_or_path, encoding='latin-1') as f:
|
||||
entries = _parse_cmudict(f)
|
||||
else:
|
||||
entries = _parse_cmudict(file_or_path)
|
||||
if not keep_ambiguous:
|
||||
entries = {word: pron for word, pron in entries.items() if len(pron) == 1}
|
||||
self._entries = entries
|
||||
|
||||
|
||||
def __len__(self):
|
||||
return len(self._entries)
|
||||
|
||||
|
||||
def lookup(self, word):
|
||||
'''Returns list of ARPAbet pronunciations of the given word.'''
|
||||
return self._entries.get(word.upper())
|
||||
|
||||
|
||||
|
||||
_alt_re = re.compile(r'\([0-9]+\)')
|
||||
|
||||
|
||||
def _parse_cmudict(file):
|
||||
cmudict = {}
|
||||
for line in file:
|
||||
if len(line) and (line[0] >= 'A' and line[0] <= 'Z' or line[0] == "'"):
|
||||
parts = line.split(' ')
|
||||
word = re.sub(_alt_re, '', parts[0])
|
||||
pronunciation = _get_pronunciation(parts[1])
|
||||
if pronunciation:
|
||||
if word in cmudict:
|
||||
cmudict[word].append(pronunciation)
|
||||
else:
|
||||
cmudict[word] = [pronunciation]
|
||||
return cmudict
|
||||
|
||||
|
||||
def _get_pronunciation(s):
|
||||
parts = s.strip().split(' ')
|
||||
for part in parts:
|
||||
if part not in _valid_symbol_set:
|
||||
return None
|
||||
return ' '.join(parts)
|
71
PyTorch/SpeechSynthesis/FastPitch/common/text/numbers.py
Normal file
71
PyTorch/SpeechSynthesis/FastPitch/common/text/numbers.py
Normal file
|
@ -0,0 +1,71 @@
|
|||
""" from https://github.com/keithito/tacotron """
|
||||
|
||||
import inflect
|
||||
import re
|
||||
|
||||
|
||||
_inflect = inflect.engine()
|
||||
_comma_number_re = re.compile(r'([0-9][0-9\,]+[0-9])')
|
||||
_decimal_number_re = re.compile(r'([0-9]+\.[0-9]+)')
|
||||
_pounds_re = re.compile(r'£([0-9\,]*[0-9]+)')
|
||||
_dollars_re = re.compile(r'\$([0-9\.\,]*[0-9]+)')
|
||||
_ordinal_re = re.compile(r'[0-9]+(st|nd|rd|th)')
|
||||
_number_re = re.compile(r'[0-9]+')
|
||||
|
||||
|
||||
def _remove_commas(m):
|
||||
return m.group(1).replace(',', '')
|
||||
|
||||
|
||||
def _expand_decimal_point(m):
|
||||
return m.group(1).replace('.', ' point ')
|
||||
|
||||
|
||||
def _expand_dollars(m):
|
||||
match = m.group(1)
|
||||
parts = match.split('.')
|
||||
if len(parts) > 2:
|
||||
return match + ' dollars' # Unexpected format
|
||||
dollars = int(parts[0]) if parts[0] else 0
|
||||
cents = int(parts[1]) if len(parts) > 1 and parts[1] else 0
|
||||
if dollars and cents:
|
||||
dollar_unit = 'dollar' if dollars == 1 else 'dollars'
|
||||
cent_unit = 'cent' if cents == 1 else 'cents'
|
||||
return '%s %s, %s %s' % (dollars, dollar_unit, cents, cent_unit)
|
||||
elif dollars:
|
||||
dollar_unit = 'dollar' if dollars == 1 else 'dollars'
|
||||
return '%s %s' % (dollars, dollar_unit)
|
||||
elif cents:
|
||||
cent_unit = 'cent' if cents == 1 else 'cents'
|
||||
return '%s %s' % (cents, cent_unit)
|
||||
else:
|
||||
return 'zero dollars'
|
||||
|
||||
|
||||
def _expand_ordinal(m):
|
||||
return _inflect.number_to_words(m.group(0))
|
||||
|
||||
|
||||
def _expand_number(m):
|
||||
num = int(m.group(0))
|
||||
if num > 1000 and num < 3000:
|
||||
if num == 2000:
|
||||
return 'two thousand'
|
||||
elif num > 2000 and num < 2010:
|
||||
return 'two thousand ' + _inflect.number_to_words(num % 100)
|
||||
elif num % 100 == 0:
|
||||
return _inflect.number_to_words(num // 100) + ' hundred'
|
||||
else:
|
||||
return _inflect.number_to_words(num, andword='', zero='oh', group=2).replace(', ', ' ')
|
||||
else:
|
||||
return _inflect.number_to_words(num, andword='')
|
||||
|
||||
|
||||
def normalize_numbers(text):
|
||||
text = re.sub(_comma_number_re, _remove_commas, text)
|
||||
text = re.sub(_pounds_re, r'\1 pounds', text)
|
||||
text = re.sub(_dollars_re, _expand_dollars, text)
|
||||
text = re.sub(_decimal_number_re, _expand_decimal_point, text)
|
||||
text = re.sub(_ordinal_re, _expand_ordinal, text)
|
||||
text = re.sub(_number_re, _expand_number, text)
|
||||
return text
|
19
PyTorch/SpeechSynthesis/FastPitch/common/text/symbols.py
Normal file
19
PyTorch/SpeechSynthesis/FastPitch/common/text/symbols.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
""" from https://github.com/keithito/tacotron """
|
||||
|
||||
'''
|
||||
Defines the set of symbols used in text input to the model.
|
||||
|
||||
The default is a set of ASCII characters that works well for English or text that has been run through Unidecode. For other data, you can modify _characters. See TRAINING_DATA.md for details. '''
|
||||
from common.text import cmudict
|
||||
|
||||
_pad = '_'
|
||||
_punctuation = '!\'(),.:;? '
|
||||
_special = '-'
|
||||
_letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
|
||||
|
||||
# Prepend "@" to ARPAbet symbols to ensure uniqueness (some are the same as uppercase letters):
|
||||
_arpabet = ['@' + s for s in cmudict.valid_symbols]
|
||||
|
||||
# Export all symbols:
|
||||
symbols = [_pad] + list(_special) + list(_punctuation) + list(_letters) + _arpabet
|
||||
pad_idx = 0
|
78
PyTorch/SpeechSynthesis/FastPitch/common/utils.py
Normal file
78
PyTorch/SpeechSynthesis/FastPitch/common/utils.py
Normal file
|
@ -0,0 +1,78 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
import numpy as np
|
||||
|
||||
import torch
|
||||
from scipy.io.wavfile import read
|
||||
|
||||
|
||||
def mask_from_lens(lens, max_len: Optional[int] = None):
|
||||
if max_len is None:
|
||||
max_len = int(lens.max().item())
|
||||
ids = torch.arange(0, max_len, device=lens.device, dtype=lens.dtype)
|
||||
mask = torch.lt(ids, lens.unsqueeze(1))
|
||||
return mask
|
||||
|
||||
|
||||
def load_wav_to_torch(full_path):
|
||||
sampling_rate, data = read(full_path)
|
||||
return torch.FloatTensor(data.astype(np.float32)), sampling_rate
|
||||
|
||||
|
||||
def load_filepaths_and_text(dataset_path, filename, split="|"):
|
||||
def split_line(root, line):
|
||||
parts = line.strip().split(split)
|
||||
paths, text = parts[:-1], parts[-1]
|
||||
return tuple(os.path.join(root, p) for p in paths) + (text,)
|
||||
with open(filename, encoding='utf-8') as f:
|
||||
filepaths_and_text = [split_line(dataset_path, line) for line in f]
|
||||
return filepaths_and_text
|
||||
|
||||
|
||||
def stats_filename(dataset_path, filelist_path, feature_name):
|
||||
stem = Path(filelist_path).stem
|
||||
return Path(dataset_path, f'{feature_name}_stats__{stem}.json')
|
||||
|
||||
|
||||
def to_gpu(x):
|
||||
x = x.contiguous()
|
||||
if torch.cuda.is_available():
|
||||
x = x.cuda(non_blocking=True)
|
||||
return torch.autograd.Variable(x)
|
||||
|
||||
|
||||
def to_device_async(tensor, device):
|
||||
return tensor.to(device, non_blocking=True)
|
||||
|
||||
|
||||
def to_numpy(x):
|
||||
return x.cpu().numpy() if isinstance(x, torch.Tensor) else x
|
51
PyTorch/SpeechSynthesis/FastPitch/data_functions.py
Normal file
51
PyTorch/SpeechSynthesis/FastPitch/data_functions.py
Normal file
|
@ -0,0 +1,51 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
import torch
|
||||
|
||||
from fastpitch.data_function import (TextMelAliCollate, TextMelAliLoader,
|
||||
batch_to_gpu as batch_to_gpu_fastpitch)
|
||||
from tacotron2.data_function import batch_to_gpu as batch_to_gpu_tacotron2
|
||||
from tacotron2.data_function import TextMelCollate, TextMelLoader
|
||||
from waveglow.data_function import batch_to_gpu as batch_to_gpu_waveglow
|
||||
from waveglow.data_function import MelAudioLoader
|
||||
|
||||
|
||||
def get_collate_function(model_name):
|
||||
return {'Tacotron2': lambda _: TextMelCollate(n_frames_per_step=1),
|
||||
'WaveGlow': lambda _: torch.utils.data.dataloader.default_collate,
|
||||
'FastPitch': TextMelAliCollate}[model_name]()
|
||||
|
||||
def get_data_loader(model_name, *args):
|
||||
return {'Tacotron2': TextMelLoader,
|
||||
'WaveGlow': MelAudioLoader,
|
||||
'FastPitch': TextMelAliLoader}[model_name](*args)
|
||||
|
||||
def get_batch_to_gpu(model_name):
|
||||
return {'Tacotron2': batch_to_gpu_tacotron2,
|
||||
'WaveGlow': batch_to_gpu_waveglow,
|
||||
'FastPitch': batch_to_gpu_fastpitch}[model_name]
|
61
PyTorch/SpeechSynthesis/FastPitch/export_torchscript.py
Normal file
61
PyTorch/SpeechSynthesis/FastPitch/export_torchscript.py
Normal file
|
@ -0,0 +1,61 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
import argparse
|
||||
import torch
|
||||
from inference import load_and_setup_model
|
||||
|
||||
|
||||
def parse_args(parser):
|
||||
parser.add_argument('--generator-name', type=str, required=True,
|
||||
choices=('Tacotron2', 'FastPitch'), help='model name')
|
||||
parser.add_argument('--generator-checkpoint', type=str, required=True,
|
||||
help='full path to the generator checkpoint file')
|
||||
parser.add_argument('-o', '--output', type=str, default="trtis_repo/tacotron/1/model.pt",
|
||||
help='filename for the Tacotron 2 TorchScript model')
|
||||
parser.add_argument('--amp-run', action='store_true',
|
||||
help='inference with AMP')
|
||||
return parser
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description='Export models to TorchScript')
|
||||
parser = parse_args(parser)
|
||||
args = parser.parse_args()
|
||||
|
||||
model = load_and_setup_model(
|
||||
args.generator_name, parser, args.generator_checkpoint,
|
||||
args.amp_run, device='cpu', forward_is_infer=True, polyak=False,
|
||||
jitable=True)
|
||||
|
||||
torch.jit.save(torch.jit.script(model), args.output)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
290
PyTorch/SpeechSynthesis/FastPitch/extract_mels.py
Normal file
290
PyTorch/SpeechSynthesis/FastPitch/extract_mels.py
Normal file
|
@ -0,0 +1,290 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
import parselmouth
|
||||
import torch
|
||||
import dllogger as DLLogger
|
||||
import numpy as np
|
||||
from dllogger import StdOutBackend, JSONStreamBackend, Verbosity
|
||||
from torch.utils.data import DataLoader
|
||||
|
||||
from common import utils
|
||||
from inference import load_and_setup_model
|
||||
from tacotron2.data_function import TextMelLoader, TextMelCollate, batch_to_gpu
|
||||
|
||||
|
||||
def parse_args(parser):
|
||||
"""
|
||||
Parse commandline arguments.
|
||||
"""
|
||||
parser.add_argument('--tacotron2-checkpoint', type=str,
|
||||
help='full path to the generator checkpoint file')
|
||||
parser.add_argument('-b', '--batch-size', default=32, type=int)
|
||||
parser.add_argument('--log-file', type=str, default='nvlog.json',
|
||||
help='Filename for logging')
|
||||
# Mel extraction
|
||||
parser.add_argument('-d', '--dataset-path', type=str,
|
||||
default='./', help='Path to dataset')
|
||||
parser.add_argument('--wav-text-filelist', required=True,
|
||||
type=str, help='Path to file with audio paths and text')
|
||||
parser.add_argument('--text-cleaners', nargs='*',
|
||||
default=['english_cleaners'], type=str,
|
||||
help='Type of text cleaners for input text')
|
||||
parser.add_argument('--max-wav-value', default=32768.0, type=float,
|
||||
help='Maximum audiowave value')
|
||||
parser.add_argument('--sampling-rate', default=22050, type=int,
|
||||
help='Sampling rate')
|
||||
parser.add_argument('--filter-length', default=1024, type=int,
|
||||
help='Filter length')
|
||||
parser.add_argument('--hop-length', default=256, type=int,
|
||||
help='Hop (stride) length')
|
||||
parser.add_argument('--win-length', default=1024, type=int,
|
||||
help='Window length')
|
||||
parser.add_argument('--mel-fmin', default=0.0, type=float,
|
||||
help='Minimum mel frequency')
|
||||
parser.add_argument('--mel-fmax', default=8000.0, type=float,
|
||||
help='Maximum mel frequency')
|
||||
# Duration extraction
|
||||
parser.add_argument('--extract-mels', action='store_true',
|
||||
help='Calculate spectrograms from .wav files')
|
||||
parser.add_argument('--extract-mels-teacher', action='store_true',
|
||||
help='Extract Taco-generated mel-spectrograms for KD')
|
||||
parser.add_argument('--extract-durations', action='store_true',
|
||||
help='Extract char durations from attention matrices')
|
||||
parser.add_argument('--extract-attentions', action='store_true',
|
||||
help='Extract full attention matrices')
|
||||
parser.add_argument('--extract-pitch-mel', action='store_true',
|
||||
help='Extract pitch')
|
||||
parser.add_argument('--extract-pitch-char', action='store_true',
|
||||
help='Extract pitch averaged over input characters')
|
||||
parser.add_argument('--extract-pitch-trichar', action='store_true',
|
||||
help='Extract pitch averaged over input characters')
|
||||
parser.add_argument('--train-mode', action='store_true',
|
||||
help='Run the model in .train() mode')
|
||||
parser.add_argument('--cuda', action='store_true',
|
||||
help='Extract mels on a GPU using CUDA')
|
||||
return parser
|
||||
|
||||
|
||||
class FilenamedLoader(TextMelLoader):
|
||||
def __init__(self, filenames, *args, **kwargs):
|
||||
super(FilenamedLoader, self).__init__(*args, **kwargs)
|
||||
self.filenames = filenames
|
||||
|
||||
def __getitem__(self, index):
|
||||
mel_text = super(FilenamedLoader, self).__getitem__(index)
|
||||
return mel_text + (self.filenames[index],)
|
||||
|
||||
|
||||
def maybe_pad(vec, l):
|
||||
assert np.abs(vec.shape[0] - l) <= 3
|
||||
vec = vec[:l]
|
||||
if vec.shape[0] < l:
|
||||
vec = np.pad(vec, pad_width=(0, l - vec.shape[0]))
|
||||
return vec
|
||||
|
||||
|
||||
def dur_chunk_sizes(n, ary):
|
||||
"""Split a single duration into almost-equally-sized chunks
|
||||
|
||||
Examples:
|
||||
dur_chunk(3, 2) --> [2, 1]
|
||||
dur_chunk(3, 3) --> [1, 1, 1]
|
||||
dur_chunk(5, 3) --> [2, 2, 1]
|
||||
"""
|
||||
ret = np.ones((ary,), dtype=np.int32) * (n // ary)
|
||||
ret[:n % ary] = n // ary + 1
|
||||
assert ret.sum() == n
|
||||
return ret
|
||||
|
||||
|
||||
def calculate_pitch(wav, durs):
|
||||
mel_len = durs.sum()
|
||||
durs_cum = np.cumsum(np.pad(durs, (1, 0)))
|
||||
snd = parselmouth.Sound(wav)
|
||||
pitch = snd.to_pitch(time_step=snd.duration / (mel_len + 3)
|
||||
).selected_array['frequency']
|
||||
assert np.abs(mel_len - pitch.shape[0]) <= 1.0
|
||||
|
||||
# Average pitch over characters
|
||||
pitch_char = np.zeros((durs.shape[0],), dtype=np.float)
|
||||
for idx, a, b in zip(range(mel_len), durs_cum[:-1], durs_cum[1:]):
|
||||
values = pitch[a:b][np.where(pitch[a:b] != 0.0)[0]]
|
||||
pitch_char[idx] = np.mean(values) if len(values) > 0 else 0.0
|
||||
|
||||
# Average to three values per character
|
||||
pitch_trichar = np.zeros((3 * durs.shape[0],), dtype=np.float)
|
||||
|
||||
durs_tri = np.concatenate([dur_chunk_sizes(d, 3) for d in durs])
|
||||
durs_tri_cum = np.cumsum(np.pad(durs_tri, (1, 0)))
|
||||
|
||||
for idx, a, b in zip(range(3 * mel_len), durs_tri_cum[:-1], durs_tri_cum[1:]):
|
||||
values = pitch[a:b][np.where(pitch[a:b] != 0.0)[0]]
|
||||
pitch_trichar[idx] = np.mean(values) if len(values) > 0 else 0.0
|
||||
|
||||
pitch_mel = maybe_pad(pitch, mel_len)
|
||||
pitch_char = maybe_pad(pitch_char, len(durs))
|
||||
pitch_trichar = maybe_pad(pitch_trichar, len(durs_tri))
|
||||
|
||||
return pitch_mel, pitch_char, pitch_trichar
|
||||
|
||||
|
||||
def normalize_pitch_vectors(pitch_vecs):
|
||||
nonzeros = np.concatenate([v[np.where(v != 0.0)[0]]
|
||||
for v in pitch_vecs.values()])
|
||||
mean, std = np.mean(nonzeros), np.std(nonzeros)
|
||||
|
||||
for v in pitch_vecs.values():
|
||||
zero_idxs = np.where(v == 0.0)[0]
|
||||
v -= mean
|
||||
v /= std
|
||||
v[zero_idxs] = 0.0
|
||||
|
||||
return mean, std
|
||||
|
||||
|
||||
def save_stats(dataset_path, wav_text_filelist, feature_name, mean, std):
|
||||
fpath = utils.stats_filename(dataset_path, wav_text_filelist, feature_name)
|
||||
with open(fpath, 'w') as f:
|
||||
json.dump({'mean': mean, 'std': std}, f, indent=4)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description='PyTorch TTS Data Pre-processing')
|
||||
parser = parse_args(parser)
|
||||
args, unk_args = parser.parse_known_args()
|
||||
if len(unk_args) > 0:
|
||||
raise ValueError(f'Invalid options {unk_args}')
|
||||
|
||||
if args.extract_pitch_char:
|
||||
assert args.extract_durations, "Durations required for pitch extraction"
|
||||
|
||||
DLLogger.init(backends=[JSONStreamBackend(Verbosity.DEFAULT, args.log_file),
|
||||
StdOutBackend(Verbosity.VERBOSE)])
|
||||
for k,v in vars(args).items():
|
||||
DLLogger.log(step="PARAMETER", data={k:v})
|
||||
|
||||
model = load_and_setup_model(
|
||||
'Tacotron2', parser, args.tacotron2_checkpoint, amp_run=False,
|
||||
device=torch.device('cuda' if args.cuda else 'cpu'),
|
||||
forward_is_infer=False, ema=False)
|
||||
|
||||
if args.train_mode:
|
||||
model.train()
|
||||
|
||||
# n_mel_channels arg has been consumed by model's arg parser
|
||||
args.n_mel_channels = model.n_mel_channels
|
||||
|
||||
for datum in ('mels', 'mels_teacher', 'attentions', 'durations',
|
||||
'pitch_mel', 'pitch_char', 'pitch_trichar'):
|
||||
if getattr(args, f'extract_{datum}'):
|
||||
Path(args.dataset_path, datum).mkdir(parents=False, exist_ok=True)
|
||||
|
||||
filenames = [Path(l.split('|')[0]).stem
|
||||
for l in open(args.wav_text_filelist, 'r')]
|
||||
dataset = FilenamedLoader(filenames, args.dataset_path, args.wav_text_filelist,
|
||||
args, load_mel_from_disk=False)
|
||||
# TextMelCollate supports only n_frames_per_step=1
|
||||
data_loader = DataLoader(dataset, batch_size=args.batch_size, shuffle=False,
|
||||
sampler=None, num_workers=0,
|
||||
collate_fn=TextMelCollate(1),
|
||||
pin_memory=False, drop_last=False)
|
||||
pitch_vecs = {'mel': {}, 'char': {}, 'trichar': {}}
|
||||
for i, batch in enumerate(data_loader):
|
||||
tik = time.time()
|
||||
fnames = batch[-1]
|
||||
x, _, _ = batch_to_gpu(batch[:-1])
|
||||
_, text_lens, mels_padded, _, mel_lens = x
|
||||
|
||||
for j, mel in enumerate(mels_padded):
|
||||
fpath = Path(args.dataset_path, 'mels', fnames[j] + '.pt')
|
||||
torch.save(mel[:, :mel_lens[j]].cpu(), fpath)
|
||||
|
||||
with torch.no_grad():
|
||||
out_mels, out_mels_postnet, _, alignments = model.forward(x)
|
||||
|
||||
if args.extract_mels_teacher:
|
||||
for j, mel in enumerate(out_mels_postnet):
|
||||
fpath = Path(args.dataset_path, 'mels_teacher', fnames[j] + '.pt')
|
||||
torch.save(mel[:, :mel_lens[j]].cpu(), fpath)
|
||||
if args.extract_attentions:
|
||||
for j, ali in enumerate(alignments):
|
||||
ali = ali[:mel_lens[j],:text_lens[j]]
|
||||
fpath = Path(args.dataset_path, 'attentions', fnames[j] + '.pt')
|
||||
torch.save(ali.cpu(), fpath)
|
||||
durations = []
|
||||
if args.extract_durations:
|
||||
for j, ali in enumerate(alignments):
|
||||
text_len = text_lens[j]
|
||||
ali = ali[:mel_lens[j],:text_len]
|
||||
dur = torch.histc(torch.argmax(ali, dim=1), min=0,
|
||||
max=text_len-1, bins=text_len)
|
||||
durations.append(dur)
|
||||
fpath = Path(args.dataset_path, 'durations', fnames[j] + '.pt')
|
||||
torch.save(dur.cpu().int(), fpath)
|
||||
if args.extract_pitch_mel or args.extract_pitch_char or args.extract_pitch_trichar:
|
||||
for j, dur in enumerate(durations):
|
||||
fpath = Path(args.dataset_path, 'pitch_char', fnames[j] + '.pt')
|
||||
wav = Path(args.dataset_path, 'wavs', fnames[j] + '.wav')
|
||||
p_mel, p_char, p_trichar = calculate_pitch(str(wav), dur.cpu().numpy())
|
||||
pitch_vecs['mel'][fnames[j]] = p_mel
|
||||
pitch_vecs['char'][fnames[j]] = p_char
|
||||
pitch_vecs['trichar'][fnames[j]] = p_trichar
|
||||
|
||||
nseconds = time.time() - tik
|
||||
DLLogger.log(step=f'{i+1}/{len(data_loader)} ({nseconds:.2f}s)', data={})
|
||||
|
||||
if args.extract_pitch_mel:
|
||||
normalize_pitch_vectors(pitch_vecs['mel'])
|
||||
for fname, pitch in pitch_vecs['mel'].items():
|
||||
fpath = Path(args.dataset_path, 'pitch_mel', fname + '.pt')
|
||||
torch.save(torch.from_numpy(pitch), fpath)
|
||||
|
||||
if args.extract_pitch_char:
|
||||
mean, std = normalize_pitch_vectors(pitch_vecs['char'])
|
||||
for fname, pitch in pitch_vecs['char'].items():
|
||||
fpath = Path(args.dataset_path, 'pitch_char', fname + '.pt')
|
||||
torch.save(torch.from_numpy(pitch), fpath)
|
||||
save_stats(args.dataset_path, args.wav_text_filelist, 'pitch_char',
|
||||
mean, std)
|
||||
|
||||
if args.extract_pitch_trichar:
|
||||
normalize_pitch_vectors(pitch_vecs['trichar'])
|
||||
for fname, pitch in pitch_vecs['trichar'].items():
|
||||
fpath = Path(args.dataset_path, 'pitch_trichar', fname + '.pt')
|
||||
torch.save(torch.from_numpy(pitch), fpath)
|
||||
|
||||
DLLogger.flush()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
112
PyTorch/SpeechSynthesis/FastPitch/fastpitch/arg_parser.py
Normal file
112
PyTorch/SpeechSynthesis/FastPitch/fastpitch/arg_parser.py
Normal file
|
@ -0,0 +1,112 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
import argparse
|
||||
|
||||
from common.text import symbols
|
||||
|
||||
|
||||
def parse_fastpitch_args(parent, add_help=False):
|
||||
"""
|
||||
Parse commandline arguments.
|
||||
"""
|
||||
parser = argparse.ArgumentParser(parents=[parent], add_help=add_help,
|
||||
allow_abbrev=False)
|
||||
|
||||
io = parser.add_argument_group('io parameters')
|
||||
io.add_argument('--n-mel-channels', default=80, type=int,
|
||||
help='Number of bins in mel-spectrograms')
|
||||
io.add_argument('--max-seq-len', default=2048, type=int,
|
||||
help='')
|
||||
global symbols
|
||||
len_symbols = len(symbols)
|
||||
symbols = parser.add_argument_group('symbols parameters')
|
||||
symbols.add_argument('--n-symbols', default=len_symbols, type=int,
|
||||
help='Number of symbols in dictionary')
|
||||
symbols.add_argument('--symbols-embedding-dim', default=384, type=int,
|
||||
help='Input embedding dimension')
|
||||
|
||||
in_fft = parser.add_argument_group('input FFT parameters')
|
||||
in_fft.add_argument('--in-fft-n-layers', default=6, type=int,
|
||||
help='Number of FFT blocks')
|
||||
in_fft.add_argument('--in-fft-n-heads', default=1, type=int,
|
||||
help='Number of attention heads')
|
||||
in_fft.add_argument('--in-fft-d-head', default=64, type=int,
|
||||
help='Dim of attention heads')
|
||||
in_fft.add_argument('--in-fft-conv1d-kernel-size', default=3, type=int,
|
||||
help='Conv-1D kernel size')
|
||||
in_fft.add_argument('--in-fft-conv1d-filter-size', default=1536, type=int,
|
||||
help='Conv-1D filter size')
|
||||
in_fft.add_argument('--in-fft-output-size', default=384, type=int,
|
||||
help='Output dim')
|
||||
in_fft.add_argument('--p-in-fft-dropout', default=0.1, type=float,
|
||||
help='Dropout probability')
|
||||
in_fft.add_argument('--p-in-fft-dropatt', default=0.1, type=float,
|
||||
help='Multi-head attention dropout')
|
||||
in_fft.add_argument('--p-in-fft-dropemb', default=0.0, type=float,
|
||||
help='Dropout added to word+positional embeddings')
|
||||
|
||||
out_fft = parser.add_argument_group('output FFT parameters')
|
||||
out_fft.add_argument('--out-fft-n-layers', default=6, type=int,
|
||||
help='Number of FFT blocks')
|
||||
out_fft.add_argument('--out-fft-n-heads', default=1, type=int,
|
||||
help='Number of attention heads')
|
||||
out_fft.add_argument('--out-fft-d-head', default=64, type=int,
|
||||
help='Dim of attention head')
|
||||
out_fft.add_argument('--out-fft-conv1d-kernel-size', default=3, type=int,
|
||||
help='Conv-1D kernel size')
|
||||
out_fft.add_argument('--out-fft-conv1d-filter-size', default=1536, type=int,
|
||||
help='Conv-1D filter size')
|
||||
out_fft.add_argument('--out-fft-output-size', default=384, type=int,
|
||||
help='Output dim')
|
||||
out_fft.add_argument('--p-out-fft-dropout', default=0.1, type=float,
|
||||
help='Dropout probability for out_fft')
|
||||
out_fft.add_argument('--p-out-fft-dropatt', default=0.1, type=float,
|
||||
help='Multi-head attention dropout')
|
||||
out_fft.add_argument('--p-out-fft-dropemb', default=0.0, type=float,
|
||||
help='Dropout added to word+positional embeddings')
|
||||
|
||||
dur_pred = parser.add_argument_group('duration predictor parameters')
|
||||
dur_pred.add_argument('--dur-predictor-kernel-size', default=3, type=int,
|
||||
help='Duration predictor conv-1D kernel size')
|
||||
dur_pred.add_argument('--dur-predictor-filter-size', default=256, type=int,
|
||||
help='Duration predictor conv-1D filter size')
|
||||
dur_pred.add_argument('--p-dur-predictor-dropout', default=0.1, type=float,
|
||||
help='Dropout probability for duration predictor')
|
||||
dur_pred.add_argument('--dur-predictor-n-layers', default=2, type=int,
|
||||
help='Number of conv-1D layers')
|
||||
|
||||
pitch_pred = parser.add_argument_group('pitch predictor parameters')
|
||||
pitch_pred.add_argument('--pitch-predictor-kernel-size', default=3, type=int,
|
||||
help='Pitch predictor conv-1D kernel size')
|
||||
pitch_pred.add_argument('--pitch-predictor-filter-size', default=256, type=int,
|
||||
help='Pitch predictor conv-1D filter size')
|
||||
pitch_pred.add_argument('--p-pitch-predictor-dropout', default=0.1, type=float,
|
||||
help='Pitch probability for pitch predictor')
|
||||
pitch_pred.add_argument('--pitch-predictor-n-layers', default=2, type=int,
|
||||
help='Number of conv-1D layers')
|
||||
return parser
|
131
PyTorch/SpeechSynthesis/FastPitch/fastpitch/data_function.py
Normal file
131
PyTorch/SpeechSynthesis/FastPitch/fastpitch/data_function.py
Normal file
|
@ -0,0 +1,131 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
import numpy as np
|
||||
|
||||
import torch
|
||||
|
||||
from common.utils import to_gpu
|
||||
from tacotron2.data_function import TextMelLoader
|
||||
|
||||
|
||||
class TextMelAliLoader(TextMelLoader):
|
||||
"""
|
||||
"""
|
||||
def __init__(self, *args):
|
||||
super(TextMelAliLoader, self).__init__(*args)
|
||||
if len(self.audiopaths_and_text[0]) != 4:
|
||||
raise ValueError('Expected four columns in audiopaths file')
|
||||
|
||||
def __getitem__(self, index):
|
||||
# separate filename and text
|
||||
audiopath, durpath, pitchpath, text = self.audiopaths_and_text[index]
|
||||
len_text = len(text)
|
||||
text = self.get_text(text)
|
||||
mel = self.get_mel(audiopath)
|
||||
dur = torch.load(durpath)
|
||||
pitch = torch.load(pitchpath)
|
||||
return (text, mel, len_text, dur, pitch)
|
||||
|
||||
|
||||
class TextMelAliCollate():
|
||||
""" Zero-pads model inputs and targets based on number of frames per setep
|
||||
"""
|
||||
def __init__(self):
|
||||
self.n_frames_per_step = 1 # Taco2 bckwd compat
|
||||
|
||||
def __call__(self, batch):
|
||||
"""Collate's training batch from normalized text and mel-spectrogram
|
||||
PARAMS
|
||||
------
|
||||
batch: [text_normalized, mel_normalized]
|
||||
"""
|
||||
# Right zero-pad all one-hot text sequences to max input length
|
||||
input_lengths, ids_sorted_decreasing = torch.sort(
|
||||
torch.LongTensor([len(x[0]) for x in batch]),
|
||||
dim=0, descending=True)
|
||||
max_input_len = input_lengths[0]
|
||||
|
||||
text_padded = torch.LongTensor(len(batch), max_input_len)
|
||||
text_padded.zero_()
|
||||
for i in range(len(ids_sorted_decreasing)):
|
||||
text = batch[ids_sorted_decreasing[i]][0]
|
||||
text_padded[i, :text.size(0)] = text
|
||||
|
||||
dur_padded = torch.zeros_like(text_padded, dtype=batch[0][3].dtype)
|
||||
dur_lens = torch.zeros(dur_padded.size(0), dtype=torch.int32)
|
||||
for i in range(len(ids_sorted_decreasing)):
|
||||
dur = batch[ids_sorted_decreasing[i]][3]
|
||||
dur_padded[i, :dur.shape[0]] = dur
|
||||
dur_lens[i] = dur.shape[0]
|
||||
|
||||
# Right zero-pad mel-spec
|
||||
num_mels = batch[0][1].size(0)
|
||||
max_target_len = max([x[1].size(1) for x in batch])
|
||||
if max_target_len % self.n_frames_per_step != 0:
|
||||
max_target_len += (self.n_frames_per_step - max_target_len
|
||||
% self.n_frames_per_step)
|
||||
assert max_target_len % self.n_frames_per_step == 0
|
||||
|
||||
# include mel padded and gate padded
|
||||
mel_padded = torch.FloatTensor(len(batch), num_mels, max_target_len)
|
||||
mel_padded.zero_()
|
||||
output_lengths = torch.LongTensor(len(batch))
|
||||
for i in range(len(ids_sorted_decreasing)):
|
||||
mel = batch[ids_sorted_decreasing[i]][1]
|
||||
mel_padded[i, :, :mel.size(1)] = mel
|
||||
output_lengths[i] = mel.size(1)
|
||||
|
||||
pitch_padded = torch.zeros(dur_padded.size(0), dur_padded.size(1),
|
||||
dtype=batch[0][4].dtype)
|
||||
for i in range(len(ids_sorted_decreasing)):
|
||||
pitch = batch[ids_sorted_decreasing[i]][4]
|
||||
pitch_padded[i, :pitch.shape[0]] = pitch
|
||||
|
||||
# count number of items - characters in text
|
||||
len_x = [x[2] for x in batch]
|
||||
len_x = torch.Tensor(len_x)
|
||||
return (text_padded, input_lengths, mel_padded,
|
||||
output_lengths, len_x, dur_padded, dur_lens, pitch_padded)
|
||||
|
||||
|
||||
def batch_to_gpu(batch):
|
||||
text_padded, input_lengths, mel_padded, \
|
||||
output_lengths, len_x, dur_padded, dur_lens, pitch_padded = batch
|
||||
text_padded = to_gpu(text_padded).long()
|
||||
input_lengths = to_gpu(input_lengths).long()
|
||||
mel_padded = to_gpu(mel_padded).float()
|
||||
output_lengths = to_gpu(output_lengths).long()
|
||||
dur_padded = to_gpu(dur_padded).long()
|
||||
dur_lens = to_gpu(dur_lens).long()
|
||||
pitch_padded = to_gpu(pitch_padded).float()
|
||||
# Alignments act as both inputs and targets - pass shallow copies
|
||||
x = [text_padded, input_lengths, mel_padded, output_lengths,
|
||||
dur_padded, dur_lens, pitch_padded]
|
||||
y = [mel_padded, dur_padded, dur_lens, pitch_padded]
|
||||
len_x = torch.sum(output_lengths)
|
||||
return (x, y, len_x)
|
83
PyTorch/SpeechSynthesis/FastPitch/fastpitch/loss_function.py
Normal file
83
PyTorch/SpeechSynthesis/FastPitch/fastpitch/loss_function.py
Normal file
|
@ -0,0 +1,83 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
import torch
|
||||
import torch.nn.functional as F
|
||||
from torch import nn
|
||||
|
||||
from common.utils import mask_from_lens
|
||||
|
||||
|
||||
class FastPitchLoss(nn.Module):
|
||||
def __init__(self, dur_predictor_loss_scale=1.0,
|
||||
pitch_predictor_loss_scale=1.0):
|
||||
super(FastPitchLoss, self).__init__()
|
||||
self.dur_predictor_loss_scale = dur_predictor_loss_scale
|
||||
self.pitch_predictor_loss_scale = pitch_predictor_loss_scale
|
||||
|
||||
def forward(self, model_out, targets, is_training=True, meta_agg='mean'):
|
||||
mel_out, dec_mask, dur_pred, log_dur_pred, pitch_pred = model_out
|
||||
mel_tgt, dur_tgt, dur_lens, pitch_tgt = targets
|
||||
mel_tgt.requires_grad = False
|
||||
# (B,H,T) => (B,T,H)
|
||||
mel_tgt = mel_tgt.transpose(1, 2)
|
||||
|
||||
dur_mask = mask_from_lens(dur_lens, max_len=dur_tgt.size(1))
|
||||
log_dur_tgt = torch.log(dur_tgt.float() + 1)
|
||||
loss_fn = F.mse_loss
|
||||
dur_pred_loss = loss_fn(log_dur_pred, log_dur_tgt, reduction='none')
|
||||
dur_pred_loss = (dur_pred_loss * dur_mask).sum() / dur_mask.sum()
|
||||
|
||||
ldiff = mel_tgt.size(1) - mel_out.size(1)
|
||||
mel_out = F.pad(mel_out, (0, 0, 0, ldiff, 0, 0), value=0.0)
|
||||
mel_mask = mel_tgt.ne(0).float()
|
||||
loss_fn = F.mse_loss
|
||||
mel_loss = loss_fn(mel_out, mel_tgt, reduction='none')
|
||||
mel_loss = (mel_loss * mel_mask).sum() / mel_mask.sum()
|
||||
|
||||
ldiff = pitch_tgt.size(1) - pitch_pred.size(1)
|
||||
pitch_pred = F.pad(pitch_pred, (0, ldiff, 0, 0), value=0.0)
|
||||
pitch_loss = F.mse_loss(pitch_tgt, pitch_pred, reduction='none')
|
||||
pitch_loss = (pitch_loss * dur_mask).sum() / dur_mask.sum()
|
||||
|
||||
loss = mel_loss
|
||||
loss = (mel_loss + pitch_loss * self.pitch_predictor_loss_scale
|
||||
+ dur_pred_loss * self.dur_predictor_loss_scale)
|
||||
|
||||
meta = {
|
||||
'loss': loss.clone().detach(),
|
||||
'mel_loss': mel_loss.clone().detach(),
|
||||
'duration_predictor_loss': dur_pred_loss.clone().detach(),
|
||||
'pitch_loss': pitch_loss.clone().detach(),
|
||||
'dur_error': (torch.abs(dur_pred - dur_tgt).sum()
|
||||
/ dur_mask.sum()).detach(),
|
||||
}
|
||||
assert meta_agg in ('sum', 'mean')
|
||||
if meta_agg == 'sum':
|
||||
bsz = mel_out.size(0)
|
||||
meta = {k: v * bsz for k,v in meta.items()}
|
||||
return loss, meta
|
210
PyTorch/SpeechSynthesis/FastPitch/fastpitch/model.py
Normal file
210
PyTorch/SpeechSynthesis/FastPitch/fastpitch/model.py
Normal file
|
@ -0,0 +1,210 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
import torch
|
||||
from torch import nn as nn
|
||||
from torch.nn.utils.rnn import pad_sequence
|
||||
|
||||
from common.layers import ConvReLUNorm
|
||||
from common.utils import mask_from_lens
|
||||
from fastpitch.transformer import FFTransformer
|
||||
|
||||
|
||||
def regulate_len(durations, enc_out, pace=1.0, mel_max_len=None):
|
||||
"""If target=None, then predicted durations are applied"""
|
||||
reps = torch.round(durations.float() / pace).long()
|
||||
dec_lens = reps.sum(dim=1)
|
||||
|
||||
enc_rep = pad_sequence([torch.repeat_interleave(o, r, dim=0)
|
||||
for o, r in zip(enc_out, reps)],
|
||||
batch_first=True)
|
||||
if mel_max_len:
|
||||
enc_rep = enc_rep[:, :mel_max_len]
|
||||
dec_lens = torch.clamp_max(dec_lens, mel_max_len)
|
||||
return enc_rep, dec_lens
|
||||
|
||||
|
||||
class TemporalPredictor(nn.Module):
|
||||
"""Predicts a single float per each temporal location"""
|
||||
|
||||
def __init__(self, input_size, filter_size, kernel_size, dropout,
|
||||
n_layers=2):
|
||||
super(TemporalPredictor, self).__init__()
|
||||
|
||||
self.layers = nn.Sequential(*[
|
||||
ConvReLUNorm(input_size if i == 0 else filter_size, filter_size,
|
||||
kernel_size=kernel_size, dropout=dropout)
|
||||
for i in range(n_layers)]
|
||||
)
|
||||
self.fc = nn.Linear(filter_size, 1, bias=True)
|
||||
|
||||
def forward(self, enc_out, enc_out_mask):
|
||||
out = enc_out * enc_out_mask
|
||||
out = self.layers(out.transpose(1, 2)).transpose(1, 2)
|
||||
out = self.fc(out) * enc_out_mask
|
||||
return out.squeeze(-1)
|
||||
|
||||
|
||||
class FastPitch(nn.Module):
|
||||
def __init__(self, n_mel_channels, max_seq_len, n_symbols,
|
||||
symbols_embedding_dim, in_fft_n_layers, in_fft_n_heads,
|
||||
in_fft_d_head,
|
||||
in_fft_conv1d_kernel_size, in_fft_conv1d_filter_size,
|
||||
in_fft_output_size,
|
||||
p_in_fft_dropout, p_in_fft_dropatt, p_in_fft_dropemb,
|
||||
out_fft_n_layers, out_fft_n_heads, out_fft_d_head,
|
||||
out_fft_conv1d_kernel_size, out_fft_conv1d_filter_size,
|
||||
out_fft_output_size,
|
||||
p_out_fft_dropout, p_out_fft_dropatt, p_out_fft_dropemb,
|
||||
dur_predictor_kernel_size, dur_predictor_filter_size,
|
||||
p_dur_predictor_dropout, dur_predictor_n_layers,
|
||||
pitch_predictor_kernel_size, pitch_predictor_filter_size,
|
||||
p_pitch_predictor_dropout, pitch_predictor_n_layers):
|
||||
super(FastPitch, self).__init__()
|
||||
del max_seq_len # unused
|
||||
del n_symbols
|
||||
|
||||
self.encoder = FFTransformer(
|
||||
n_layer=in_fft_n_layers, n_head=in_fft_n_heads,
|
||||
d_model=symbols_embedding_dim,
|
||||
d_head=in_fft_d_head,
|
||||
d_inner=in_fft_conv1d_filter_size,
|
||||
kernel_size=in_fft_conv1d_kernel_size,
|
||||
dropout=p_in_fft_dropout,
|
||||
dropatt=p_in_fft_dropatt,
|
||||
dropemb=p_in_fft_dropemb,
|
||||
d_embed=symbols_embedding_dim,
|
||||
embed_input=True)
|
||||
|
||||
self.duration_predictor = TemporalPredictor(
|
||||
in_fft_output_size,
|
||||
filter_size=dur_predictor_filter_size,
|
||||
kernel_size=dur_predictor_kernel_size,
|
||||
dropout=p_dur_predictor_dropout, n_layers=dur_predictor_n_layers
|
||||
)
|
||||
|
||||
self.decoder = FFTransformer(
|
||||
n_layer=out_fft_n_layers, n_head=out_fft_n_heads,
|
||||
d_model=symbols_embedding_dim,
|
||||
d_head=out_fft_d_head,
|
||||
d_inner=out_fft_conv1d_filter_size,
|
||||
kernel_size=out_fft_conv1d_kernel_size,
|
||||
dropout=p_out_fft_dropout,
|
||||
dropatt=p_out_fft_dropatt,
|
||||
dropemb=p_out_fft_dropemb,
|
||||
d_embed=symbols_embedding_dim,
|
||||
embed_input=False)
|
||||
|
||||
self.pitch_predictor = TemporalPredictor(
|
||||
in_fft_output_size,
|
||||
filter_size=pitch_predictor_filter_size,
|
||||
kernel_size=pitch_predictor_kernel_size,
|
||||
dropout=p_pitch_predictor_dropout, n_layers=pitch_predictor_n_layers
|
||||
)
|
||||
self.pitch_emb = nn.Conv1d(1, symbols_embedding_dim, kernel_size=3,
|
||||
padding=1)
|
||||
|
||||
# Store values precomputed for training data within the model
|
||||
self.register_buffer('pitch_mean', torch.zeros(1))
|
||||
self.register_buffer('pitch_std', torch.zeros(1))
|
||||
|
||||
self.proj = nn.Linear(out_fft_output_size, n_mel_channels, bias=True)
|
||||
|
||||
def forward(self, inputs, use_gt_durations=True, use_gt_pitch=True,
|
||||
pace=1.0, max_duration=75):
|
||||
inputs, _, mel_tgt, _, dur_tgt, _, pitch_tgt = inputs
|
||||
mel_max_len = mel_tgt.size(2)
|
||||
|
||||
# Input FFT
|
||||
enc_out, enc_mask = self.encoder(inputs)
|
||||
|
||||
# Embedded for predictors
|
||||
pred_enc_out, pred_enc_mask = enc_out, enc_mask
|
||||
|
||||
# Predict durations
|
||||
log_dur_pred = self.duration_predictor(pred_enc_out, pred_enc_mask)
|
||||
dur_pred = torch.clamp(torch.exp(log_dur_pred) - 1, 0, max_duration)
|
||||
|
||||
# Predict pitch
|
||||
pitch_pred = self.pitch_predictor(enc_out, enc_mask)
|
||||
|
||||
if use_gt_pitch and pitch_tgt is not None:
|
||||
pitch_emb = self.pitch_emb(pitch_tgt.unsqueeze(1))
|
||||
else:
|
||||
pitch_emb = self.pitch_emb(pitch_pred.unsqueeze(1))
|
||||
enc_out = enc_out + pitch_emb.transpose(1, 2)
|
||||
|
||||
len_regulated, dec_lens = regulate_len(
|
||||
dur_tgt if use_gt_durations else dur_pred,
|
||||
enc_out, pace, mel_max_len)
|
||||
|
||||
# Output FFT
|
||||
dec_out, dec_mask = self.decoder(len_regulated, dec_lens)
|
||||
mel_out = self.proj(dec_out)
|
||||
return mel_out, dec_mask, dur_pred, log_dur_pred, pitch_pred
|
||||
|
||||
def infer(self, inputs, input_lens, pace=1.0, dur_tgt=None, pitch_tgt=None,
|
||||
pitch_transform=None, max_duration=75):
|
||||
del input_lens # unused
|
||||
|
||||
# Input FFT
|
||||
enc_out, enc_mask = self.encoder(inputs)
|
||||
|
||||
# Embedded for predictors
|
||||
pred_enc_out, pred_enc_mask = enc_out, enc_mask
|
||||
|
||||
# Predict durations
|
||||
log_dur_pred = self.duration_predictor(pred_enc_out, pred_enc_mask)
|
||||
dur_pred = torch.clamp(torch.exp(log_dur_pred) - 1, 0, max_duration)
|
||||
|
||||
# Pitch over chars
|
||||
pitch_pred = self.pitch_predictor(enc_out, enc_mask)
|
||||
|
||||
if pitch_transform is not None:
|
||||
if self.pitch_std[0] == 0.0:
|
||||
# XXX LJSpeech-1.1 defaults
|
||||
mean, std = 218.14, 67.24
|
||||
else:
|
||||
mean, std = self.pitch_mean[0], self.pitch_std[0]
|
||||
pitch_pred = pitch_transform(pitch_pred, mean, std)
|
||||
|
||||
if pitch_tgt is None:
|
||||
pitch_emb = self.pitch_emb(pitch_pred.unsqueeze(1)).transpose(1, 2)
|
||||
else:
|
||||
pitch_emb = self.pitch_emb(pitch_tgt.unsqueeze(1)).transpose(1, 2)
|
||||
|
||||
enc_out = enc_out + pitch_emb
|
||||
|
||||
len_regulated, dec_lens = regulate_len(
|
||||
dur_pred if dur_tgt is None else dur_tgt,
|
||||
enc_out, pace, mel_max_len=None)
|
||||
|
||||
dec_out, dec_mask = self.decoder(len_regulated, dec_lens)
|
||||
mel_out = self.proj(dec_out)
|
||||
# mel_lens = dec_mask.squeeze(2).sum(axis=1).long()
|
||||
mel_out = mel_out.permute(0, 2, 1) # For inference.py
|
||||
return mel_out, dec_lens, dur_pred, pitch_pred
|
218
PyTorch/SpeechSynthesis/FastPitch/fastpitch/model_jit.py
Normal file
218
PyTorch/SpeechSynthesis/FastPitch/fastpitch/model_jit.py
Normal file
|
@ -0,0 +1,218 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
from typing import List, Optional
|
||||
|
||||
import torch
|
||||
from torch import nn as nn
|
||||
from torch.nn.utils.rnn import pad_sequence
|
||||
|
||||
from common.layers import ConvReLUNorm
|
||||
from fastpitch.transformer_jit import FFTransformer
|
||||
|
||||
|
||||
def regulate_len(durations, enc_out, pace: float = 1.0,
|
||||
mel_max_len: Optional[int] = None):
|
||||
"""If target=None, then predicted durations are applied"""
|
||||
reps = torch.round(durations.float() / pace).long()
|
||||
dec_lens = reps.sum(dim=1)
|
||||
|
||||
max_len = dec_lens.max()
|
||||
bsz, _, hid = enc_out.size()
|
||||
|
||||
reps_padded = torch.cat([reps, (max_len - dec_lens)[:, None]], dim=1)
|
||||
pad_vec = torch.zeros(bsz, 1, hid, dtype=enc_out.dtype,
|
||||
device=enc_out.device)
|
||||
|
||||
enc_rep = torch.cat([enc_out, pad_vec], dim=1)
|
||||
enc_rep = torch.repeat_interleave(
|
||||
enc_rep.view(-1, hid), reps_padded.view(-1), dim=0
|
||||
).view(bsz, -1, hid)
|
||||
|
||||
# enc_rep = pad_sequence([torch.repeat_interleave(o, r, dim=0)
|
||||
# for o, r in zip(enc_out, reps)],
|
||||
# batch_first=True)
|
||||
if mel_max_len is not None:
|
||||
enc_rep = enc_rep[:, :mel_max_len]
|
||||
dec_lens = torch.clamp_max(dec_lens, mel_max_len)
|
||||
return enc_rep, dec_lens
|
||||
|
||||
|
||||
class TemporalPredictor(nn.Module):
|
||||
"""Predicts a single float per each temporal location"""
|
||||
|
||||
def __init__(self, input_size, filter_size, kernel_size, dropout,
|
||||
n_layers=2):
|
||||
super(TemporalPredictor, self).__init__()
|
||||
|
||||
self.layers = nn.Sequential(*[
|
||||
ConvReLUNorm(input_size if i == 0 else filter_size, filter_size,
|
||||
kernel_size=kernel_size, dropout=dropout)
|
||||
for i in range(n_layers)]
|
||||
)
|
||||
self.fc = nn.Linear(filter_size, 1, bias=True)
|
||||
|
||||
def forward(self, enc_out, enc_out_mask):
|
||||
out = enc_out * enc_out_mask
|
||||
out = self.layers(out.transpose(1, 2)).transpose(1, 2)
|
||||
out = self.fc(out) * enc_out_mask
|
||||
return out.squeeze(-1)
|
||||
|
||||
|
||||
class FastPitch(nn.Module):
|
||||
def __init__(self, n_mel_channels, max_seq_len, n_symbols,
|
||||
symbols_embedding_dim, in_fft_n_layers, in_fft_n_heads,
|
||||
in_fft_d_head,
|
||||
in_fft_conv1d_kernel_size, in_fft_conv1d_filter_size,
|
||||
in_fft_output_size,
|
||||
p_in_fft_dropout, p_in_fft_dropatt, p_in_fft_dropemb,
|
||||
out_fft_n_layers, out_fft_n_heads, out_fft_d_head,
|
||||
out_fft_conv1d_kernel_size, out_fft_conv1d_filter_size,
|
||||
out_fft_output_size,
|
||||
p_out_fft_dropout, p_out_fft_dropatt, p_out_fft_dropemb,
|
||||
dur_predictor_kernel_size, dur_predictor_filter_size,
|
||||
p_dur_predictor_dropout, dur_predictor_n_layers,
|
||||
pitch_predictor_kernel_size, pitch_predictor_filter_size,
|
||||
p_pitch_predictor_dropout, pitch_predictor_n_layers):
|
||||
super(FastPitch, self).__init__()
|
||||
del max_seq_len # unused
|
||||
del n_symbols
|
||||
|
||||
self.encoder = FFTransformer(
|
||||
n_layer=in_fft_n_layers, n_head=in_fft_n_heads,
|
||||
d_model=symbols_embedding_dim,
|
||||
d_head=in_fft_d_head,
|
||||
d_inner=in_fft_conv1d_filter_size,
|
||||
kernel_size=in_fft_conv1d_kernel_size,
|
||||
dropout=p_in_fft_dropout,
|
||||
dropatt=p_in_fft_dropatt,
|
||||
dropemb=p_in_fft_dropemb,
|
||||
d_embed=symbols_embedding_dim,
|
||||
embed_input=True)
|
||||
|
||||
self.duration_predictor = TemporalPredictor(
|
||||
in_fft_output_size,
|
||||
filter_size=dur_predictor_filter_size,
|
||||
kernel_size=dur_predictor_kernel_size,
|
||||
dropout=p_dur_predictor_dropout, n_layers=dur_predictor_n_layers
|
||||
)
|
||||
|
||||
self.decoder = FFTransformer(
|
||||
n_layer=out_fft_n_layers, n_head=out_fft_n_heads,
|
||||
d_model=symbols_embedding_dim,
|
||||
d_head=out_fft_d_head,
|
||||
d_inner=out_fft_conv1d_filter_size,
|
||||
kernel_size=out_fft_conv1d_kernel_size,
|
||||
dropout=p_out_fft_dropout,
|
||||
dropatt=p_out_fft_dropatt,
|
||||
dropemb=p_out_fft_dropemb,
|
||||
d_embed=symbols_embedding_dim,
|
||||
embed_input=False)
|
||||
|
||||
self.pitch_predictor = TemporalPredictor(
|
||||
in_fft_output_size,
|
||||
filter_size=pitch_predictor_filter_size,
|
||||
kernel_size=pitch_predictor_kernel_size,
|
||||
dropout=p_pitch_predictor_dropout, n_layers=pitch_predictor_n_layers
|
||||
)
|
||||
self.pitch_emb = nn.Conv1d(1, symbols_embedding_dim, kernel_size=3,
|
||||
padding=1)
|
||||
|
||||
# Store values precomputed for training data within the model
|
||||
self.register_buffer('pitch_mean', torch.zeros(1))
|
||||
self.register_buffer('pitch_std', torch.zeros(1))
|
||||
|
||||
self.proj = nn.Linear(out_fft_output_size, n_mel_channels, bias=True)
|
||||
|
||||
def forward(self, inputs: List[torch.Tensor], use_gt_durations: bool = True,
|
||||
use_gt_pitch: bool = True, pace: float = 1.0,
|
||||
max_duration: int = 75):
|
||||
inputs, _, mel_tgt, _, dur_tgt, _, pitch_tgt = inputs
|
||||
mel_max_len = mel_tgt.size(2)
|
||||
|
||||
# Input FFT
|
||||
enc_out, enc_mask = self.encoder(inputs)
|
||||
|
||||
# Embedded for predictors
|
||||
pred_enc_out, pred_enc_mask = enc_out, enc_mask
|
||||
|
||||
# Predict durations
|
||||
log_dur_pred = self.duration_predictor(pred_enc_out, pred_enc_mask)
|
||||
dur_pred = torch.clamp(torch.exp(log_dur_pred) - 1, 0, max_duration)
|
||||
|
||||
# Predict pitch
|
||||
pitch_pred = self.pitch_predictor(enc_out, enc_mask)
|
||||
|
||||
if use_gt_pitch and pitch_tgt is not None:
|
||||
pitch_emb = self.pitch_emb(pitch_tgt.unsqueeze(1))
|
||||
else:
|
||||
pitch_emb = self.pitch_emb(pitch_pred.unsqueeze(1))
|
||||
enc_out = enc_out + pitch_emb.transpose(1, 2)
|
||||
|
||||
len_regulated, dec_lens = regulate_len(
|
||||
dur_tgt if use_gt_durations else dur_pred,
|
||||
enc_out, pace, mel_max_len)
|
||||
|
||||
# Output FFT
|
||||
dec_out, dec_mask = self.decoder(len_regulated, dec_lens)
|
||||
mel_out = self.proj(dec_out)
|
||||
return mel_out, dec_mask, dur_pred, log_dur_pred, pitch_pred
|
||||
|
||||
def infer(self, inputs, input_lens, pace: float = 1.0,
|
||||
dur_tgt: Optional[torch.Tensor] = None,
|
||||
pitch_tgt: Optional[torch.Tensor] = None,
|
||||
max_duration: float = 75):
|
||||
|
||||
# Input FFT
|
||||
enc_out, enc_mask = self.encoder(inputs)
|
||||
|
||||
# Embedded for predictors
|
||||
pred_enc_out, pred_enc_mask = enc_out, enc_mask
|
||||
|
||||
# Predict durations
|
||||
log_dur_pred = self.duration_predictor(pred_enc_out, pred_enc_mask)
|
||||
dur_pred = torch.clamp(torch.exp(log_dur_pred) - 1, 0, max_duration)
|
||||
|
||||
# Pitch over chars
|
||||
pitch_pred = self.pitch_predictor(enc_out, enc_mask)
|
||||
|
||||
if pitch_tgt is None:
|
||||
pitch_emb = self.pitch_emb(pitch_pred.unsqueeze(1)).transpose(1, 2)
|
||||
else:
|
||||
pitch_emb = self.pitch_emb(pitch_tgt.unsqueeze(1)).transpose(1, 2)
|
||||
|
||||
enc_out = enc_out + pitch_emb
|
||||
|
||||
len_regulated, dec_lens = regulate_len(
|
||||
dur_pred if dur_tgt is None else dur_tgt,
|
||||
enc_out, pace, mel_max_len=None)
|
||||
|
||||
dec_out, dec_mask = self.decoder(len_regulated, dec_lens)
|
||||
mel_out = self.proj(dec_out)
|
||||
# mel_lens = dec_mask.squeeze(2).sum(axis=1).long()
|
||||
mel_out = mel_out.permute(0, 2, 1) # For inference.py
|
||||
return mel_out, dec_lens, dur_pred, pitch_pred
|
292
PyTorch/SpeechSynthesis/FastPitch/fastpitch/transformer.py
Normal file
292
PyTorch/SpeechSynthesis/FastPitch/fastpitch/transformer.py
Normal file
|
@ -0,0 +1,292 @@
|
|||
# Copyright (c) 2019 NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
import torch.nn.functional as F
|
||||
|
||||
from common.utils import mask_from_lens
|
||||
from common.text.symbols import pad_idx, symbols
|
||||
|
||||
|
||||
class PositionalEmbedding(nn.Module):
|
||||
def __init__(self, demb):
|
||||
super(PositionalEmbedding, self).__init__()
|
||||
self.demb = demb
|
||||
inv_freq = 1 / (10000 ** (torch.arange(0.0, demb, 2.0) / demb))
|
||||
self.register_buffer('inv_freq', inv_freq)
|
||||
|
||||
def forward(self, pos_seq, bsz=None):
|
||||
sinusoid_inp = torch.ger(pos_seq, self.inv_freq)
|
||||
pos_emb = torch.cat([sinusoid_inp.sin(), sinusoid_inp.cos()], dim=-1)
|
||||
if bsz is not None:
|
||||
return pos_emb[None, :, :].expand(bsz, -1, -1)
|
||||
else:
|
||||
return pos_emb[None, :, :]
|
||||
|
||||
|
||||
class PositionwiseFF(nn.Module):
|
||||
def __init__(self, d_model, d_inner, dropout, pre_lnorm=False):
|
||||
super(PositionwiseFF, self).__init__()
|
||||
|
||||
self.d_model = d_model
|
||||
self.d_inner = d_inner
|
||||
self.dropout = dropout
|
||||
|
||||
self.CoreNet = nn.Sequential(
|
||||
nn.Linear(d_model, d_inner), nn.ReLU(),
|
||||
nn.Dropout(dropout),
|
||||
nn.Linear(d_inner, d_model),
|
||||
nn.Dropout(dropout),
|
||||
)
|
||||
|
||||
self.layer_norm = nn.LayerNorm(d_model)
|
||||
self.pre_lnorm = pre_lnorm
|
||||
|
||||
def forward(self, inp):
|
||||
if self.pre_lnorm:
|
||||
# layer normalization + positionwise feed-forward
|
||||
core_out = self.CoreNet(self.layer_norm(inp))
|
||||
|
||||
# residual connection
|
||||
output = core_out + inp
|
||||
else:
|
||||
# positionwise feed-forward
|
||||
core_out = self.CoreNet(inp)
|
||||
|
||||
# residual connection + layer normalization
|
||||
output = self.layer_norm(inp + core_out)
|
||||
|
||||
return output
|
||||
|
||||
|
||||
class PositionwiseConvFF(nn.Module):
|
||||
def __init__(self, d_model, d_inner, kernel_size, dropout, pre_lnorm=False):
|
||||
super(PositionwiseConvFF, self).__init__()
|
||||
|
||||
self.d_model = d_model
|
||||
self.d_inner = d_inner
|
||||
self.dropout = dropout
|
||||
|
||||
self.CoreNet = nn.Sequential(
|
||||
nn.Conv1d(d_model, d_inner, kernel_size, 1, (kernel_size // 2)),
|
||||
nn.ReLU(),
|
||||
# nn.Dropout(dropout), # worse convergence
|
||||
nn.Conv1d(d_inner, d_model, kernel_size, 1, (kernel_size // 2)),
|
||||
nn.Dropout(dropout),
|
||||
)
|
||||
self.layer_norm = nn.LayerNorm(d_model)
|
||||
self.pre_lnorm = pre_lnorm
|
||||
|
||||
def forward(self, inp):
|
||||
return self._forward(inp)
|
||||
|
||||
def _forward(self, inp):
|
||||
if self.pre_lnorm:
|
||||
# layer normalization + positionwise feed-forward
|
||||
core_out = inp.transpose(1, 2)
|
||||
core_out = self.CoreNet(self.layer_norm(core_out))
|
||||
core_out = core_out.transpose(1, 2)
|
||||
|
||||
# residual connection
|
||||
output = core_out + inp
|
||||
else:
|
||||
# positionwise feed-forward
|
||||
core_out = inp.transpose(1, 2)
|
||||
core_out = self.CoreNet(core_out)
|
||||
core_out = core_out.transpose(1, 2)
|
||||
|
||||
# residual connection + layer normalization
|
||||
output = self.layer_norm(inp + core_out)
|
||||
|
||||
return output
|
||||
|
||||
|
||||
class MultiHeadAttn(nn.Module):
|
||||
def __init__(self, n_head, d_model, d_head, dropout, dropatt=0.1,
|
||||
pre_lnorm=False):
|
||||
super(MultiHeadAttn, self).__init__()
|
||||
|
||||
self.n_head = n_head
|
||||
self.d_model = d_model
|
||||
self.d_head = d_head
|
||||
self.scale = 1 / (d_head ** 0.5)
|
||||
self.pre_lnorm = pre_lnorm
|
||||
|
||||
self.qkv_net = nn.Linear(d_model, 3 * n_head * d_head)
|
||||
self.drop = nn.Dropout(dropout)
|
||||
self.dropatt = nn.Dropout(dropatt)
|
||||
self.o_net = nn.Linear(n_head * d_head, d_model, bias=False)
|
||||
self.layer_norm = nn.LayerNorm(d_model)
|
||||
|
||||
def forward(self, inp, attn_mask=None):
|
||||
return self._forward(inp, attn_mask)
|
||||
|
||||
def _forward(self, inp, attn_mask=None):
|
||||
residual = inp
|
||||
|
||||
if self.pre_lnorm:
|
||||
# layer normalization
|
||||
inp = self.layer_norm(inp)
|
||||
|
||||
n_head, d_head = self.n_head, self.d_head
|
||||
|
||||
head_q, head_k, head_v = torch.chunk(self.qkv_net(inp), 3, dim=-1)
|
||||
head_q = head_q.view(inp.size(0), inp.size(1), n_head, d_head)
|
||||
head_k = head_k.view(inp.size(0), inp.size(1), n_head, d_head)
|
||||
head_v = head_v.view(inp.size(0), inp.size(1), n_head, d_head)
|
||||
|
||||
q = head_q.permute(0, 2, 1, 3).reshape(-1, inp.size(1), d_head)
|
||||
k = head_k.permute(0, 2, 1, 3).reshape(-1, inp.size(1), d_head)
|
||||
v = head_v.permute(0, 2, 1, 3).reshape(-1, inp.size(1), d_head)
|
||||
|
||||
attn_score = torch.bmm(q, k.transpose(1, 2))
|
||||
attn_score.mul_(self.scale)
|
||||
|
||||
if attn_mask is not None:
|
||||
attn_mask = attn_mask.unsqueeze(1)
|
||||
attn_mask = attn_mask.repeat(n_head, attn_mask.size(2), 1)
|
||||
attn_score.masked_fill_(attn_mask, -float('inf'))
|
||||
|
||||
attn_prob = F.softmax(attn_score, dim=2)
|
||||
attn_prob = self.dropatt(attn_prob)
|
||||
attn_vec = torch.bmm(attn_prob, v)
|
||||
|
||||
attn_vec = attn_vec.view(n_head, inp.size(0), inp.size(1), d_head)
|
||||
attn_vec = attn_vec.permute(1, 2, 0, 3).contiguous().view(
|
||||
inp.size(0), inp.size(1), n_head * d_head)
|
||||
|
||||
# linear projection
|
||||
attn_out = self.o_net(attn_vec)
|
||||
attn_out = self.drop(attn_out)
|
||||
|
||||
if self.pre_lnorm:
|
||||
# residual connection
|
||||
output = residual + attn_out
|
||||
else:
|
||||
# residual connection + layer normalization
|
||||
output = self.layer_norm(residual + attn_out)
|
||||
|
||||
return output
|
||||
|
||||
# disabled; slower
|
||||
def forward_einsum(self, h, attn_mask=None):
|
||||
# multihead attention
|
||||
# [hlen x bsz x n_head x d_head]
|
||||
|
||||
c = h
|
||||
|
||||
if self.pre_lnorm:
|
||||
# layer normalization
|
||||
c = self.layer_norm(c)
|
||||
|
||||
head_q = self.q_net(h)
|
||||
head_k, head_v = torch.chunk(self.kv_net(c), 2, -1)
|
||||
|
||||
head_q = head_q.view(h.size(0), h.size(1), self.n_head, self.d_head)
|
||||
head_k = head_k.view(c.size(0), c.size(1), self.n_head, self.d_head)
|
||||
head_v = head_v.view(c.size(0), c.size(1), self.n_head, self.d_head)
|
||||
|
||||
# [bsz x n_head x qlen x klen]
|
||||
# attn_score = torch.einsum('ibnd,jbnd->bnij', (head_q, head_k))
|
||||
attn_score = torch.einsum('bind,bjnd->bnij', (head_q, head_k))
|
||||
attn_score.mul_(self.scale)
|
||||
if attn_mask is not None and attn_mask.any().item():
|
||||
attn_score.masked_fill_(attn_mask[:, None, None, :], -float('inf'))
|
||||
|
||||
# [bsz x qlen x klen x n_head]
|
||||
attn_prob = F.softmax(attn_score, dim=3)
|
||||
attn_prob = self.dropatt(attn_prob)
|
||||
|
||||
# [bsz x n_head x qlen x klen] * [klen x bsz x n_head x d_head]
|
||||
# -> [qlen x bsz x n_head x d_head]
|
||||
attn_vec = torch.einsum('bnij,bjnd->bind', (attn_prob, head_v))
|
||||
attn_vec = attn_vec.contiguous().view(
|
||||
attn_vec.size(0), attn_vec.size(1), self.n_head * self.d_head)
|
||||
|
||||
# linear projection
|
||||
attn_out = self.o_net(attn_vec)
|
||||
attn_out = self.drop(attn_out)
|
||||
|
||||
if self.pre_lnorm:
|
||||
# residual connection
|
||||
output = h + attn_out
|
||||
else:
|
||||
# residual connection + layer normalization
|
||||
output = self.layer_norm(h + attn_out)
|
||||
|
||||
return output
|
||||
|
||||
|
||||
class TransformerLayer(nn.Module):
|
||||
def __init__(self, n_head, d_model, d_head, d_inner, kernel_size, dropout,
|
||||
**kwargs):
|
||||
super(TransformerLayer, self).__init__()
|
||||
|
||||
self.dec_attn = MultiHeadAttn(n_head, d_model, d_head, dropout, **kwargs)
|
||||
self.pos_ff = PositionwiseConvFF(d_model, d_inner, kernel_size, dropout,
|
||||
pre_lnorm=kwargs.get('pre_lnorm'))
|
||||
|
||||
def forward(self, dec_inp, mask=None):
|
||||
output = self.dec_attn(dec_inp, attn_mask=~mask.squeeze(2))
|
||||
output *= mask
|
||||
output = self.pos_ff(output)
|
||||
output *= mask
|
||||
return output
|
||||
|
||||
|
||||
class FFTransformer(nn.Module):
|
||||
def __init__(self, n_layer, n_head, d_model, d_head, d_inner, kernel_size,
|
||||
dropout, dropatt, dropemb=0.0, embed_input=True, d_embed=None,
|
||||
pre_lnorm=False):
|
||||
super(FFTransformer, self).__init__()
|
||||
self.d_model = d_model
|
||||
self.n_head = n_head
|
||||
self.d_head = d_head
|
||||
|
||||
if embed_input:
|
||||
self.word_emb = nn.Embedding(len(symbols), d_embed or d_model,
|
||||
padding_idx=pad_idx)
|
||||
else:
|
||||
self.word_emb = None
|
||||
|
||||
self.pos_emb = PositionalEmbedding(self.d_model)
|
||||
self.drop = nn.Dropout(dropemb)
|
||||
self.layers = nn.ModuleList()
|
||||
|
||||
for _ in range(n_layer):
|
||||
self.layers.append(
|
||||
TransformerLayer(
|
||||
n_head, d_model, d_head, d_inner, kernel_size, dropout,
|
||||
dropatt=dropatt, pre_lnorm=pre_lnorm)
|
||||
)
|
||||
|
||||
def forward(self, dec_inp, seq_lens=None):
|
||||
if self.word_emb is None:
|
||||
inp = dec_inp
|
||||
mask = mask_from_lens(seq_lens).unsqueeze(2)
|
||||
else:
|
||||
inp = self.word_emb(dec_inp)
|
||||
# [bsz x L x 1]
|
||||
mask = (dec_inp != pad_idx).unsqueeze(2)
|
||||
|
||||
pos_seq = torch.arange(inp.size(1), device=inp.device, dtype=inp.dtype)
|
||||
pos_emb = self.pos_emb(pos_seq) * mask
|
||||
out = self.drop(inp + pos_emb)
|
||||
|
||||
for layer in self.layers:
|
||||
out = layer(out, mask=mask)
|
||||
|
||||
# out = self.drop(out)
|
||||
return out, mask
|
304
PyTorch/SpeechSynthesis/FastPitch/fastpitch/transformer_jit.py
Normal file
304
PyTorch/SpeechSynthesis/FastPitch/fastpitch/transformer_jit.py
Normal file
|
@ -0,0 +1,304 @@
|
|||
# Copyright (c) 2019 NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from typing import List, Optional
|
||||
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
import torch.nn.functional as F
|
||||
|
||||
from common.utils import mask_from_lens
|
||||
from common.text.symbols import pad_idx, symbols
|
||||
|
||||
|
||||
class NoOp(nn.Module):
|
||||
def forward(self, x):
|
||||
return x
|
||||
|
||||
|
||||
class PositionalEmbedding(nn.Module):
|
||||
def __init__(self, demb):
|
||||
super(PositionalEmbedding, self).__init__()
|
||||
self.demb = demb
|
||||
inv_freq = 1 / (10000 ** (torch.arange(0.0, demb, 2.0) / demb))
|
||||
self.register_buffer('inv_freq', inv_freq)
|
||||
|
||||
def forward(self, pos_seq, bsz: Optional[int] = None):
|
||||
sinusoid_inp = torch.ger(pos_seq, self.inv_freq)
|
||||
pos_emb = torch.cat([sinusoid_inp.sin(), sinusoid_inp.cos()], dim=-1)
|
||||
if bsz is not None:
|
||||
return pos_emb[None, :, :].expand(bsz, -1, -1)
|
||||
else:
|
||||
return pos_emb[None, :, :]
|
||||
|
||||
|
||||
class PositionwiseFF(nn.Module):
|
||||
def __init__(self, d_model, d_inner, dropout, pre_lnorm=False):
|
||||
super(PositionwiseFF, self).__init__()
|
||||
|
||||
self.d_model = d_model
|
||||
self.d_inner = d_inner
|
||||
self.dropout = dropout
|
||||
|
||||
self.CoreNet = nn.Sequential(
|
||||
nn.Linear(d_model, d_inner), nn.ReLU(),
|
||||
nn.Dropout(dropout),
|
||||
nn.Linear(d_inner, d_model),
|
||||
nn.Dropout(dropout),
|
||||
)
|
||||
|
||||
self.layer_norm = nn.LayerNorm(d_model)
|
||||
self.pre_lnorm = pre_lnorm
|
||||
|
||||
def forward(self, inp):
|
||||
if self.pre_lnorm:
|
||||
# layer normalization + positionwise feed-forward
|
||||
core_out = self.CoreNet(self.layer_norm(inp))
|
||||
|
||||
# residual connection
|
||||
output = core_out + inp
|
||||
else:
|
||||
# positionwise feed-forward
|
||||
core_out = self.CoreNet(inp)
|
||||
|
||||
# residual connection + layer normalization
|
||||
output = self.layer_norm(inp + core_out)
|
||||
|
||||
return output
|
||||
|
||||
|
||||
class PositionwiseConvFF(nn.Module):
|
||||
def __init__(self, d_model, d_inner, kernel_size, dropout, pre_lnorm=False):
|
||||
super(PositionwiseConvFF, self).__init__()
|
||||
|
||||
self.d_model = d_model
|
||||
self.d_inner = d_inner
|
||||
self.dropout = dropout
|
||||
|
||||
self.CoreNet = nn.Sequential(
|
||||
nn.Conv1d(d_model, d_inner, kernel_size, 1, (kernel_size // 2)),
|
||||
nn.ReLU(),
|
||||
# nn.Dropout(dropout), # worse convergence
|
||||
nn.Conv1d(d_inner, d_model, kernel_size, 1, (kernel_size // 2)),
|
||||
nn.Dropout(dropout),
|
||||
)
|
||||
self.layer_norm = nn.LayerNorm(d_model)
|
||||
self.pre_lnorm = pre_lnorm
|
||||
|
||||
def forward(self, inp):
|
||||
if self.pre_lnorm:
|
||||
# layer normalization + positionwise feed-forward
|
||||
core_out = inp.transpose(1, 2)
|
||||
core_out = self.CoreNet(self.layer_norm(core_out))
|
||||
core_out = core_out.transpose(1, 2)
|
||||
|
||||
# residual connection
|
||||
output = core_out + inp
|
||||
else:
|
||||
# positionwise feed-forward
|
||||
core_out = inp.transpose(1, 2)
|
||||
core_out = self.CoreNet(core_out)
|
||||
core_out = core_out.transpose(1, 2)
|
||||
|
||||
# residual connection + layer normalization
|
||||
output = self.layer_norm(inp + core_out)
|
||||
|
||||
return output
|
||||
|
||||
|
||||
class MultiHeadAttn(nn.Module):
|
||||
def __init__(self, n_head, d_model, d_head, dropout, dropatt=0.1,
|
||||
pre_lnorm=False):
|
||||
super(MultiHeadAttn, self).__init__()
|
||||
|
||||
self.n_head = n_head
|
||||
self.d_model = d_model
|
||||
self.d_head = d_head
|
||||
self.scale = 1 / (d_head ** 0.5)
|
||||
self.dropout = dropout
|
||||
self.pre_lnorm = pre_lnorm
|
||||
|
||||
self.qkv_net = nn.Linear(d_model, 3 * n_head * d_head)
|
||||
self.drop = nn.Dropout(dropout)
|
||||
self.dropatt = nn.Dropout(dropatt)
|
||||
self.o_net = nn.Linear(n_head * d_head, d_model, bias=False)
|
||||
self.layer_norm = nn.LayerNorm(d_model)
|
||||
|
||||
|
||||
def forward(self, inp, attn_mask: Optional[torch.Tensor] = None):
|
||||
residual = inp
|
||||
|
||||
if self.pre_lnorm:
|
||||
# layer normalization
|
||||
inp = self.layer_norm(inp)
|
||||
|
||||
n_head, d_head = self.n_head, self.d_head
|
||||
|
||||
head_q, head_k, head_v = torch.chunk(self.qkv_net(inp), 3, dim=-1)
|
||||
head_q = head_q.view(inp.size(0), inp.size(1), n_head, d_head)
|
||||
head_k = head_k.view(inp.size(0), inp.size(1), n_head, d_head)
|
||||
head_v = head_v.view(inp.size(0), inp.size(1), n_head, d_head)
|
||||
|
||||
q = head_q.permute(0, 2, 1, 3).reshape(-1, inp.size(1), d_head)
|
||||
k = head_k.permute(0, 2, 1, 3).reshape(-1, inp.size(1), d_head)
|
||||
v = head_v.permute(0, 2, 1, 3).reshape(-1, inp.size(1), d_head)
|
||||
|
||||
attn_score = torch.bmm(q, k.transpose(1, 2))
|
||||
attn_score.mul_(self.scale)
|
||||
|
||||
if attn_mask is not None:
|
||||
attn_mask = attn_mask.unsqueeze(1)
|
||||
attn_mask = attn_mask.repeat(n_head, attn_mask.size(2), 1)
|
||||
attn_score.masked_fill_(attn_mask, -float('inf'))
|
||||
|
||||
attn_prob = F.softmax(attn_score, dim=2)
|
||||
attn_prob = self.dropatt(attn_prob)
|
||||
attn_vec = torch.bmm(attn_prob, v)
|
||||
|
||||
attn_vec = attn_vec.view(n_head, inp.size(0), inp.size(1), d_head)
|
||||
attn_vec = attn_vec.permute(1, 2, 0, 3).contiguous().view(
|
||||
inp.size(0), inp.size(1), n_head * d_head)
|
||||
|
||||
# linear projection
|
||||
attn_out = self.o_net(attn_vec)
|
||||
attn_out = self.drop(attn_out)
|
||||
|
||||
if self.pre_lnorm:
|
||||
# residual connection
|
||||
output = residual + attn_out
|
||||
else:
|
||||
# residual connection + layer normalization
|
||||
|
||||
# XXX Running TorchScript on 20.02 and 20.03 containers crashes here
|
||||
# XXX Works well with 20.01-py3 container.
|
||||
# XXX dirty fix is:
|
||||
# XXX output = self.layer_norm(residual + attn_out).half()
|
||||
output = self.layer_norm(residual + attn_out)
|
||||
|
||||
return output
|
||||
|
||||
# disabled; slower
|
||||
def forward_einsum(self, h, attn_mask=None):
|
||||
# multihead attention
|
||||
# [hlen x bsz x n_head x d_head]
|
||||
|
||||
c = h
|
||||
|
||||
if self.pre_lnorm:
|
||||
# layer normalization
|
||||
c = self.layer_norm(c)
|
||||
|
||||
head_q = self.q_net(h)
|
||||
head_k, head_v = torch.chunk(self.kv_net(c), 2, -1)
|
||||
|
||||
head_q = head_q.view(h.size(0), h.size(1), self.n_head, self.d_head)
|
||||
head_k = head_k.view(c.size(0), c.size(1), self.n_head, self.d_head)
|
||||
head_v = head_v.view(c.size(0), c.size(1), self.n_head, self.d_head)
|
||||
|
||||
# [bsz x n_head x qlen x klen]
|
||||
# attn_score = torch.einsum('ibnd,jbnd->bnij', (head_q, head_k))
|
||||
attn_score = torch.einsum('bind,bjnd->bnij', (head_q, head_k))
|
||||
attn_score.mul_(self.scale)
|
||||
if attn_mask is not None and attn_mask.any().item():
|
||||
attn_score.masked_fill_(attn_mask[:, None, None, :], -float('inf'))
|
||||
|
||||
# [bsz x qlen x klen x n_head]
|
||||
attn_prob = F.softmax(attn_score, dim=3)
|
||||
attn_prob = self.dropatt(attn_prob)
|
||||
|
||||
# [bsz x n_head x qlen x klen] * [klen x bsz x n_head x d_head]
|
||||
# -> [qlen x bsz x n_head x d_head]
|
||||
attn_vec = torch.einsum('bnij,bjnd->bind', (attn_prob, head_v))
|
||||
attn_vec = attn_vec.contiguous().view(
|
||||
attn_vec.size(0), attn_vec.size(1), self.n_head * self.d_head)
|
||||
|
||||
# linear projection
|
||||
attn_out = self.o_net(attn_vec)
|
||||
attn_out = self.drop(attn_out)
|
||||
|
||||
if self.pre_lnorm:
|
||||
# residual connection
|
||||
output = h + attn_out
|
||||
else:
|
||||
# residual connection + layer normalization
|
||||
output = self.layer_norm(h + attn_out)
|
||||
|
||||
return output
|
||||
|
||||
|
||||
class TransformerLayer(nn.Module):
|
||||
def __init__(self, n_head, d_model, d_head, d_inner, kernel_size, dropout,
|
||||
**kwargs):
|
||||
super(TransformerLayer, self).__init__()
|
||||
|
||||
self.dec_attn = MultiHeadAttn(n_head, d_model, d_head, dropout, **kwargs)
|
||||
self.pos_ff = PositionwiseConvFF(d_model, d_inner, kernel_size, dropout,
|
||||
pre_lnorm=kwargs.get('pre_lnorm'))
|
||||
|
||||
def forward(self, dec_inp, mask):
|
||||
output = self.dec_attn(dec_inp, attn_mask=~mask.squeeze(2))
|
||||
output *= mask
|
||||
output = self.pos_ff(output)
|
||||
output *= mask
|
||||
return output
|
||||
|
||||
|
||||
class FFTransformer(nn.Module):
|
||||
pad_idx = 0 # XXX
|
||||
|
||||
def __init__(self, n_layer, n_head, d_model, d_head, d_inner, kernel_size,
|
||||
dropout, dropatt, dropemb=0.0, embed_input=True, d_embed=None,
|
||||
pre_lnorm=False):
|
||||
super(FFTransformer, self).__init__()
|
||||
self.d_model = d_model
|
||||
self.n_head = n_head
|
||||
self.d_head = d_head
|
||||
|
||||
self.embed_input = embed_input
|
||||
if embed_input:
|
||||
self.word_emb = nn.Embedding(len(symbols), d_embed or d_model,
|
||||
padding_idx=FFTransformer.pad_idx)
|
||||
else:
|
||||
self.word_emb = NoOp()
|
||||
|
||||
self.pos_emb = PositionalEmbedding(self.d_model)
|
||||
self.drop = nn.Dropout(dropemb)
|
||||
self.layers = nn.ModuleList()
|
||||
|
||||
for _ in range(n_layer):
|
||||
self.layers.append(
|
||||
TransformerLayer(
|
||||
n_head, d_model, d_head, d_inner, kernel_size, dropout,
|
||||
dropatt=dropatt, pre_lnorm=pre_lnorm)
|
||||
)
|
||||
|
||||
def forward(self, dec_inp, seq_lens: Optional[torch.Tensor] = None):
|
||||
if self.embed_input:
|
||||
inp = self.word_emb(dec_inp)
|
||||
# [bsz x L x 1]
|
||||
# mask = (dec_inp != FFTransformer.pad_idx).unsqueeze(2)
|
||||
mask = (dec_inp != 0).unsqueeze(2)
|
||||
else:
|
||||
inp = dec_inp
|
||||
assert seq_lens is not None
|
||||
mask = mask_from_lens(seq_lens).unsqueeze(2)
|
||||
pos_seq = torch.arange(inp.size(1), device=inp.device, dtype=inp.dtype)
|
||||
pos_emb = self.pos_emb(pos_seq) * mask
|
||||
out = self.drop(inp + pos_emb)
|
||||
|
||||
for layer in self.layers:
|
||||
out = layer(out, mask=mask)
|
||||
|
||||
# out = self.drop(out)
|
||||
return out, mask
|
|
@ -0,0 +1,500 @@
|
|||
wavs/LJ045-0096.wav|Mrs. De Mohrenschildt thought that Oswald,
|
||||
wavs/LJ049-0022.wav|The Secret Service believed that it was very doubtful that any President would ride regularly in a vehicle with a fixed top, even though transparent.
|
||||
wavs/LJ033-0042.wav|Between the hours of eight and nine p.m. they were occupied with the children in the bedrooms located at the extreme east end of the house.
|
||||
wavs/LJ016-0117.wav|The prisoner had nothing to deal with but wooden panels, and by dint of cutting and chopping he got both the lower panels out.
|
||||
wavs/LJ025-0157.wav|Under these circumstances, unnatural as they are, with proper management, the bean will thrust forth its radicle and its plumule;
|
||||
wavs/LJ042-0219.wav|Oswald demonstrated his thinking in connection with his return to the United States by preparing two sets of identical questions of the type which he might have thought
|
||||
wavs/LJ032-0164.wav|it is not possible to state with scientific certainty that a particular small group of fibers come from a certain piece of clothing
|
||||
wavs/LJ046-0092.wav|has confidence in the dedicated Secret Service men who are ready to lay down their lives for him
|
||||
wavs/LJ050-0118.wav|Since these agencies are already obliged constantly to evaluate the activities of such groups,
|
||||
wavs/LJ043-0016.wav|Jeanne De Mohrenschildt said, quote,
|
||||
wavs/LJ021-0078.wav|no economic panacea, which could simply revive over-night the heavy industries and the trades dependent upon them.
|
||||
wavs/LJ039-0148.wav|Examination of the cartridge cases found on the sixth floor of the Depository Building
|
||||
wavs/LJ047-0202.wav|testified that the information available to the Federal Government about Oswald before the assassination would, if known to PRS,
|
||||
wavs/LJ023-0056.wav|It is an easy document to understand when you remember that it was called into being
|
||||
wavs/LJ021-0025.wav|And in many directions, the intervention of that organized control which we call government
|
||||
wavs/LJ030-0105.wav|Communications in the motorcade.
|
||||
wavs/LJ021-0012.wav|with respect to industry and business, but nearly all are agreed that private enterprise in times such as these
|
||||
wavs/LJ019-0169.wav|and one or two men were allowed to mend clothes and make shoes. The rules made by the Secretary of State were hung up in conspicuous parts of the prison;
|
||||
wavs/LJ039-0088.wav|It just is an aid in seeing in the fact that you only have the one element, the crosshair,
|
||||
wavs/LJ016-0192.wav|"I think I could do that sort of job," said Calcraft, on the spur of the moment.
|
||||
wavs/LJ014-0142.wav|was strewn in front of the dock, and sprinkled it towards the bench with a contemptuous gesture.
|
||||
wavs/LJ012-0015.wav|Weedon and Lecasser to twelve and six months respectively in Coldbath Fields.
|
||||
wavs/LJ048-0033.wav|Prior to November twenty-two, nineteen sixty-three
|
||||
wavs/LJ028-0349.wav|who were each required to send so large a number to Babylon, that in all there were collected no fewer than fifty thousand.
|
||||
wavs/LJ030-0197.wav|At first Mrs. Connally thought that her husband had been killed,
|
||||
wavs/LJ017-0133.wav|Palmer speedily found imitators.
|
||||
wavs/LJ034-0123.wav|Although Brennan testified that the man in the window was standing when he fired the shots, most probably he was either sitting or kneeling.
|
||||
wavs/LJ003-0282.wav|Many years were to elapse before these objections should be fairly met and universally overcome.
|
||||
wavs/LJ032-0204.wav|Special Agent Lyndal L. Shaneyfelt, a photography expert with the FBI,
|
||||
wavs/LJ016-0241.wav|Calcraft served the city of London till eighteen seventy-four, when he was pensioned at the rate of twenty-five shillings per week.
|
||||
wavs/LJ023-0033.wav|we will not allow ourselves to run around in new circles of futile discussion and debate, always postponing the day of decision.
|
||||
wavs/LJ009-0286.wav|There has never been much science in the system of carrying out the extreme penalty in this country; the "finisher of the law"
|
||||
wavs/LJ008-0181.wav|he had his pockets filled with bread and cheese, and it was generally supposed that he had come a long distance to see the fatal show.
|
||||
wavs/LJ015-0052.wav|to the value of twenty thousand pounds.
|
||||
wavs/LJ016-0314.wav|Sir George Grey thought there was a growing feeling in favor of executions within the prison precincts.
|
||||
wavs/LJ047-0056.wav|From August nineteen sixty-two
|
||||
wavs/LJ010-0027.wav|Nor did the methods by which they were perpetrated greatly vary from those in times past.
|
||||
wavs/LJ010-0065.wav|At the former the "Provisional Government" was to be established,
|
||||
wavs/LJ046-0113.wav|The Commission has concluded that at the time of the assassination
|
||||
wavs/LJ028-0410.wav|There among the ruins they still live in the same kind of houses,
|
||||
wavs/LJ044-0137.wav|More seriously, the facts of his defection had become known, leaving him open to almost unanswerable attack by those who opposed his views.
|
||||
wavs/LJ008-0215.wav|One by one the huge uprights of black timber were fitted together,
|
||||
wavs/LJ030-0084.wav|or when the press of the crowd made it impossible for the escort motorcycles to stay in position on the car's rear flanks.
|
||||
wavs/LJ020-0092.wav|Have yourself called on biscuit mornings an hour earlier than usual.
|
||||
wavs/LJ029-0096.wav|On November fourteen, Lawson and Sorrels attended a meeting at Love Field
|
||||
wavs/LJ015-0308.wav|and others who swore to the meetings of the conspirators and their movements. Saward was found guilty,
|
||||
wavs/LJ012-0067.wav|But Mrs. Solomons could not resist the temptation to dabble in stolen goods, and she was found shipping watches of the wrong category to New York.
|
||||
wavs/LJ018-0231.wav|namely, to suppress it and substitute another.
|
||||
wavs/LJ014-0265.wav|and later he became manager of the newly rebuilt Olympic at Wych Street.
|
||||
wavs/LJ024-0102.wav|would be the first to exclaim as soon as an amendment was proposed
|
||||
wavs/LJ007-0233.wav|it consists of several circular perforations, about two inches in diameter,
|
||||
wavs/LJ013-0213.wav|This seems to have decided Courvoisier,
|
||||
wavs/LJ032-0045.wav|This price included nineteen dollars, ninety-five cents for the rifle and the scope, and one dollar, fifty cents for postage and handling.
|
||||
wavs/LJ011-0048.wav|Wherefore let him that thinketh he standeth take heed lest he fall," and was full of the most pointed allusions to the culprit.
|
||||
wavs/LJ005-0294.wav|It was frequently stated in evidence that the jail of the borough was in so unfit a state for the reception of prisoners,
|
||||
wavs/LJ016-0007.wav|There were others less successful.
|
||||
wavs/LJ028-0138.wav|perhaps the tales that travelers told him were exaggerated as travelers' tales are likely to be,
|
||||
wavs/LJ050-0029.wav|that is reflected in definite and comprehensive operating procedures.
|
||||
wavs/LJ014-0121.wav|The prisoners were in due course transferred to Newgate, to be put upon their trial at the Central Criminal Court.
|
||||
wavs/LJ014-0146.wav|They had to handcuff her by force against the most violent resistance, and still she raged and stormed,
|
||||
wavs/LJ046-0111.wav|The Secret Service has attempted to perform this function through the activities of its Protective Research Section
|
||||
wavs/LJ012-0257.wav|But the affair still remained a profound mystery. No light was thrown upon it till, towards the end of March,
|
||||
wavs/LJ002-0260.wav|Yet the public opinion of the whole body seems to have checked dissipation.
|
||||
wavs/LJ031-0014.wav|the Presidential limousine arrived at the emergency entrance of the Parkland Hospital at about twelve:thirty-five p.m.
|
||||
wavs/LJ047-0093.wav|Oswald was arrested and jailed by the New Orleans Police Department for disturbing the peace, in connection with a street fight which broke out when he was accosted
|
||||
wavs/LJ003-0324.wav|gaming of all sorts should be peremptorily forbidden under heavy pains and penalties.
|
||||
wavs/LJ021-0115.wav|we have reached into the heart of the problem which is to provide such annual earnings for the lowest paid worker as will meet his minimum needs.
|
||||
wavs/LJ046-0191.wav|it had established periodic regular review of the status of four hundred individuals;
|
||||
wavs/LJ034-0197.wav|who was one of the first witnesses to alert the police to the Depository as the source of the shots, as has been discussed in chapter three.
|
||||
wavs/LJ002-0253.wav|were governed by rules which they themselves had framed, and under which subscriptions were levied
|
||||
wavs/LJ048-0288.wav|might have been more alert in the Dallas motorcade if they had retired promptly in Fort Worth.
|
||||
wavs/LJ007-0112.wav|Many of the old customs once prevalent in the State Side, so properly condemned and abolished,
|
||||
wavs/LJ017-0189.wav|who was presently attacked in the same way as the others, but, but, thanks to the prompt administration of remedies, he recovered.
|
||||
wavs/LJ042-0230.wav|basically, although I hate the USSR and socialist system I still think marxism can work under different circumstances, end quote.
|
||||
wavs/LJ050-0161.wav|The Secret Service should not and does not plan to develop its own intelligence gathering facilities to duplicate the existing facilities of other Federal agencies.
|
||||
wavs/LJ003-0011.wav|that not more than one bottle of wine or one quart of beer could be issued at one time. No account was taken of the amount of liquors admitted in one day,
|
||||
wavs/LJ008-0206.wav|and caused a number of stout additional barriers to be erected in front of the scaffold,
|
||||
wavs/LJ002-0261.wav|The poorer prisoners were not in abject want, as in other prisons,
|
||||
wavs/LJ012-0189.wav|Hunt, in consideration of the information he had given, escaped death, and was sentenced to transportation for life.
|
||||
wavs/LJ019-0317.wav|The former, which consisted principally of the tread-wheel, cranks, capstans, shot-drill,
|
||||
wavs/LJ011-0041.wav|Visited Mr. Fauntleroy. My application for books for him not having been attended, I had no prayer-book to give him.
|
||||
wavs/LJ023-0089.wav|That is not only my accusation.
|
||||
wavs/LJ044-0224.wav|would not agree with that particular wording, end quote.
|
||||
wavs/LJ013-0104.wav|He found them at length residing at the latter place, one as a landed proprietor, the other as a publican.
|
||||
wavs/LJ013-0055.wav|The jury did not believe him, and the verdict was for the defendants.
|
||||
wavs/LJ014-0306.wav|These had been attributed to political action; some thought that the large purchases in foreign grains, effected at losing prices,
|
||||
wavs/LJ029-0052.wav|To supplement the PRS files, the Secret Service depends largely on local police departments and local offices of other Federal agencies
|
||||
wavs/LJ028-0459.wav|Its bricks, measuring about thirteen inches square and three inches in thickness, were burned and stamped with the usual short inscription:
|
||||
wavs/LJ017-0183.wav|Soon afterwards Dixon died, showing all the symptoms already described.
|
||||
wavs/LJ009-0084.wav|At length the ordinary pauses, and then, in a deep tone, which, though hardly above a whisper, is audible to all, says,
|
||||
wavs/LJ007-0170.wav|That in this vast metropolis, the center of wealth, civilization, and information;
|
||||
wavs/LJ016-0277.wav|This is proved by contemporary accounts, especially one graphic and realistic article which appeared in the 'Times,'
|
||||
wavs/LJ009-0061.wav|He staggers towards the pew, reels into it, stumbles forward, flings himself on the ground, and, by a curious twist of the spine,
|
||||
wavs/LJ019-0201.wav|to select a sufficiently spacious piece of ground, and erect a prison which from foundations to roofs should be in conformity with the newest ideas.
|
||||
wavs/LJ030-0063.wav|He had repeated this wish only a few days before, during his visit to Tampa, Florida.
|
||||
wavs/LJ010-0257.wav|a third miscreant made a similar but far less serious attempt in the month of July following.
|
||||
wavs/LJ009-0106.wav|The keeper tries to appear unmoved, but his eye wanders anxiously over the combustible assembly.
|
||||
wavs/LJ008-0121.wav|After the construction and action of the machine had been explained, the doctor asked the governor what kind of men he had commanded at Goree,
|
||||
wavs/LJ050-0069.wav|the Secret Service had received from the FBI some nine thousand reports on members of the Communist Party.
|
||||
wavs/LJ006-0202.wav|The news-vendor was also a tobacconist,
|
||||
wavs/LJ012-0230.wav|Shortly before the day fixed for execution, Bishop made a full confession, the bulk of which bore the impress of truth,
|
||||
wavs/LJ005-0248.wav|and stated that in his opinion Newgate, as the common jail of Middlesex, was wholly inadequate to the proper confinement of its prisoners.
|
||||
wavs/LJ037-0053.wav|who had been greatly upset by her experience, was able to view a lineup of four men handcuffed together at the police station.
|
||||
wavs/LJ045-0177.wav|For the first time
|
||||
wavs/LJ004-0036.wav|it was hoped that their rulers would hire accommodation in the county prisons, and that the inferior establishments would in course of time disappear.
|
||||
wavs/LJ026-0054.wav|carbohydrates (starch, cellulose) and fats.
|
||||
wavs/LJ020-0085.wav|Break apart from one another and pile on a plate, throwing a clean doily or a small napkin over them. Break open at table.
|
||||
wavs/LJ046-0226.wav|The several military intelligence agencies reported crank mail and similar threats involving the President.
|
||||
wavs/LJ014-0233.wav|he shot an old soldier who had attempted to detain him. He was convicted and executed.
|
||||
wavs/LJ033-0152.wav|The portion of the palm which was identified was the heel of the right palm, i.e., the area near the wrist, on the little finger side.
|
||||
wavs/LJ004-0009.wav|as indefatigable and self-sacrificing, found by personal visitation that the condition of jails throughout the kingdom was,
|
||||
wavs/LJ017-0134.wav|Within a few weeks occurred the Leeds poisoning case, in which the murderer undoubtedly was inspired by the facts made public at Palmer's trial.
|
||||
wavs/LJ019-0318.wav|was to be the rule for all convicted prisoners throughout the early stages of their detention;
|
||||
wavs/LJ020-0093.wav|Rise, wash face and hands, rinse the mouth out and brush back the hair.
|
||||
wavs/LJ012-0188.wav|Probert was then admitted as a witness, and the case was fully proved against Thurtell, who was hanged in front of Hertford Jail.
|
||||
wavs/LJ019-0202.wav|The preference given to the Pentonville system destroyed all hopes of a complete reformation of Newgate.
|
||||
wavs/LJ039-0027.wav|Oswald's revolver
|
||||
wavs/LJ040-0176.wav|He admitted to fantasies about being powerful and sometimes hurting and killing people, but refused to elaborate on them.
|
||||
wavs/LJ018-0354.wav|Doubts were long entertained whether Thomas Wainwright,
|
||||
wavs/LJ031-0185.wav|From the Presidential airplane, the Vice President telephoned Attorney General Robert F. Kennedy,
|
||||
wavs/LJ006-0137.wav|They were not obliged to attend chapel, and seldom if ever went; "prisoners," said one of them under examination, "did not like the trouble of going to chapel."
|
||||
wavs/LJ032-0085.wav|The Hidell signature on the notice of classification was in the handwriting of Oswald.
|
||||
wavs/LJ009-0037.wav|the schoolmaster and the juvenile prisoners being seated round the communion-table, opposite the pulpit.
|
||||
wavs/LJ006-0021.wav|Later on he had devoted himself to the personal investigation of the prisons of the United States.
|
||||
wavs/LJ006-0082.wav|and this particular official took excellent care to select as residents for his own ward those most suitable from his own point of view.
|
||||
wavs/LJ016-0380.wav|with hope to the last. There is always the chance of a flaw in the indictment, of a missing witness, or extenuating circumstances.
|
||||
wavs/LJ019-0344.wav|monitor, or schoolmaster, nor to be engaged in the service of any officer of the prison.
|
||||
wavs/LJ019-0161.wav|These disciplinary improvements were, however, only slowly and gradually introduced.
|
||||
wavs/LJ028-0145.wav|And here I may not omit to tell the use to which the mould dug out of the great moat was turned, nor the manner wherein the wall was wrought.
|
||||
wavs/LJ018-0349.wav|His disclaimer, distinct and detailed on every point, was intended simply for effect.
|
||||
wavs/LJ043-0010.wav|Some of the members of that group saw a good deal of the Oswalds through the fall of nineteen sixty-three,
|
||||
wavs/LJ027-0178.wav|These were undoubtedly perennibranchs. In the Permian and Triassic higher forms appeared, which were certainly caducibranch.
|
||||
wavs/LJ041-0070.wav|He did not rise above the rank of private first class, even though he had passed a qualifying examination for the rank of corporal.
|
||||
wavs/LJ008-0266.wav|Thus in the years between May first, eighteen twenty-seven, and thirtieth April, eighteen thirty-one,
|
||||
wavs/LJ021-0091.wav|In this recent reorganization we have recognized three distinct functions:
|
||||
wavs/LJ019-0129.wav|which marked the growth of public interest in prison affairs, and which was the germ of the new system
|
||||
wavs/LJ018-0215.wav|William Roupell was the eldest but illegitimate son of a wealthy man who subsequently married Roupell's mother, and had further legitimate issue.
|
||||
wavs/LJ015-0194.wav|and behaved so as to justify a belief that he had been a jail-bird all his life.
|
||||
wavs/LJ016-0137.wav|that numbers of men, "lifers," and others with ten, fourteen, or twenty years to do, can be trusted to work out of doors without bolts and bars
|
||||
wavs/LJ002-0289.wav|the latter raised eighteen pence among them to pay for a truss of straw for the poor woman to lie on.
|
||||
wavs/LJ023-0016.wav|In nineteen thirty-three you and I knew that we must never let our economic system get completely out of joint again
|
||||
wavs/LJ011-0141.wav|There were at the moment in Newgate six convicts sentenced to death for forging wills.
|
||||
wavs/LJ016-0283.wav|to do them mere justice, there was at least till then a half-drunken ribald gaiety among the crowd that made them all akin."
|
||||
wavs/LJ035-0082.wav|The only interval was the time necessary to ride in the elevator from the second to the sixth floor and walk back to the southeast corner.
|
||||
wavs/LJ045-0194.wav|Anyone who was familiar with that area of Dallas would have known that the motorcade would probably pass the Texas School Book Depository to get from Main Street
|
||||
wavs/LJ009-0124.wav|occupied when they saw it last, but a few hours ago, by their comrades who are now dead;
|
||||
wavs/LJ030-0162.wav|In the Presidential Limousine
|
||||
wavs/LJ050-0223.wav|The plan provides for an additional two hundred five agents for the Secret Service. Seventeen of this number are proposed for the Protective Research Section;
|
||||
wavs/LJ008-0228.wav|their harsh and half-cracked voices full of maudlin, besotted sympathy for those about to die.
|
||||
wavs/LJ002-0096.wav|The eight courts above enumerated were well supplied with water;
|
||||
wavs/LJ018-0288.wav|After this the other conspirators traveled to obtain genuine bills and master the system of the leading houses at home and abroad.
|
||||
wavs/LJ002-0106.wav|in which latterly a copper had been fixed for the cooking of provisions sent in by charitable persons.
|
||||
wavs/LJ025-0129.wav|On each lobe of the bi-lobed leaf of Venus flytrap are three delicate filaments which stand out at right angles from the surface of the leaf.
|
||||
wavs/LJ044-0013.wav|Hands Off Cuba, end quote, an application form for, and a membership card in,
|
||||
wavs/LJ049-0115.wav|of the person who is actually in the exercise of the executive power, or
|
||||
wavs/LJ019-0145.wav|But reformation was only skin deep. Below the surface many of the old evils still rankled.
|
||||
wavs/LJ019-0355.wav|came up in all respects to modern requirements.
|
||||
wavs/LJ019-0289.wav|There was unrestrained association of untried and convicted, juvenile with adult prisoners, vagrants, misdemeanants, felons.
|
||||
wavs/LJ048-0222.wav|in Fort Worth, there occurred a breach of discipline by some members of the Secret Service who were officially traveling with the President.
|
||||
wavs/LJ016-0367.wav|Under the new system the whole of the arrangements from first to last fell upon the officers.
|
||||
wavs/LJ047-0097.wav|Agent Quigley did not know of Oswald's prior FBI record when he interviewed him,
|
||||
wavs/LJ007-0075.wav|as effectually to rebuke and abash the profane spirit of the more insolent and daring of the criminals.
|
||||
wavs/LJ047-0022.wav|provided by other agencies.
|
||||
wavs/LJ007-0085.wav|at Newgate and York Castle as long as five years; "at Ilchester and Morpeth for seven years; at Warwick for eight years,
|
||||
wavs/LJ047-0075.wav|Hosty had inquired earlier and found no evidence that it was functioning in the Dallas area.
|
||||
wavs/LJ008-0098.wav|One was the "yeoman of the halter," a Newgate official, the executioner's assistant, whom Mr. J. T. Smith, who was present at the execution,
|
||||
wavs/LJ017-0102.wav|The second attack was fatal, and ended in Cook's death from tetanus.
|
||||
wavs/LJ046-0105.wav|Second, the adequacy of other advance preparations for the security of the President, during his visit to Dallas,
|
||||
wavs/LJ018-0206.wav|He was a tall, slender man, with a long face and iron-gray hair.
|
||||
wavs/LJ012-0271.wav|Whether it was greed or a quarrel that drove Greenacre to the desperate deed remains obscure.
|
||||
wavs/LJ005-0086.wav|with such further separation as the justices should deem conducive to good order and discipline.
|
||||
wavs/LJ042-0097.wav|and considerably better living quarters than those accorded to Soviet citizens of equal age and station.
|
||||
wavs/LJ047-0126.wav|we would handle it in due course, in accord with the whole context of the investigation. End quote.
|
||||
wavs/LJ041-0022.wav|Oswald first wrote, quote, Edward Vogel, end quote, an obvious misspelling of Voebel's name,
|
||||
wavs/LJ015-0025.wav|The bank enjoyed an excellent reputation, it had a good connection, and was supposed to be perfectly sound.
|
||||
wavs/LJ012-0194.wav|But Burke and Hare had their imitators further south,
|
||||
wavs/LJ028-0416.wav|(if man may speak so confidently of His great impenetrable counsels), for an eternal Testimony of His great work in the confusion of Man's pride,
|
||||
wavs/LJ007-0130.wav|are all huddled together without discrimination, oversight, or control."
|
||||
wavs/LJ015-0005.wav|About this time Davidson and Gordon, the people above-mentioned,
|
||||
wavs/LJ016-0125.wav|with this, placed against the wall near the chevaux-de-frise, he made an escalade.
|
||||
wavs/LJ014-0224.wav|As Dwyer survived, Cannon escaped the death sentence, which was commuted to penal servitude for life.
|
||||
wavs/LJ005-0019.wav|refuted by abundant evidence, and having no foundation whatever in truth.
|
||||
wavs/LJ042-0221.wav|With either great ambivalence, or cold calculation he prepared completely different answers to the same questions.
|
||||
wavs/LJ001-0063.wav|which was generally more formally Gothic than the printing of the German workmen,
|
||||
wavs/LJ030-0006.wav|They took off in the Presidential plane, Air Force One, at eleven a.m., arriving at San Antonio at one:thirty p.m., Eastern Standard Time.
|
||||
wavs/LJ024-0054.wav|democracy will have failed far beyond the importance to it of any king of precedent concerning the judiciary.
|
||||
wavs/LJ006-0044.wav|the same callous indifference to the moral well-being of the prisoners, the same want of employment and of all disciplinary control.
|
||||
wavs/LJ039-0154.wav|four point eight to five point six seconds if the second shot missed,
|
||||
wavs/LJ050-0090.wav|they seem unduly restrictive in continuing to require some manifestation of animus against a Government official.
|
||||
wavs/LJ028-0421.wav|it was the beginning of the great collections of Babylonian antiquities in the museums of the Western world.
|
||||
wavs/LJ033-0205.wav|then I would say the possibility exists, these fibers could have come from this blanket, end quote.
|
||||
wavs/LJ019-0335.wav|The books and journals he was to keep were minutely specified, and his constant presence in or near the jail was insisted upon.
|
||||
wavs/LJ013-0045.wav|Wallace's relations warned him against his Liverpool friend,
|
||||
wavs/LJ037-0002.wav|Chapter four. The Assassin: Part six.
|
||||
wavs/LJ018-0159.wav|This was all the police wanted to know.
|
||||
wavs/LJ026-0140.wav|In the plant as in the animal metabolism must consist of anabolic and catabolic processes.
|
||||
wavs/LJ014-0171.wav|I will briefly describe one or two of the more remarkable murders in the years immediately following, then pass on to another branch of crime.
|
||||
wavs/LJ037-0007.wav|Three others subsequently identified Oswald from a photograph.
|
||||
wavs/LJ033-0174.wav|microscopic and UV (ultra violet) characteristics, end quote.
|
||||
wavs/LJ040-0110.wav|he apparently adjusted well enough there to have had an average, although gradually deteriorating, school record
|
||||
wavs/LJ039-0192.wav|he had a total of between four point eight and five point six seconds between the two shots which hit
|
||||
wavs/LJ032-0261.wav|When he appeared before the Commission, Michael Paine lifted the blanket
|
||||
wavs/LJ040-0097.wav|Lee was brought up in this atmosphere of constant money problems, and I am sure it had quite an effect on him, and also Robert, end quote.
|
||||
wavs/LJ037-0249.wav|Mrs. Earlene Roberts, the housekeeper at Oswald's roominghouse and the last person known to have seen him before he reached tenth Street and Patton Avenue,
|
||||
wavs/LJ016-0248.wav|Marwood was proud of his calling, and when questioned as to whether his process was satisfactory, replied that he heard "no complaints."
|
||||
wavs/LJ004-0083.wav|As Mr. Buxton pointed out, many old acts of parliament designed to protect the prisoner were still in full force.
|
||||
wavs/LJ014-0029.wav|This was Delarue's watch, fully identified as such, which Hocker told his brother Delarue had given him the morning of the murder.
|
||||
wavs/LJ021-0110.wav|have been best calculated to promote industrial recovery and a permanent improvement of business and labor conditions.
|
||||
wavs/LJ003-0107.wav|he slept in the same bed with a highwayman on one side, and a man charged with murder on the other.
|
||||
wavs/LJ039-0076.wav|Ronald Simmons, chief of the U.S. Army Infantry Weapons Evaluation Branch of the Ballistics Research Laboratory, said, quote,
|
||||
wavs/LJ016-0347.wav|had undoubtedly a solemn, impressive effect upon those outside.
|
||||
wavs/LJ001-0072.wav|After the end of the fifteenth century the degradation of printing, especially in Germany and Italy,
|
||||
wavs/LJ024-0018.wav|Consequently, although there never can be more than fifteen, there may be only fourteen, or thirteen, or twelve.
|
||||
wavs/LJ032-0180.wav|that the fibers were caught in the crevice of the rifle's butt plate, quote, in the recent past, end quote,
|
||||
wavs/LJ010-0083.wav|and measures taken to arrest them when their plans were so far developed that no doubt could remain as to their guilt.
|
||||
wavs/LJ002-0299.wav|and gave the garnish for the common side at that sum, which is five shillings more than Mr. Neild says was extorted on the common side.
|
||||
wavs/LJ048-0143.wav|the Secret Service did not at the time of the assassination have any established procedure governing its relationships with them.
|
||||
wavs/LJ012-0054.wav|Solomons, while waiting to appear in court, persuaded the turnkeys to take him to a public-house, where all might "refresh."
|
||||
wavs/LJ019-0270.wav|Vegetables, especially the potato, that most valuable anti-scorbutic, was too often omitted.
|
||||
wavs/LJ035-0164.wav|three minutes after the shooting.
|
||||
wavs/LJ014-0326.wav|Maltby and Co. would issue warrants on them deliverable to the importer, and the goods were then passed to be stored in neighboring warehouses.
|
||||
wavs/LJ001-0173.wav|The essential point to be remembered is that the ornament, whatever it is, whether picture or pattern-work, should form part of the page,
|
||||
wavs/LJ050-0056.wav|On December twenty-six, nineteen sixty-three, the FBI circulated additional instructions to all its agents,
|
||||
wavs/LJ003-0319.wav|provided only that their security was not jeopardized, and dependent upon the enforcement of another new rule,
|
||||
wavs/LJ006-0040.wav|The fact was that the years as they passed, nearly twenty in all, had worked but little permanent improvement in this detestable prison.
|
||||
wavs/LJ017-0231.wav|His body was found lying in a pool of blood in a night-dress, stabbed over and over again in the left side.
|
||||
wavs/LJ017-0226.wav|One half of the mutineers fell upon him unawares with handspikes and capstan-bars.
|
||||
wavs/LJ004-0239.wav|He had been committed for an offense for which he was acquitted.
|
||||
wavs/LJ048-0112.wav|The Commission also regards the security arrangements worked out by Lawson and Sorrels at Love Field as entirely adequate.
|
||||
wavs/LJ039-0125.wav|that Oswald was a good shot, somewhat better than or equal to -- better than the average let us say.
|
||||
wavs/LJ030-0196.wav|He cried out, quote, Oh, no, no, no. My God, they are going to kill us all, end quote,
|
||||
wavs/LJ010-0228.wav|He was released from Broadmoor in eighteen seventy-eight, and went abroad.
|
||||
wavs/LJ045-0228.wav|On the other hand, he could have traveled some distance with the money he did have and he did return to his room where he obtained his revolver.
|
||||
wavs/LJ028-0168.wav|in the other was the sacred precinct of Jupiter Belus,
|
||||
wavs/LJ021-0140.wav|and in such an effort we should be able to secure for employers and employees and consumers
|
||||
wavs/LJ009-0280.wav|Again the wretched creature succeeded in obtaining foothold, but this time on the left side of the drop.
|
||||
wavs/LJ003-0159.wav|To constitute this the aristocratic quarter, unwarrantable demands were made upon the space properly allotted to the female felons,
|
||||
wavs/LJ016-0274.wav|and the windows of the opposite houses, which commanded a good view, as usual fetched high prices.
|
||||
wavs/LJ035-0014.wav|it sounded high and I immediately kind of looked up,
|
||||
wavs/LJ033-0120.wav|which he believed was where the bag reached when it was laid on the seat with one edge against the door.
|
||||
wavs/LJ045-0015.wav|which Johnson said he did not receive until after the assassination. The letter said in part, quote,
|
||||
wavs/LJ003-0299.wav|the latter end of the nineteenth century, several of which still fall far short of our English ideal,
|
||||
wavs/LJ032-0206.wav|After comparing the rifle in the simulated photograph with the rifle in Exhibit Number one thirty-three A, Shaneyfelt testified, quote,
|
||||
wavs/LJ028-0494.wav|Between the several sections were wide spaces where foot soldiers and charioteers might fight.
|
||||
wavs/LJ005-0099.wav|and report at length upon the condition of the prisons of the country.
|
||||
wavs/LJ015-0144.wav|developed to a colossal extent the frauds he had already practiced as a subordinate.
|
||||
wavs/LJ019-0221.wav|It was intended as far as possible that, except awaiting trial, no prisoner should find himself relegated to Newgate.
|
||||
wavs/LJ003-0088.wav|in one, for seven years -- that of a man sentenced to death, for whom great interest had been made, but whom it was not thought right to pardon.
|
||||
wavs/LJ045-0216.wav|nineteen sixty-three, merely to disarm her and to provide a justification of sorts,
|
||||
wavs/LJ042-0135.wav|that he was not yet twenty years old when he went to the Soviet Union with such high hopes and not quite twenty-three when he returned bitterly disappointed.
|
||||
wavs/LJ049-0196.wav|On the other hand, it is urged that all features of the protection of the President and his family should be committed to an elite and independent corps.
|
||||
wavs/LJ018-0278.wav|This was the well and astutely devised plot of the brothers Bidwell,
|
||||
wavs/LJ030-0238.wav|and then looked around again and saw more of this movement, and so I proceeded to go to the back seat and get on top of him.
|
||||
wavs/LJ018-0309.wav|where probably the money still remains.
|
||||
wavs/LJ041-0199.wav|is shown most clearly by his employment relations after his return from the Soviet Union. Of course, he made his real problems worse to the extent
|
||||
wavs/LJ007-0076.wav|The lax discipline maintained in Newgate was still further deteriorated by the presence of two other classes of prisoners who ought never to have been inmates of such a jail.
|
||||
wavs/LJ039-0118.wav|He had high motivation. He had presumably a good to excellent rifle and good ammunition.
|
||||
wavs/LJ024-0019.wav|And there may be only nine.
|
||||
wavs/LJ008-0085.wav|The fire had not quite burnt out at twelve, in nearly four hours, that is to say.
|
||||
wavs/LJ018-0031.wav|This fixed the crime pretty certainly upon Müller, who had already left the country, thus increasing suspicion under which he lay.
|
||||
wavs/LJ030-0032.wav|Dallas police stood at intervals along the fence and Dallas plain clothes men mixed in the crowd.
|
||||
wavs/LJ050-0004.wav|General Supervision of the Secret Service
|
||||
wavs/LJ039-0096.wav|This is a definite advantage to the shooter, the vehicle moving directly away from him and the downgrade of the street, and he being in an elevated position
|
||||
wavs/LJ041-0195.wav|Oswald's interest in Marxism led some people to avoid him,
|
||||
wavs/LJ047-0158.wav|After a moment's hesitation, she told me that he worked at the Texas School Book Depository near the downtown area of Dallas.
|
||||
wavs/LJ050-0162.wav|In planning its data processing techniques,
|
||||
wavs/LJ001-0051.wav|and paying great attention to the "press work" or actual process of printing,
|
||||
wavs/LJ028-0136.wav|Of all the ancient descriptions of the famous walls and the city they protected, that of Herodotus is the fullest.
|
||||
wavs/LJ034-0134.wav|Shortly after the assassination Brennan noticed
|
||||
wavs/LJ019-0348.wav|Every facility was promised. The sanction of the Secretary of State would not be withheld if plans and estimates were duly submitted,
|
||||
wavs/LJ010-0219.wav|While one stood over the fire with the papers, another stood with lighted torch to fire the house.
|
||||
wavs/LJ011-0245.wav|Mr. Mullay called again, taking with him five hundred pounds in cash. Howard discovered this, and his manner was very suspicious;
|
||||
wavs/LJ030-0035.wav|Organization of the Motorcade
|
||||
wavs/LJ044-0135.wav|While he had drawn some attention to himself and had actually appeared on two radio programs, he had been attacked by Cuban exiles and arrested,
|
||||
wavs/LJ045-0090.wav|He was very much interested in autobiographical works of outstanding statesmen of the United States, to whom his wife thought he compared himself.
|
||||
wavs/LJ026-0034.wav|When any given "protist" has to be classified the case must be decided on its individual merits;
|
||||
wavs/LJ045-0092.wav|as to the fact that he was an outstanding man, end quote.
|
||||
wavs/LJ017-0050.wav|Palmer, who was only thirty-one at the time of his trial, was in appearance short and stout, with a round head
|
||||
wavs/LJ036-0104.wav|Whaley picked Oswald.
|
||||
wavs/LJ019-0055.wav|High authorities were in favor of continuous separation.
|
||||
wavs/LJ010-0030.wav|The brutal ferocity of the wild beast once aroused, the same means, the same weapons were employed to do the dreadful deed,
|
||||
wavs/LJ038-0047.wav|Some of the officers saw Oswald strike McDonald with his fist. Most of them heard a click which they assumed to be a click of the hammer of the revolver.
|
||||
wavs/LJ009-0074.wav|Let us pass on.
|
||||
wavs/LJ048-0069.wav|Efforts made by the Bureau since the assassination, on the other hand,
|
||||
wavs/LJ003-0211.wav|They were never left quite alone for fear of suicide, and for the same reason they were searched for weapons or poisons.
|
||||
wavs/LJ048-0053.wav|It is the conclusion of the Commission that, even in the absence of Secret Service criteria
|
||||
wavs/LJ033-0093.wav|Frazier estimated that the bag was two feet long, quote, give and take a few inches, end quote, and about five or six inches wide.
|
||||
wavs/LJ006-0149.wav|The turnkeys left the prisoners very much to themselves, never entering the wards after locking-up time, at dusk, till unlocking next morning,
|
||||
wavs/LJ018-0211.wav|The false coin was bought by an agent from an agent, and dealings were carried on secretly at the "Clock House" in Seven Dials.
|
||||
wavs/LJ008-0054.wav|This contrivance appears to have been copied with improvements from that which had been used in Dublin at a still earlier date,
|
||||
wavs/LJ040-0052.wav|that his commitment to Marxism was an important factor influencing his conduct during his adult years.
|
||||
wavs/LJ028-0023.wav|Two weeks pass, and at last you stand on the eastern edge of the plateau
|
||||
wavs/LJ009-0184.wav|Lord Ferrers' body was brought to Surgeons' Hall after execution in his own carriage and six;
|
||||
wavs/LJ005-0252.wav|A committee was appointed, under the presidency of the Duke of Richmond
|
||||
wavs/LJ015-0266.wav|has probably no parallel in the annals of crime. Saward himself is a striking and in some respects an unique figure in criminal history.
|
||||
wavs/LJ017-0059.wav|even after sentence, and until within a few hours of execution, he was buoyed up with the hope of reprieve.
|
||||
wavs/LJ024-0034.wav|What do they mean by the words "packing the Court"?
|
||||
wavs/LJ016-0089.wav|He was engaged in whitewashing and cleaning; the officer who had him in charge left him on the stairs leading to the gallery.
|
||||
wavs/LJ039-0227.wav|with two hits, within four point eight and five point six seconds.
|
||||
wavs/LJ001-0096.wav|have now come into general use and are obviously a great improvement on the ordinary "modern style" in use in England, which is in fact the Bodoni type
|
||||
wavs/LJ018-0129.wav|who threatened to betray the theft. But Brewer, either before or after this, succumbed to temptation,
|
||||
wavs/LJ010-0157.wav|and that, as he was starving, he had resolved on this desperate deed,
|
||||
wavs/LJ038-0264.wav|He concluded that, quote, the general rifling characteristics of the rifle are of the same type as those found on the bullet
|
||||
wavs/LJ031-0165.wav|When security arrangements at the airport were complete, the Secret Service made the necessary arrangements for the Vice President to leave the hospital.
|
||||
wavs/LJ018-0244.wav|The effect of establishing the forgeries would be to restore to the Roupell family lands for which a price had already been paid
|
||||
wavs/LJ007-0071.wav|in the face of impediments confessedly discouraging
|
||||
wavs/LJ028-0340.wav|Such of the Babylonians as witnessed the treachery took refuge in the temple of Jupiter Belus;
|
||||
wavs/LJ017-0164.wav|with the idea of subjecting her to the irritant poison slowly but surely until the desired effect, death, was achieved.
|
||||
wavs/LJ048-0197.wav|I then told the officers that their primary duty was traffic and crowd control and that they should be alert for any persons who might attempt to throw anything
|
||||
wavs/LJ013-0098.wav|Mr. Oxenford having denied that he had made any transfer of stock, the matter was at once put into the hands of the police.
|
||||
wavs/LJ012-0049.wav|led him to think seriously of trying his fortunes in another land.
|
||||
wavs/LJ030-0014.wav|quote, that the crowd was about the same as the one which came to see him before but there were one hundred thousand extra people on hand who came to see Mrs. Kennedy.
|
||||
wavs/LJ014-0186.wav|A milliner's porter,
|
||||
wavs/LJ015-0027.wav|Yet even so early as the death of the first Sir John Paul,
|
||||
wavs/LJ047-0049.wav|Marina Oswald, however, recalled that her husband was upset by this interview.
|
||||
wavs/LJ012-0021.wav|at fourteen he was a pickpocket and a "duffer," or a seller of sham goods.
|
||||
wavs/LJ003-0140.wav|otherwise he would have been stripped of his clothes. End quote.
|
||||
wavs/LJ042-0130.wav|Shortly thereafter, less than eighteen months after his defection, about six weeks before he met Marina Prusakova,
|
||||
wavs/LJ019-0180.wav|His letter to the Corporation, under date fourth June,
|
||||
wavs/LJ017-0108.wav|He was struck with the appearance of the corpse, which was not emaciated, as after a long disease ending in death;
|
||||
wavs/LJ006-0268.wav|Women saw men if they merely pretended to be wives; even boys were visited by their sweethearts.
|
||||
wavs/LJ044-0125.wav|of residence in the U.S.S.R. against any cause which I join, by association,
|
||||
wavs/LJ015-0231.wav|It was Tester's business, who had access to the railway company's books, to watch for this.
|
||||
wavs/LJ002-0225.wav|The rentals of rooms and fees went to the warden, whose income was two thousand three hundred seventy-two pounds.
|
||||
wavs/LJ034-0072.wav|The employees raced the elevators to the first floor. Givens saw Oswald standing at the gate on the fifth floor as the elevator went by.
|
||||
wavs/LJ045-0033.wav|He began to treat me better. He helped me more -- although he always did help. But he was more attentive, end quote.
|
||||
wavs/LJ031-0058.wav|to infuse blood and fluids into the circulatory system.
|
||||
wavs/LJ029-0197.wav|During November the Dallas papers reported frequently on the plans for protecting the President, stressing the thoroughness of the preparations.
|
||||
wavs/LJ043-0047.wav|Oswald and his family lived for a brief period with his mother at her urging, but Oswald soon decided to move out.
|
||||
wavs/LJ021-0026.wav|seems necessary to produce the same result of justice and right conduct
|
||||
wavs/LJ003-0230.wav|The prison allowances were eked out by the broken victuals generously given by several eating-house keepers in the city,
|
||||
wavs/LJ037-0252.wav|Ted Callaway, who saw the gunman moments after the shooting, testified that Commission Exhibit Number one sixty-two
|
||||
wavs/LJ031-0008.wav|Meanwhile, Chief Curry ordered the police base station to notify Parkland Hospital that the wounded President was en route.
|
||||
wavs/LJ030-0021.wav|all one had to do was get a high building someday with a telescopic rifle, and there was nothing anybody could do to defend against such an attempt.
|
||||
wavs/LJ046-0179.wav|being reviewed regularly.
|
||||
wavs/LJ025-0118.wav|and that, however diverse may be the fabrics or tissues of which their bodies are composed, all these varied structures result
|
||||
wavs/LJ028-0278.wav|Zopyrus, when they told him, not thinking that it could be true, went and saw the colt with his own eyes;
|
||||
wavs/LJ007-0090.wav|Not only did their presence tend greatly to interfere with the discipline of the prison, but their condition was deplorable in the extreme.
|
||||
wavs/LJ045-0045.wav|that she would be able to leave the Soviet Union. Marina Oswald has denied this.
|
||||
wavs/LJ028-0289.wav|For he cut off his own nose and ears, and then, clipping his hair close and flogging himself with a scourge,
|
||||
wavs/LJ009-0276.wav|Calcraft, the moment he had adjusted the cap and rope, ran down the steps, drew the bolt, and disappeared.
|
||||
wavs/LJ031-0122.wav|treated the gunshot wound in the left thigh.
|
||||
wavs/LJ016-0205.wav|he received a retaining fee of five pounds, five shillings, with the usual guinea for each job;
|
||||
wavs/LJ019-0248.wav|leading to an inequality, uncertainty, and inefficiency of punishment productive of the most prejudicial results.
|
||||
wavs/LJ033-0183.wav|it was not surprising that the replica sack made on December one, nineteen sixty-three,
|
||||
wavs/LJ037-0001.wav|Report of the President's Commission on the Assassination of President Kennedy. The Warren Commission Report. By The President's Commission on the Assassination of President Kennedy.
|
||||
wavs/LJ018-0218.wav|In eighteen fifty-five
|
||||
wavs/LJ001-0102.wav|Here and there a book is printed in France or Germany with some pretension to good taste,
|
||||
wavs/LJ007-0125.wav|It was diverted from its proper uses, and, as the "place of the greatest comfort," was allotted to persons who should not have been sent to Newgate at all.
|
||||
wavs/LJ050-0022.wav|A formal and thorough description of the responsibilities of the advance agent is now in preparation by the Service.
|
||||
wavs/LJ028-0212.wav|On the night of the eleventh day Gobrias killed the son of the King.
|
||||
wavs/LJ028-0357.wav|yet we may be sure that Babylon was taken by Darius only by use of stratagem. Its walls were impregnable.
|
||||
wavs/LJ014-0199.wav|there was no case to make out; why waste money on lawyers for the defense? His demeanor was cool and collected throughout;
|
||||
wavs/LJ016-0077.wav|A man named Lears, under sentence of transportation for an attempt at murder on board ship, got up part of the way,
|
||||
wavs/LJ009-0194.wav|and that executors or persons having lawful possession of the bodies
|
||||
wavs/LJ014-0094.wav|Discovery of the murder came in this wise. O'Connor, a punctual and well-conducted official, was at once missed at the London Docks.
|
||||
wavs/LJ001-0079.wav|Caslon's type is clear and neat, and fairly well designed;
|
||||
wavs/LJ026-0052.wav|In the nutrition of the animal the most essential and characteristic part of the food supply is derived from vegetable
|
||||
wavs/LJ013-0005.wav|One of the earliest of the big operators in fraudulent finance was Edward Beaumont Smith,
|
||||
wavs/LJ033-0072.wav|I then stepped off of it and the officer picked it up in the middle and it bent so.
|
||||
wavs/LJ036-0067.wav|According to McWatters, the Beckley bus was behind the Marsalis bus, but he did not actually see it.
|
||||
wavs/LJ025-0098.wav|and it is probable that amyloid substances are universally present in the animal organism, though not in the precise form of starch.
|
||||
wavs/LJ005-0257.wav|during which time a host of witnesses were examined, and the committee presented three separate reports,
|
||||
wavs/LJ004-0024.wav|Thus in eighteen thirteen the exaction of jail fees had been forbidden by law,
|
||||
wavs/LJ049-0154.wav|In eighteen ninety-four,
|
||||
wavs/LJ039-0059.wav|(three) his experience and practice after leaving the Marine Corps, and (four) the accuracy of the weapon and the quality of the ammunition.
|
||||
wavs/LJ007-0150.wav|He is allowed intercourse with prostitutes who, in nine cases out of ten, have originally conduced to his ruin;
|
||||
wavs/LJ015-0001.wav|Chronicles of Newgate, Volume two. By Arthur Griffiths. Section eighteen: Newgate notorieties continued, part three.
|
||||
wavs/LJ010-0158.wav|feeling, as he said, that he might as well be shot or hanged as remain in such a state.
|
||||
wavs/LJ010-0281.wav|who had borne the Queen's commission, first as cornet, and then lieutenant, in the tenth Hussars.
|
||||
wavs/LJ033-0055.wav|and he could disassemble it more rapidly.
|
||||
wavs/LJ015-0218.wav|A new accomplice was now needed within the company's establishment, and Pierce looked about long before he found the right person.
|
||||
wavs/LJ027-0006.wav|In all these lines the facts are drawn together by a strong thread of unity.
|
||||
wavs/LJ016-0049.wav|He had here completed his ascent.
|
||||
wavs/LJ006-0088.wav|It was not likely that a system which left innocent men -- for the great bulk of new arrivals were still untried
|
||||
wavs/LJ042-0133.wav|a great change must have occurred in Oswald's thinking to induce him to return to the United States.
|
||||
wavs/LJ045-0234.wav|While he did become enraged at at least one point in his interrogation,
|
||||
wavs/LJ046-0033.wav|The adequacy of existing procedures can fairly be assessed only after full consideration of the difficulty of the protective assignment,
|
||||
wavs/LJ037-0061.wav|and having, quote, somewhat bushy, end quote, hair.
|
||||
wavs/LJ032-0025.wav|the officers of Klein's discovered that a rifle bearing serial number C two seven six six had been shipped to one A. Hidell,
|
||||
wavs/LJ047-0197.wav|in view of all the information concerning Oswald in its files, should have alerted the Secret Service to Oswald's presence in Dallas
|
||||
wavs/LJ018-0130.wav|and stole paper on a much larger scale than Brown.
|
||||
wavs/LJ005-0265.wav|It was recommended that the dietaries should be submitted and approved like the rules; that convicted prisoners should not receive any food but the jail allowance;
|
||||
wavs/LJ044-0105.wav|He presented Arnold Johnson, Gus Hall,
|
||||
wavs/LJ015-0043.wav|This went on for some time, and might never have been discovered had some good stroke of luck provided any of the partners
|
||||
wavs/LJ030-0125.wav|On several occasions when the Vice President's car was slowed down by the throng, Special Agent Youngblood stepped out to hold the crowd back.
|
||||
wavs/LJ043-0140.wav|He also studied Dallas bus schedules to prepare for his later use of buses to travel to and from General Walker's house.
|
||||
wavs/LJ002-0220.wav|In consequence of these disclosures, both Bambridge and Huggin, his predecessor in the office, were committed to Newgate,
|
||||
wavs/LJ034-0117.wav|At one:twenty-nine p.m. the police radio reported
|
||||
wavs/LJ018-0276.wav|The first plot was against Mr. Harry Emmanuel, but he escaped, and the attempt was made upon Loudon and Ryder.
|
||||
wavs/LJ004-0077.wav|nor has he a right to poison or starve his fellow-creatures."
|
||||
wavs/LJ042-0194.wav|they should not be confused with slowness, indecision or fear. Only the intellectually fearless could even be remotely attracted to our doctrine,
|
||||
wavs/LJ029-0114.wav|The route chosen from the airport to Main Street was the normal one, except where Harwood Street was selected as the means of access to Main Street
|
||||
wavs/LJ014-0194.wav|The policemen were now in possession;
|
||||
wavs/LJ032-0027.wav|According to its microfilm records, Klein's received an order for a rifle on March thirteen, nineteen sixty-three,
|
||||
wavs/LJ048-0289.wav|However, there is no evidence that these men failed to take any action in Dallas within their power that would have averted the tragedy.
|
||||
wavs/LJ043-0188.wav|that he was the leader of a fascist organization, and when I said that even though all of that might be true, just the same he had no right to take his life,
|
||||
wavs/LJ011-0118.wav|In eighteen twenty-nine the gallows claimed two more victims for this offense.
|
||||
wavs/LJ040-0201.wav|After her interview with Mrs. Oswald,
|
||||
wavs/LJ033-0056.wav|While the rifle may have already been disassembled when Oswald arrived home on Thursday, he had ample time that evening to disassemble the rifle
|
||||
wavs/LJ047-0073.wav|Hosty considered the information to be, quote, stale, unquote, by that time, and did not attempt to verify Oswald's reported statement.
|
||||
wavs/LJ001-0153.wav|only nominally so, however, in many cases, since when he uses a headline he counts that in,
|
||||
wavs/LJ007-0158.wav|or any kind of moral improvement was impossible; the prisoner's career was inevitably downward, till he struck the lowest depths.
|
||||
wavs/LJ028-0502.wav|The Ishtar gateway leading to the palace was encased with beautiful blue glazed bricks,
|
||||
wavs/LJ028-0226.wav|Though Herodotus wrote nearly a hundred years after Babylon fell, his story seems to bear the stamp of truth.
|
||||
wavs/LJ010-0038.wav|as there had been before; as in the year eighteen forty-nine, a year memorable for the Rush murders at Norwich,
|
||||
wavs/LJ019-0241.wav|But in the interval very comprehensive and, I think it must be admitted, salutary changes were successively introduced into the management of prisons.
|
||||
wavs/LJ001-0094.wav|were induced to cut punches for a series of "old style" letters.
|
||||
wavs/LJ001-0015.wav|the forms of printed letters should be beautiful, and that their arrangement on the page should be reasonable and a help to the shapeliness of the letters themselves.
|
||||
wavs/LJ047-0015.wav|From defection to return to Fort Worth.
|
||||
wavs/LJ044-0139.wav|since there was no background to the New Orleans FPCC, quote, organization, end quote, which consisted solely of Oswald.
|
||||
wavs/LJ050-0031.wav|that the Secret Service consciously set about the task of inculcating and maintaining the highest standard of excellence and esprit, for all of its personnel.
|
||||
wavs/LJ050-0235.wav|It has also used other Federal law enforcement agents during Presidential visits to cities in which such agents are stationed.
|
||||
wavs/LJ050-0137.wav|FBI, and the Secret Service.
|
||||
wavs/LJ031-0109.wav|At one:thirty-five p.m., after Governor Connally had been moved to the operating room, Dr. Shaw started the first operation
|
||||
wavs/LJ031-0041.wav|He noted that the President was blue-white or ashen in color; had slow, spasmodic, agonal respiration without any coordination;
|
||||
wavs/LJ021-0139.wav|There should be at least a full and fair trial given to these means of ending industrial warfare;
|
||||
wavs/LJ029-0004.wav|The narrative of these events is based largely on the recollections of the participants,
|
||||
wavs/LJ023-0122.wav|It was said in last year's Democratic platform,
|
||||
wavs/LJ005-0264.wav|inspectors of prisons should be appointed, who should visit all the prisons from time to time and report to the Secretary of State.
|
||||
wavs/LJ002-0105.wav|and beyond it was a room called the "wine room," because formerly used for the sale of wine, but
|
||||
wavs/LJ017-0035.wav|in the interests and for the due protection of the public, that the fullest and fairest inquiry should be made,
|
||||
wavs/LJ048-0252.wav|Three of these agents occupied positions on the running boards of the car, and the fourth was seated in the car.
|
||||
wavs/LJ013-0109.wav|The proceeds of the robbery were lodged in a Boston bank,
|
||||
wavs/LJ039-0139.wav|Oswald obtained a hunting license, joined a hunting club and went hunting about six times, as discussed more fully in chapter six.
|
||||
wavs/LJ044-0047.wav|that anyone ever attacked any street demonstration in which Oswald was involved, except for the Bringuier incident mentioned above,
|
||||
wavs/LJ016-0417.wav|Catherine Wilson, the poisoner, was reserved and reticent to the last, expressing no contrition, but also no fear --
|
||||
wavs/LJ045-0178.wav|he left his wedding ring in a cup on the dresser in his room. He also left one hundred seventy dollars in a wallet in one of the dresser drawers.
|
||||
wavs/LJ009-0172.wav|While in London, for instance, in eighteen twenty-nine, twenty-four persons had been executed for crimes other than murder,
|
||||
wavs/LJ049-0202.wav|incident to its responsibilities.
|
||||
wavs/LJ032-0103.wav|The name "Hidell" was stamped on some of the "Chapter's" printed literature and on the membership application blanks.
|
||||
wavs/LJ013-0091.wav|and Elder had to be assisted by two bank porters, who carried it for him to a carriage waiting near the Mansion House.
|
||||
wavs/LJ037-0208.wav|nineteen dollars, ninety-five cents, plus one dollar, twenty-seven cents shipping charge, had been collected from the consignee, Hidell.
|
||||
wavs/LJ014-0128.wav|her hair was dressed in long crepe bands. She had lace ruffles at her wrist, and wore primrose-colored kid gloves.
|
||||
wavs/LJ015-0007.wav|This affected Cole's credit, and ugly reports were in circulation charging him with the issue of simulated warrants.
|
||||
wavs/LJ036-0169.wav|he would have reached his destination at approximately twelve:fifty-four p.m.
|
||||
wavs/LJ021-0040.wav|The second step we have taken in the restoration of normal business enterprise
|
||||
wavs/LJ015-0036.wav|The bank was already insolvent,
|
||||
wavs/LJ034-0041.wav|Although Bureau experiments had shown that twenty-four hours was a likely maximum time, Latona stated
|
||||
wavs/LJ009-0192.wav|The dissection of executed criminals was abolished soon after the discovery of the crime of burking,
|
||||
wavs/LJ037-0248.wav|The eyewitnesses vary in their identification of the jacket.
|
||||
wavs/LJ015-0289.wav|As each transaction was carried out from a different address, and a different messenger always employed,
|
||||
wavs/LJ005-0072.wav|After a few years of active exertion the Society was rewarded by fresh legislation.
|
||||
wavs/LJ023-0047.wav|The three horses are, of course, the three branches of government -- the Congress, the Executive and the courts.
|
||||
wavs/LJ009-0126.wav|Hardly any one.
|
||||
wavs/LJ034-0097.wav|The window was approximately one hundred twenty feet away.
|
||||
wavs/LJ028-0462.wav|They were laid in bitumen.
|
||||
wavs/LJ046-0055.wav|It is now possible for Presidents to travel the length and breadth of a land far larger than the United States
|
||||
wavs/LJ019-0371.wav|Yet the law was seldom if ever enforced.
|
||||
wavs/LJ039-0207.wav|Although all of the shots were a few inches high and to the right of the target,
|
||||
wavs/LJ002-0174.wav|Mr. Buxton's friends at once paid the forty shillings, and the boy was released.
|
||||
wavs/LJ016-0233.wav|In his own profession
|
||||
wavs/LJ026-0108.wav|It is clear that there are upward and downward currents of water containing food (comparable to blood of an animal),
|
||||
wavs/LJ038-0035.wav|Oswald rose from his seat, bringing up both hands.
|
||||
wavs/LJ026-0148.wav|water which is lost by evaporation, especially from the leaf surface through the stomata;
|
||||
wavs/LJ001-0186.wav|the position of our Society that a work of utility might be also a work of art, if we cared to make it so.
|
||||
wavs/LJ016-0264.wav|The upturned faces of the eager spectators resembled those of the 'gods' at Drury Lane on Boxing Night;
|
||||
wavs/LJ009-0041.wav|The occupants of this terrible black pew were the last always to enter the chapel.
|
||||
wavs/LJ010-0297.wav|But there were other notorious cases of forgery.
|
||||
wavs/LJ040-0018.wav|the Commission is not able to reach any definite conclusions as to whether or not he was, quote, sane, unquote, under prevailing legal standards.
|
||||
wavs/LJ005-0253.wav|"to inquire into and report upon the several jails and houses of correction in the counties, cities, and corporate towns within England and Wales
|
||||
wavs/LJ027-0176.wav|Fishes first appeared in the Devonian and Upper Silurian in very reptilian or rather amphibian forms.
|
||||
wavs/LJ034-0035.wav|The position of this palmprint on the carton was parallel with the long axis of the box, and at right angles with the short axis;
|
||||
wavs/LJ016-0054.wav|But he did not like the risk of entering a room by the fireplace, and the chances of detection it offered.
|
||||
wavs/LJ018-0262.wav|Roupell received the announcement with a cheerful countenance,
|
||||
wavs/LJ044-0237.wav|with thirteen dollars, eighty-seven cents when considerably greater resources were available to him.
|
||||
wavs/LJ034-0166.wav|Two other witnesses were able to offer partial descriptions of a man they saw in the southeast corner window
|
||||
wavs/LJ016-0238.wav|"just to steady their legs a little;" in other words, to add his weight to that of the hanging bodies.
|
||||
wavs/LJ042-0198.wav|The discussion above has already set forth examples of his expression of hatred for the United States.
|
||||
wavs/LJ031-0189.wav|At two:thirty-eight p.m., Eastern Standard Time, Lyndon Baines Johnson took the oath of office as the thirty-sixth President of the United States.
|
||||
wavs/LJ050-0084.wav|or, quote, other high government officials in the nature of a complaint coupled with an expressed or implied determination to use a means,
|
||||
wavs/LJ044-0158.wav|As for my return entrance visa please consider it separately. End quote.
|
||||
wavs/LJ045-0082.wav|it appears that Marina Oswald also complained that her husband was not able to provide more material things for her.
|
||||
wavs/LJ045-0190.wav|appeared in The Dallas Times Herald on November fifteen, nineteen sixty-three.
|
||||
wavs/LJ035-0155.wav|The only exit from the office in the direction Oswald was moving was through the door to the front stairway.
|
||||
wavs/LJ044-0004.wav|Political Activities
|
||||
wavs/LJ046-0016.wav|The Commission has not undertaken a comprehensive examination of all facets of this subject;
|
||||
wavs/LJ019-0368.wav|The latter too was to be laid before the House of Commons.
|
||||
wavs/LJ010-0062.wav|But they proceeded in all seriousness, and would have shrunk from no outrage or atrocity in furtherance of their foolhardy enterprise.
|
||||
wavs/LJ033-0159.wav|It was from Oswald's right hand, in which he carried the long package as he walked from Frazier's car to the building.
|
||||
wavs/LJ002-0171.wav|The boy declared he saw no one, and accordingly passed through without paying the toll of a penny.
|
||||
wavs/LJ002-0298.wav|in his evidence in eighteen fourteen, said it was more,
|
||||
wavs/LJ012-0219.wav|and in one corner, at some depth, a bundle of clothes were unearthed, which, with a hairy cap,
|
||||
wavs/LJ017-0190.wav|After this came the charge of administering oil of vitriol, which failed, as has been described.
|
||||
wavs/LJ019-0179.wav|This, with a scheme for limiting the jail to untried prisoners, had been urgently recommended by Lord John Russell in eighteen thirty.
|
||||
wavs/LJ050-0188.wav|each patrolman might be given a prepared booklet of instructions explaining what is expected of him. The Secret Service has expressed concern
|
||||
wavs/LJ006-0043.wav|The disgraceful overcrowding had been partially ended, but the same evils of indiscriminate association were still present; there was the old neglect of decency,
|
||||
wavs/LJ029-0060.wav|A number of people who resembled some of those in the photographs were placed under surveillance at the Trade Mart.
|
||||
wavs/LJ019-0052.wav|Both systems came to us from the United States. The difference was really more in degree than in principle,
|
||||
wavs/LJ037-0081.wav|Later in the day each woman found an empty shell on the ground near the house. These two shells were delivered to the police.
|
||||
wavs/LJ048-0200.wav|paying particular attention to the crowd for any unusual activity.
|
||||
wavs/LJ016-0426.wav|come along, gallows.
|
||||
wavs/LJ008-0182.wav|A tremendous crowd assembled when Bellingham was executed in eighteen twelve for the murder of Spencer Percival, at that time prime minister;
|
||||
wavs/LJ043-0107.wav|Upon moving to New Orleans on April twenty-four, nineteen sixty-three,
|
||||
wavs/LJ006-0084.wav|and so numerous were his opportunities of showing favoritism, that all the prisoners may be said to be in his power.
|
||||
wavs/LJ025-0081.wav|has no permanent digestive cavity or mouth, but takes in its food anywhere and digests, so to speak, all over its body.
|
||||
wavs/LJ019-0042.wav|These were either satisfied with a makeshift, and modified existing buildings, without close regard to their suitability, or for a long time did nothing at all.
|
||||
wavs/LJ047-0240.wav|They agree that Hosty told Revill
|
||||
wavs/LJ032-0012.wav|the resistance to arrest and the attempted shooting of another police officer by the man (Lee Harvey Oswald) subsequently accused of assassinating President Kennedy
|
||||
wavs/LJ050-0209.wav|The assistant to the Director of the FBI testified that
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,100 @@
|
|||
wavs/LJ022-0023.wav|The overwhelming majority of people in this country know how to sift the wheat from the chaff in what they hear and what they read.
|
||||
wavs/LJ043-0030.wav|If somebody did that to me, a lousy trick like that, to take my wife away, and all the furniture, I would be mad as hell, too.
|
||||
wavs/LJ005-0201.wav|as is shown by the report of the Commissioners to inquire into the state of the municipal corporations in eighteen thirty-five.
|
||||
wavs/LJ001-0110.wav|Even the Caslon type when enlarged shows great shortcomings in this respect:
|
||||
wavs/LJ003-0345.wav|All the committee could do in this respect was to throw the responsibility on others.
|
||||
wavs/LJ007-0154.wav|These pungent and well-grounded strictures applied with still greater force to the unconvicted prisoner, the man who came to the prison innocent, and still uncontaminated,
|
||||
wavs/LJ018-0098.wav|and recognized as one of the frequenters of the bogus law-stationers. His arrest led to that of others.
|
||||
wavs/LJ047-0044.wav|Oswald was, however, willing to discuss his contacts with Soviet authorities. He denied having any involvement with Soviet intelligence agencies
|
||||
wavs/LJ031-0038.wav|The first physician to see the President at Parkland Hospital was Dr. Charles J. Carrico, a resident in general surgery.
|
||||
wavs/LJ048-0194.wav|during the morning of November twenty-two prior to the motorcade.
|
||||
wavs/LJ049-0026.wav|On occasion the Secret Service has been permitted to have an agent riding in the passenger compartment with the President.
|
||||
wavs/LJ004-0152.wav|although at Mr. Buxton's visit a new jail was in process of erection, the first step towards reform since Howard's visitation in seventeen seventy-four.
|
||||
wavs/LJ008-0278.wav|or theirs might be one of many, and it might be considered necessary to "make an example."
|
||||
wavs/LJ043-0002.wav|The Warren Commission Report. By The President's Commission on the Assassination of President Kennedy. Chapter seven. Lee Harvey Oswald:
|
||||
wavs/LJ009-0114.wav|Mr. Wakefield winds up his graphic but somewhat sensational account by describing another religious service, which may appropriately be inserted here.
|
||||
wavs/LJ028-0506.wav|A modern artist would have difficulty in doing such accurate work.
|
||||
wavs/LJ050-0168.wav|with the particular purposes of the agency involved. The Commission recognizes that this is a controversial area
|
||||
wavs/LJ039-0223.wav|Oswald's Marine training in marksmanship, his other rifle experience and his established familiarity with this particular weapon
|
||||
wavs/LJ029-0032.wav|According to O'Donnell, quote, we had a motorcade wherever we went, end quote.
|
||||
wavs/LJ031-0070.wav|Dr. Clark, who most closely observed the head wound,
|
||||
wavs/LJ034-0198.wav|Euins, who was on the southwest corner of Elm and Houston Streets testified that he could not describe the man he saw in the window.
|
||||
wavs/LJ026-0068.wav|Energy enters the plant, to a small extent,
|
||||
wavs/LJ039-0075.wav|once you know that you must put the crosshairs on the target and that is all that is necessary.
|
||||
wavs/LJ004-0096.wav|the fatal consequences whereof might be prevented if the justices of the peace were duly authorized
|
||||
wavs/LJ005-0014.wav|Speaking on a debate on prison matters, he declared that
|
||||
wavs/LJ012-0161.wav|he was reported to have fallen away to a shadow.
|
||||
wavs/LJ018-0239.wav|His disappearance gave color and substance to evil reports already in circulation that the will and conveyance above referred to
|
||||
wavs/LJ019-0257.wav|Here the tread-wheel was in use, there cellular cranks, or hard-labor machines.
|
||||
wavs/LJ028-0008.wav|you tap gently with your heel upon the shoulder of the dromedary to urge her on.
|
||||
wavs/LJ024-0083.wav|This plan of mine is no attack on the Court;
|
||||
wavs/LJ042-0129.wav|No night clubs or bowling alleys, no places of recreation except the trade union dances. I have had enough.
|
||||
wavs/LJ036-0103.wav|The police asked him whether he could pick out his passenger from the lineup.
|
||||
wavs/LJ046-0058.wav|During his Presidency, Franklin D. Roosevelt made almost four hundred journeys and traveled more than three hundred fifty thousand miles.
|
||||
wavs/LJ014-0076.wav|He was seen afterwards smoking and talking with his hosts in their back parlor, and never seen again alive.
|
||||
wavs/LJ002-0043.wav|long narrow rooms -- one thirty-six feet, six twenty-three feet, and the eighth eighteen,
|
||||
wavs/LJ009-0076.wav|We come to the sermon.
|
||||
wavs/LJ017-0131.wav|even when the high sheriff had told him there was no possibility of a reprieve, and within a few hours of execution.
|
||||
wavs/LJ046-0184.wav|but there is a system for the immediate notification of the Secret Service by the confining institution when a subject is released or escapes.
|
||||
wavs/LJ014-0263.wav|When other pleasures palled he took a theatre, and posed as a munificent patron of the dramatic art.
|
||||
wavs/LJ042-0096.wav|(old exchange rate) in addition to his factory salary of approximately equal amount
|
||||
wavs/LJ049-0050.wav|Hill had both feet on the car and was climbing aboard to assist President and Mrs. Kennedy.
|
||||
wavs/LJ019-0186.wav|seeing that since the establishment of the Central Criminal Court, Newgate received prisoners for trial from several counties,
|
||||
wavs/LJ028-0307.wav|then let twenty days pass, and at the end of that time station near the Chaldasan gates a body of four thousand.
|
||||
wavs/LJ012-0235.wav|While they were in a state of insensibility the murder was committed.
|
||||
wavs/LJ034-0053.wav|reached the same conclusion as Latona that the prints found on the cartons were those of Lee Harvey Oswald.
|
||||
wavs/LJ014-0030.wav|These were damnatory facts which well supported the prosecution.
|
||||
wavs/LJ015-0203.wav|but were the precautions too minute, the vigilance too close to be eluded or overcome?
|
||||
wavs/LJ028-0093.wav|but his scribe wrote it in the manner customary for the scribes of those days to write of their royal masters.
|
||||
wavs/LJ002-0018.wav|The inadequacy of the jail was noticed and reported upon again and again by the grand juries of the city of London,
|
||||
wavs/LJ028-0275.wav|At last, in the twentieth month,
|
||||
wavs/LJ012-0042.wav|which he kept concealed in a hiding-place with a trap-door just under his bed.
|
||||
wavs/LJ011-0096.wav|He married a lady also belonging to the Society of Friends, who brought him a large fortune, which, and his own money, he put into a city firm,
|
||||
wavs/LJ036-0077.wav|Roger D. Craig, a deputy sheriff of Dallas County,
|
||||
wavs/LJ016-0318.wav|Other officials, great lawyers, governors of prisons, and chaplains supported this view.
|
||||
wavs/LJ013-0164.wav|who came from his room ready dressed, a suspicious circumstance, as he was always late in the morning.
|
||||
wavs/LJ027-0141.wav|is closely reproduced in the life-history of existing deer. Or, in other words,
|
||||
wavs/LJ028-0335.wav|accordingly they committed to him the command of their whole army, and put the keys of their city into his hands.
|
||||
wavs/LJ031-0202.wav|Mrs. Kennedy chose the hospital in Bethesda for the autopsy because the President had served in the Navy.
|
||||
wavs/LJ021-0145.wav|From those willing to join in establishing this hoped-for period of peace,
|
||||
wavs/LJ016-0288.wav|"Müller, Müller, He's the man," till a diversion was created by the appearance of the gallows, which was received with continuous yells.
|
||||
wavs/LJ028-0081.wav|Years later, when the archaeologists could readily distinguish the false from the true,
|
||||
wavs/LJ018-0081.wav|his defense being that he had intended to commit suicide, but that, on the appearance of this officer who had wronged him,
|
||||
wavs/LJ021-0066.wav|together with a great increase in the payrolls, there has come a substantial rise in the total of industrial profits
|
||||
wavs/LJ009-0238.wav|After this the sheriffs sent for another rope, but the spectators interfered, and the man was carried back to jail.
|
||||
wavs/LJ005-0079.wav|and improve the morals of the prisoners, and shall insure the proper measure of punishment to convicted offenders.
|
||||
wavs/LJ035-0019.wav|drove to the northwest corner of Elm and Houston, and parked approximately ten feet from the traffic signal.
|
||||
wavs/LJ036-0174.wav|This is the approximate time he entered the roominghouse, according to Earlene Roberts, the housekeeper there.
|
||||
wavs/LJ046-0146.wav|The criteria in effect prior to November twenty-two, nineteen sixty-three, for determining whether to accept material for the PRS general files
|
||||
wavs/LJ017-0044.wav|and the deepest anxiety was felt that the crime, if crime there had been, should be brought home to its perpetrator.
|
||||
wavs/LJ017-0070.wav|but his sporting operations did not prosper, and he became a needy man, always driven to desperate straits for cash.
|
||||
wavs/LJ014-0020.wav|He was soon afterwards arrested on suspicion, and a search of his lodgings brought to light several garments saturated with blood;
|
||||
wavs/LJ016-0020.wav|He never reached the cistern, but fell back into the yard, injuring his legs severely.
|
||||
wavs/LJ045-0230.wav|when he was finally apprehended in the Texas Theatre. Although it is not fully corroborated by others who were present,
|
||||
wavs/LJ035-0129.wav|and she must have run down the stairs ahead of Oswald and would probably have seen or heard him.
|
||||
wavs/LJ008-0307.wav|afterwards express a wish to murder the Recorder for having kept them so long in suspense.
|
||||
wavs/LJ008-0294.wav|nearly indefinitely deferred.
|
||||
wavs/LJ047-0148.wav|On October twenty-five,
|
||||
wavs/LJ008-0111.wav|They entered a "stone cold room," and were presently joined by the prisoner.
|
||||
wavs/LJ034-0042.wav|that he could only testify with certainty that the print was less than three days old.
|
||||
wavs/LJ037-0234.wav|Mrs. Mary Brock, the wife of a mechanic who worked at the station, was there at the time and she saw a white male,
|
||||
wavs/LJ040-0002.wav|Chapter seven. Lee Harvey Oswald: Background and Possible Motives, Part one.
|
||||
wavs/LJ045-0140.wav|The arguments he used to justify his use of the alias suggest that Oswald may have come to think that the whole world was becoming involved
|
||||
wavs/LJ012-0035.wav|the number and names on watches, were carefully removed or obliterated after the goods passed out of his hands.
|
||||
wavs/LJ012-0250.wav|On the seventh July, eighteen thirty-seven,
|
||||
wavs/LJ016-0179.wav|contracted with sheriffs and conveners to work by the job.
|
||||
wavs/LJ016-0138.wav|at a distance from the prison.
|
||||
wavs/LJ027-0052.wav|These principles of homology are essential to a correct interpretation of the facts of morphology.
|
||||
wavs/LJ031-0134.wav|On one occasion Mrs. Johnson, accompanied by two Secret Service agents, left the room to see Mrs. Kennedy and Mrs. Connally.
|
||||
wavs/LJ019-0273.wav|which Sir Joshua Jebb told the committee he considered the proper elements of penal discipline.
|
||||
wavs/LJ014-0110.wav|At the first the boxes were impounded, opened, and found to contain many of O'Connor's effects.
|
||||
wavs/LJ034-0160.wav|on Brennan's subsequent certain identification of Lee Harvey Oswald as the man he saw fire the rifle.
|
||||
wavs/LJ038-0199.wav|eleven. If I am alive and taken prisoner,
|
||||
wavs/LJ014-0010.wav|yet he could not overcome the strange fascination it had for him, and remained by the side of the corpse till the stretcher came.
|
||||
wavs/LJ033-0047.wav|I noticed when I went out that the light was on, end quote,
|
||||
wavs/LJ040-0027.wav|He was never satisfied with anything.
|
||||
wavs/LJ048-0228.wav|and others who were present say that no agent was inebriated or acted improperly.
|
||||
wavs/LJ003-0111.wav|He was in consequence put out of the protection of their internal law, end quote. Their code was a subject of some curiosity.
|
||||
wavs/LJ008-0258.wav|Let me retrace my steps, and speak more in detail of the treatment of the condemned in those bloodthirsty and brutally indifferent days,
|
||||
wavs/LJ029-0022.wav|The original plan called for the President to spend only one day in the State, making whirlwind visits to Dallas, Fort Worth, San Antonio, and Houston.
|
||||
wavs/LJ004-0045.wav|Mr. Sturges Bourne, Sir James Mackintosh, Sir James Scarlett, and William Wilberforce.
|
|
@ -0,0 +1,500 @@
|
|||
mels/LJ045-0096.pt|durations/LJ045-0096.pt|pitch_char/LJ045-0096.pt|Mrs. De Mohrenschildt thought that Oswald,
|
||||
mels/LJ049-0022.pt|durations/LJ049-0022.pt|pitch_char/LJ049-0022.pt|The Secret Service believed that it was very doubtful that any President would ride regularly in a vehicle with a fixed top, even though transparent.
|
||||
mels/LJ033-0042.pt|durations/LJ033-0042.pt|pitch_char/LJ033-0042.pt|Between the hours of eight and nine p.m. they were occupied with the children in the bedrooms located at the extreme east end of the house.
|
||||
mels/LJ016-0117.pt|durations/LJ016-0117.pt|pitch_char/LJ016-0117.pt|The prisoner had nothing to deal with but wooden panels, and by dint of cutting and chopping he got both the lower panels out.
|
||||
mels/LJ025-0157.pt|durations/LJ025-0157.pt|pitch_char/LJ025-0157.pt|Under these circumstances, unnatural as they are, with proper management, the bean will thrust forth its radicle and its plumule;
|
||||
mels/LJ042-0219.pt|durations/LJ042-0219.pt|pitch_char/LJ042-0219.pt|Oswald demonstrated his thinking in connection with his return to the United States by preparing two sets of identical questions of the type which he might have thought
|
||||
mels/LJ032-0164.pt|durations/LJ032-0164.pt|pitch_char/LJ032-0164.pt|it is not possible to state with scientific certainty that a particular small group of fibers come from a certain piece of clothing
|
||||
mels/LJ046-0092.pt|durations/LJ046-0092.pt|pitch_char/LJ046-0092.pt|has confidence in the dedicated Secret Service men who are ready to lay down their lives for him
|
||||
mels/LJ050-0118.pt|durations/LJ050-0118.pt|pitch_char/LJ050-0118.pt|Since these agencies are already obliged constantly to evaluate the activities of such groups,
|
||||
mels/LJ043-0016.pt|durations/LJ043-0016.pt|pitch_char/LJ043-0016.pt|Jeanne De Mohrenschildt said, quote,
|
||||
mels/LJ021-0078.pt|durations/LJ021-0078.pt|pitch_char/LJ021-0078.pt|no economic panacea, which could simply revive over-night the heavy industries and the trades dependent upon them.
|
||||
mels/LJ039-0148.pt|durations/LJ039-0148.pt|pitch_char/LJ039-0148.pt|Examination of the cartridge cases found on the sixth floor of the Depository Building
|
||||
mels/LJ047-0202.pt|durations/LJ047-0202.pt|pitch_char/LJ047-0202.pt|testified that the information available to the Federal Government about Oswald before the assassination would, if known to PRS,
|
||||
mels/LJ023-0056.pt|durations/LJ023-0056.pt|pitch_char/LJ023-0056.pt|It is an easy document to understand when you remember that it was called into being
|
||||
mels/LJ021-0025.pt|durations/LJ021-0025.pt|pitch_char/LJ021-0025.pt|And in many directions, the intervention of that organized control which we call government
|
||||
mels/LJ030-0105.pt|durations/LJ030-0105.pt|pitch_char/LJ030-0105.pt|Communications in the motorcade.
|
||||
mels/LJ021-0012.pt|durations/LJ021-0012.pt|pitch_char/LJ021-0012.pt|with respect to industry and business, but nearly all are agreed that private enterprise in times such as these
|
||||
mels/LJ019-0169.pt|durations/LJ019-0169.pt|pitch_char/LJ019-0169.pt|and one or two men were allowed to mend clothes and make shoes. The rules made by the Secretary of State were hung up in conspicuous parts of the prison;
|
||||
mels/LJ039-0088.pt|durations/LJ039-0088.pt|pitch_char/LJ039-0088.pt|It just is an aid in seeing in the fact that you only have the one element, the crosshair,
|
||||
mels/LJ016-0192.pt|durations/LJ016-0192.pt|pitch_char/LJ016-0192.pt|"I think I could do that sort of job," said Calcraft, on the spur of the moment.
|
||||
mels/LJ014-0142.pt|durations/LJ014-0142.pt|pitch_char/LJ014-0142.pt|was strewn in front of the dock, and sprinkled it towards the bench with a contemptuous gesture.
|
||||
mels/LJ012-0015.pt|durations/LJ012-0015.pt|pitch_char/LJ012-0015.pt|Weedon and Lecasser to twelve and six months respectively in Coldbath Fields.
|
||||
mels/LJ048-0033.pt|durations/LJ048-0033.pt|pitch_char/LJ048-0033.pt|Prior to November twenty-two, nineteen sixty-three
|
||||
mels/LJ028-0349.pt|durations/LJ028-0349.pt|pitch_char/LJ028-0349.pt|who were each required to send so large a number to Babylon, that in all there were collected no fewer than fifty thousand.
|
||||
mels/LJ030-0197.pt|durations/LJ030-0197.pt|pitch_char/LJ030-0197.pt|At first Mrs. Connally thought that her husband had been killed,
|
||||
mels/LJ017-0133.pt|durations/LJ017-0133.pt|pitch_char/LJ017-0133.pt|Palmer speedily found imitators.
|
||||
mels/LJ034-0123.pt|durations/LJ034-0123.pt|pitch_char/LJ034-0123.pt|Although Brennan testified that the man in the window was standing when he fired the shots, most probably he was either sitting or kneeling.
|
||||
mels/LJ003-0282.pt|durations/LJ003-0282.pt|pitch_char/LJ003-0282.pt|Many years were to elapse before these objections should be fairly met and universally overcome.
|
||||
mels/LJ032-0204.pt|durations/LJ032-0204.pt|pitch_char/LJ032-0204.pt|Special Agent Lyndal L. Shaneyfelt, a photography expert with the FBI,
|
||||
mels/LJ016-0241.pt|durations/LJ016-0241.pt|pitch_char/LJ016-0241.pt|Calcraft served the city of London till eighteen seventy-four, when he was pensioned at the rate of twenty-five shillings per week.
|
||||
mels/LJ023-0033.pt|durations/LJ023-0033.pt|pitch_char/LJ023-0033.pt|we will not allow ourselves to run around in new circles of futile discussion and debate, always postponing the day of decision.
|
||||
mels/LJ009-0286.pt|durations/LJ009-0286.pt|pitch_char/LJ009-0286.pt|There has never been much science in the system of carrying out the extreme penalty in this country; the "finisher of the law"
|
||||
mels/LJ008-0181.pt|durations/LJ008-0181.pt|pitch_char/LJ008-0181.pt|he had his pockets filled with bread and cheese, and it was generally supposed that he had come a long distance to see the fatal show.
|
||||
mels/LJ015-0052.pt|durations/LJ015-0052.pt|pitch_char/LJ015-0052.pt|to the value of twenty thousand pounds.
|
||||
mels/LJ016-0314.pt|durations/LJ016-0314.pt|pitch_char/LJ016-0314.pt|Sir George Grey thought there was a growing feeling in favor of executions within the prison precincts.
|
||||
mels/LJ047-0056.pt|durations/LJ047-0056.pt|pitch_char/LJ047-0056.pt|From August nineteen sixty-two
|
||||
mels/LJ010-0027.pt|durations/LJ010-0027.pt|pitch_char/LJ010-0027.pt|Nor did the methods by which they were perpetrated greatly vary from those in times past.
|
||||
mels/LJ010-0065.pt|durations/LJ010-0065.pt|pitch_char/LJ010-0065.pt|At the former the "Provisional Government" was to be established,
|
||||
mels/LJ046-0113.pt|durations/LJ046-0113.pt|pitch_char/LJ046-0113.pt|The Commission has concluded that at the time of the assassination
|
||||
mels/LJ028-0410.pt|durations/LJ028-0410.pt|pitch_char/LJ028-0410.pt|There among the ruins they still live in the same kind of houses,
|
||||
mels/LJ044-0137.pt|durations/LJ044-0137.pt|pitch_char/LJ044-0137.pt|More seriously, the facts of his defection had become known, leaving him open to almost unanswerable attack by those who opposed his views.
|
||||
mels/LJ008-0215.pt|durations/LJ008-0215.pt|pitch_char/LJ008-0215.pt|One by one the huge uprights of black timber were fitted together,
|
||||
mels/LJ030-0084.pt|durations/LJ030-0084.pt|pitch_char/LJ030-0084.pt|or when the press of the crowd made it impossible for the escort motorcycles to stay in position on the car's rear flanks.
|
||||
mels/LJ020-0092.pt|durations/LJ020-0092.pt|pitch_char/LJ020-0092.pt|Have yourself called on biscuit mornings an hour earlier than usual.
|
||||
mels/LJ029-0096.pt|durations/LJ029-0096.pt|pitch_char/LJ029-0096.pt|On November fourteen, Lawson and Sorrels attended a meeting at Love Field
|
||||
mels/LJ015-0308.pt|durations/LJ015-0308.pt|pitch_char/LJ015-0308.pt|and others who swore to the meetings of the conspirators and their movements. Saward was found guilty,
|
||||
mels/LJ012-0067.pt|durations/LJ012-0067.pt|pitch_char/LJ012-0067.pt|But Mrs. Solomons could not resist the temptation to dabble in stolen goods, and she was found shipping watches of the wrong category to New York.
|
||||
mels/LJ018-0231.pt|durations/LJ018-0231.pt|pitch_char/LJ018-0231.pt|namely, to suppress it and substitute another.
|
||||
mels/LJ014-0265.pt|durations/LJ014-0265.pt|pitch_char/LJ014-0265.pt|and later he became manager of the newly rebuilt Olympic at Wych Street.
|
||||
mels/LJ024-0102.pt|durations/LJ024-0102.pt|pitch_char/LJ024-0102.pt|would be the first to exclaim as soon as an amendment was proposed
|
||||
mels/LJ007-0233.pt|durations/LJ007-0233.pt|pitch_char/LJ007-0233.pt|it consists of several circular perforations, about two inches in diameter,
|
||||
mels/LJ013-0213.pt|durations/LJ013-0213.pt|pitch_char/LJ013-0213.pt|This seems to have decided Courvoisier,
|
||||
mels/LJ032-0045.pt|durations/LJ032-0045.pt|pitch_char/LJ032-0045.pt|This price included nineteen dollars, ninety-five cents for the rifle and the scope, and one dollar, fifty cents for postage and handling.
|
||||
mels/LJ011-0048.pt|durations/LJ011-0048.pt|pitch_char/LJ011-0048.pt|Wherefore let him that thinketh he standeth take heed lest he fall," and was full of the most pointed allusions to the culprit.
|
||||
mels/LJ005-0294.pt|durations/LJ005-0294.pt|pitch_char/LJ005-0294.pt|It was frequently stated in evidence that the jail of the borough was in so unfit a state for the reception of prisoners,
|
||||
mels/LJ016-0007.pt|durations/LJ016-0007.pt|pitch_char/LJ016-0007.pt|There were others less successful.
|
||||
mels/LJ028-0138.pt|durations/LJ028-0138.pt|pitch_char/LJ028-0138.pt|perhaps the tales that travelers told him were exaggerated as travelers' tales are likely to be,
|
||||
mels/LJ050-0029.pt|durations/LJ050-0029.pt|pitch_char/LJ050-0029.pt|that is reflected in definite and comprehensive operating procedures.
|
||||
mels/LJ014-0121.pt|durations/LJ014-0121.pt|pitch_char/LJ014-0121.pt|The prisoners were in due course transferred to Newgate, to be put upon their trial at the Central Criminal Court.
|
||||
mels/LJ014-0146.pt|durations/LJ014-0146.pt|pitch_char/LJ014-0146.pt|They had to handcuff her by force against the most violent resistance, and still she raged and stormed,
|
||||
mels/LJ046-0111.pt|durations/LJ046-0111.pt|pitch_char/LJ046-0111.pt|The Secret Service has attempted to perform this function through the activities of its Protective Research Section
|
||||
mels/LJ012-0257.pt|durations/LJ012-0257.pt|pitch_char/LJ012-0257.pt|But the affair still remained a profound mystery. No light was thrown upon it till, towards the end of March,
|
||||
mels/LJ002-0260.pt|durations/LJ002-0260.pt|pitch_char/LJ002-0260.pt|Yet the public opinion of the whole body seems to have checked dissipation.
|
||||
mels/LJ031-0014.pt|durations/LJ031-0014.pt|pitch_char/LJ031-0014.pt|the Presidential limousine arrived at the emergency entrance of the Parkland Hospital at about twelve:thirty-five p.m.
|
||||
mels/LJ047-0093.pt|durations/LJ047-0093.pt|pitch_char/LJ047-0093.pt|Oswald was arrested and jailed by the New Orleans Police Department for disturbing the peace, in connection with a street fight which broke out when he was accosted
|
||||
mels/LJ003-0324.pt|durations/LJ003-0324.pt|pitch_char/LJ003-0324.pt|gaming of all sorts should be peremptorily forbidden under heavy pains and penalties.
|
||||
mels/LJ021-0115.pt|durations/LJ021-0115.pt|pitch_char/LJ021-0115.pt|we have reached into the heart of the problem which is to provide such annual earnings for the lowest paid worker as will meet his minimum needs.
|
||||
mels/LJ046-0191.pt|durations/LJ046-0191.pt|pitch_char/LJ046-0191.pt|it had established periodic regular review of the status of four hundred individuals;
|
||||
mels/LJ034-0197.pt|durations/LJ034-0197.pt|pitch_char/LJ034-0197.pt|who was one of the first witnesses to alert the police to the Depository as the source of the shots, as has been discussed in chapter three.
|
||||
mels/LJ002-0253.pt|durations/LJ002-0253.pt|pitch_char/LJ002-0253.pt|were governed by rules which they themselves had framed, and under which subscriptions were levied
|
||||
mels/LJ048-0288.pt|durations/LJ048-0288.pt|pitch_char/LJ048-0288.pt|might have been more alert in the Dallas motorcade if they had retired promptly in Fort Worth.
|
||||
mels/LJ007-0112.pt|durations/LJ007-0112.pt|pitch_char/LJ007-0112.pt|Many of the old customs once prevalent in the State Side, so properly condemned and abolished,
|
||||
mels/LJ017-0189.pt|durations/LJ017-0189.pt|pitch_char/LJ017-0189.pt|who was presently attacked in the same way as the others, but, but, thanks to the prompt administration of remedies, he recovered.
|
||||
mels/LJ042-0230.pt|durations/LJ042-0230.pt|pitch_char/LJ042-0230.pt|basically, although I hate the USSR and socialist system I still think marxism can work under different circumstances, end quote.
|
||||
mels/LJ050-0161.pt|durations/LJ050-0161.pt|pitch_char/LJ050-0161.pt|The Secret Service should not and does not plan to develop its own intelligence gathering facilities to duplicate the existing facilities of other Federal agencies.
|
||||
mels/LJ003-0011.pt|durations/LJ003-0011.pt|pitch_char/LJ003-0011.pt|that not more than one bottle of wine or one quart of beer could be issued at one time. No account was taken of the amount of liquors admitted in one day,
|
||||
mels/LJ008-0206.pt|durations/LJ008-0206.pt|pitch_char/LJ008-0206.pt|and caused a number of stout additional barriers to be erected in front of the scaffold,
|
||||
mels/LJ002-0261.pt|durations/LJ002-0261.pt|pitch_char/LJ002-0261.pt|The poorer prisoners were not in abject want, as in other prisons,
|
||||
mels/LJ012-0189.pt|durations/LJ012-0189.pt|pitch_char/LJ012-0189.pt|Hunt, in consideration of the information he had given, escaped death, and was sentenced to transportation for life.
|
||||
mels/LJ019-0317.pt|durations/LJ019-0317.pt|pitch_char/LJ019-0317.pt|The former, which consisted principally of the tread-wheel, cranks, capstans, shot-drill,
|
||||
mels/LJ011-0041.pt|durations/LJ011-0041.pt|pitch_char/LJ011-0041.pt|Visited Mr. Fauntleroy. My application for books for him not having been attended, I had no prayer-book to give him.
|
||||
mels/LJ023-0089.pt|durations/LJ023-0089.pt|pitch_char/LJ023-0089.pt|That is not only my accusation.
|
||||
mels/LJ044-0224.pt|durations/LJ044-0224.pt|pitch_char/LJ044-0224.pt|would not agree with that particular wording, end quote.
|
||||
mels/LJ013-0104.pt|durations/LJ013-0104.pt|pitch_char/LJ013-0104.pt|He found them at length residing at the latter place, one as a landed proprietor, the other as a publican.
|
||||
mels/LJ013-0055.pt|durations/LJ013-0055.pt|pitch_char/LJ013-0055.pt|The jury did not believe him, and the verdict was for the defendants.
|
||||
mels/LJ014-0306.pt|durations/LJ014-0306.pt|pitch_char/LJ014-0306.pt|These had been attributed to political action; some thought that the large purchases in foreign grains, effected at losing prices,
|
||||
mels/LJ029-0052.pt|durations/LJ029-0052.pt|pitch_char/LJ029-0052.pt|To supplement the PRS files, the Secret Service depends largely on local police departments and local offices of other Federal agencies
|
||||
mels/LJ028-0459.pt|durations/LJ028-0459.pt|pitch_char/LJ028-0459.pt|Its bricks, measuring about thirteen inches square and three inches in thickness, were burned and stamped with the usual short inscription:
|
||||
mels/LJ017-0183.pt|durations/LJ017-0183.pt|pitch_char/LJ017-0183.pt|Soon afterwards Dixon died, showing all the symptoms already described.
|
||||
mels/LJ009-0084.pt|durations/LJ009-0084.pt|pitch_char/LJ009-0084.pt|At length the ordinary pauses, and then, in a deep tone, which, though hardly above a whisper, is audible to all, says,
|
||||
mels/LJ007-0170.pt|durations/LJ007-0170.pt|pitch_char/LJ007-0170.pt|That in this vast metropolis, the center of wealth, civilization, and information;
|
||||
mels/LJ016-0277.pt|durations/LJ016-0277.pt|pitch_char/LJ016-0277.pt|This is proved by contemporary accounts, especially one graphic and realistic article which appeared in the 'Times,'
|
||||
mels/LJ009-0061.pt|durations/LJ009-0061.pt|pitch_char/LJ009-0061.pt|He staggers towards the pew, reels into it, stumbles forward, flings himself on the ground, and, by a curious twist of the spine,
|
||||
mels/LJ019-0201.pt|durations/LJ019-0201.pt|pitch_char/LJ019-0201.pt|to select a sufficiently spacious piece of ground, and erect a prison which from foundations to roofs should be in conformity with the newest ideas.
|
||||
mels/LJ030-0063.pt|durations/LJ030-0063.pt|pitch_char/LJ030-0063.pt|He had repeated this wish only a few days before, during his visit to Tampa, Florida.
|
||||
mels/LJ010-0257.pt|durations/LJ010-0257.pt|pitch_char/LJ010-0257.pt|a third miscreant made a similar but far less serious attempt in the month of July following.
|
||||
mels/LJ009-0106.pt|durations/LJ009-0106.pt|pitch_char/LJ009-0106.pt|The keeper tries to appear unmoved, but his eye wanders anxiously over the combustible assembly.
|
||||
mels/LJ008-0121.pt|durations/LJ008-0121.pt|pitch_char/LJ008-0121.pt|After the construction and action of the machine had been explained, the doctor asked the governor what kind of men he had commanded at Goree,
|
||||
mels/LJ050-0069.pt|durations/LJ050-0069.pt|pitch_char/LJ050-0069.pt|the Secret Service had received from the FBI some nine thousand reports on members of the Communist Party.
|
||||
mels/LJ006-0202.pt|durations/LJ006-0202.pt|pitch_char/LJ006-0202.pt|The news-vendor was also a tobacconist,
|
||||
mels/LJ012-0230.pt|durations/LJ012-0230.pt|pitch_char/LJ012-0230.pt|Shortly before the day fixed for execution, Bishop made a full confession, the bulk of which bore the impress of truth,
|
||||
mels/LJ005-0248.pt|durations/LJ005-0248.pt|pitch_char/LJ005-0248.pt|and stated that in his opinion Newgate, as the common jail of Middlesex, was wholly inadequate to the proper confinement of its prisoners.
|
||||
mels/LJ037-0053.pt|durations/LJ037-0053.pt|pitch_char/LJ037-0053.pt|who had been greatly upset by her experience, was able to view a lineup of four men handcuffed together at the police station.
|
||||
mels/LJ045-0177.pt|durations/LJ045-0177.pt|pitch_char/LJ045-0177.pt|For the first time
|
||||
mels/LJ004-0036.pt|durations/LJ004-0036.pt|pitch_char/LJ004-0036.pt|it was hoped that their rulers would hire accommodation in the county prisons, and that the inferior establishments would in course of time disappear.
|
||||
mels/LJ026-0054.pt|durations/LJ026-0054.pt|pitch_char/LJ026-0054.pt|carbohydrates (starch, cellulose) and fats.
|
||||
mels/LJ020-0085.pt|durations/LJ020-0085.pt|pitch_char/LJ020-0085.pt|Break apart from one another and pile on a plate, throwing a clean doily or a small napkin over them. Break open at table.
|
||||
mels/LJ046-0226.pt|durations/LJ046-0226.pt|pitch_char/LJ046-0226.pt|The several military intelligence agencies reported crank mail and similar threats involving the President.
|
||||
mels/LJ014-0233.pt|durations/LJ014-0233.pt|pitch_char/LJ014-0233.pt|he shot an old soldier who had attempted to detain him. He was convicted and executed.
|
||||
mels/LJ033-0152.pt|durations/LJ033-0152.pt|pitch_char/LJ033-0152.pt|The portion of the palm which was identified was the heel of the right palm, i.e., the area near the wrist, on the little finger side.
|
||||
mels/LJ004-0009.pt|durations/LJ004-0009.pt|pitch_char/LJ004-0009.pt|as indefatigable and self-sacrificing, found by personal visitation that the condition of jails throughout the kingdom was,
|
||||
mels/LJ017-0134.pt|durations/LJ017-0134.pt|pitch_char/LJ017-0134.pt|Within a few weeks occurred the Leeds poisoning case, in which the murderer undoubtedly was inspired by the facts made public at Palmer's trial.
|
||||
mels/LJ019-0318.pt|durations/LJ019-0318.pt|pitch_char/LJ019-0318.pt|was to be the rule for all convicted prisoners throughout the early stages of their detention;
|
||||
mels/LJ020-0093.pt|durations/LJ020-0093.pt|pitch_char/LJ020-0093.pt|Rise, wash face and hands, rinse the mouth out and brush back the hair.
|
||||
mels/LJ012-0188.pt|durations/LJ012-0188.pt|pitch_char/LJ012-0188.pt|Probert was then admitted as a witness, and the case was fully proved against Thurtell, who was hanged in front of Hertford Jail.
|
||||
mels/LJ019-0202.pt|durations/LJ019-0202.pt|pitch_char/LJ019-0202.pt|The preference given to the Pentonville system destroyed all hopes of a complete reformation of Newgate.
|
||||
mels/LJ039-0027.pt|durations/LJ039-0027.pt|pitch_char/LJ039-0027.pt|Oswald's revolver
|
||||
mels/LJ040-0176.pt|durations/LJ040-0176.pt|pitch_char/LJ040-0176.pt|He admitted to fantasies about being powerful and sometimes hurting and killing people, but refused to elaborate on them.
|
||||
mels/LJ018-0354.pt|durations/LJ018-0354.pt|pitch_char/LJ018-0354.pt|Doubts were long entertained whether Thomas Wainwright,
|
||||
mels/LJ031-0185.pt|durations/LJ031-0185.pt|pitch_char/LJ031-0185.pt|From the Presidential airplane, the Vice President telephoned Attorney General Robert F. Kennedy,
|
||||
mels/LJ006-0137.pt|durations/LJ006-0137.pt|pitch_char/LJ006-0137.pt|They were not obliged to attend chapel, and seldom if ever went; "prisoners," said one of them under examination, "did not like the trouble of going to chapel."
|
||||
mels/LJ032-0085.pt|durations/LJ032-0085.pt|pitch_char/LJ032-0085.pt|The Hidell signature on the notice of classification was in the handwriting of Oswald.
|
||||
mels/LJ009-0037.pt|durations/LJ009-0037.pt|pitch_char/LJ009-0037.pt|the schoolmaster and the juvenile prisoners being seated round the communion-table, opposite the pulpit.
|
||||
mels/LJ006-0021.pt|durations/LJ006-0021.pt|pitch_char/LJ006-0021.pt|Later on he had devoted himself to the personal investigation of the prisons of the United States.
|
||||
mels/LJ006-0082.pt|durations/LJ006-0082.pt|pitch_char/LJ006-0082.pt|and this particular official took excellent care to select as residents for his own ward those most suitable from his own point of view.
|
||||
mels/LJ016-0380.pt|durations/LJ016-0380.pt|pitch_char/LJ016-0380.pt|with hope to the last. There is always the chance of a flaw in the indictment, of a missing witness, or extenuating circumstances.
|
||||
mels/LJ019-0344.pt|durations/LJ019-0344.pt|pitch_char/LJ019-0344.pt|monitor, or schoolmaster, nor to be engaged in the service of any officer of the prison.
|
||||
mels/LJ019-0161.pt|durations/LJ019-0161.pt|pitch_char/LJ019-0161.pt|These disciplinary improvements were, however, only slowly and gradually introduced.
|
||||
mels/LJ028-0145.pt|durations/LJ028-0145.pt|pitch_char/LJ028-0145.pt|And here I may not omit to tell the use to which the mould dug out of the great moat was turned, nor the manner wherein the wall was wrought.
|
||||
mels/LJ018-0349.pt|durations/LJ018-0349.pt|pitch_char/LJ018-0349.pt|His disclaimer, distinct and detailed on every point, was intended simply for effect.
|
||||
mels/LJ043-0010.pt|durations/LJ043-0010.pt|pitch_char/LJ043-0010.pt|Some of the members of that group saw a good deal of the Oswalds through the fall of nineteen sixty-three,
|
||||
mels/LJ027-0178.pt|durations/LJ027-0178.pt|pitch_char/LJ027-0178.pt|These were undoubtedly perennibranchs. In the Permian and Triassic higher forms appeared, which were certainly caducibranch.
|
||||
mels/LJ041-0070.pt|durations/LJ041-0070.pt|pitch_char/LJ041-0070.pt|He did not rise above the rank of private first class, even though he had passed a qualifying examination for the rank of corporal.
|
||||
mels/LJ008-0266.pt|durations/LJ008-0266.pt|pitch_char/LJ008-0266.pt|Thus in the years between May first, eighteen twenty-seven, and thirtieth April, eighteen thirty-one,
|
||||
mels/LJ021-0091.pt|durations/LJ021-0091.pt|pitch_char/LJ021-0091.pt|In this recent reorganization we have recognized three distinct functions:
|
||||
mels/LJ019-0129.pt|durations/LJ019-0129.pt|pitch_char/LJ019-0129.pt|which marked the growth of public interest in prison affairs, and which was the germ of the new system
|
||||
mels/LJ018-0215.pt|durations/LJ018-0215.pt|pitch_char/LJ018-0215.pt|William Roupell was the eldest but illegitimate son of a wealthy man who subsequently married Roupell's mother, and had further legitimate issue.
|
||||
mels/LJ015-0194.pt|durations/LJ015-0194.pt|pitch_char/LJ015-0194.pt|and behaved so as to justify a belief that he had been a jail-bird all his life.
|
||||
mels/LJ016-0137.pt|durations/LJ016-0137.pt|pitch_char/LJ016-0137.pt|that numbers of men, "lifers," and others with ten, fourteen, or twenty years to do, can be trusted to work out of doors without bolts and bars
|
||||
mels/LJ002-0289.pt|durations/LJ002-0289.pt|pitch_char/LJ002-0289.pt|the latter raised eighteen pence among them to pay for a truss of straw for the poor woman to lie on.
|
||||
mels/LJ023-0016.pt|durations/LJ023-0016.pt|pitch_char/LJ023-0016.pt|In nineteen thirty-three you and I knew that we must never let our economic system get completely out of joint again
|
||||
mels/LJ011-0141.pt|durations/LJ011-0141.pt|pitch_char/LJ011-0141.pt|There were at the moment in Newgate six convicts sentenced to death for forging wills.
|
||||
mels/LJ016-0283.pt|durations/LJ016-0283.pt|pitch_char/LJ016-0283.pt|to do them mere justice, there was at least till then a half-drunken ribald gaiety among the crowd that made them all akin."
|
||||
mels/LJ035-0082.pt|durations/LJ035-0082.pt|pitch_char/LJ035-0082.pt|The only interval was the time necessary to ride in the elevator from the second to the sixth floor and walk back to the southeast corner.
|
||||
mels/LJ045-0194.pt|durations/LJ045-0194.pt|pitch_char/LJ045-0194.pt|Anyone who was familiar with that area of Dallas would have known that the motorcade would probably pass the Texas School Book Depository to get from Main Street
|
||||
mels/LJ009-0124.pt|durations/LJ009-0124.pt|pitch_char/LJ009-0124.pt|occupied when they saw it last, but a few hours ago, by their comrades who are now dead;
|
||||
mels/LJ030-0162.pt|durations/LJ030-0162.pt|pitch_char/LJ030-0162.pt|In the Presidential Limousine
|
||||
mels/LJ050-0223.pt|durations/LJ050-0223.pt|pitch_char/LJ050-0223.pt|The plan provides for an additional two hundred five agents for the Secret Service. Seventeen of this number are proposed for the Protective Research Section;
|
||||
mels/LJ008-0228.pt|durations/LJ008-0228.pt|pitch_char/LJ008-0228.pt|their harsh and half-cracked voices full of maudlin, besotted sympathy for those about to die.
|
||||
mels/LJ002-0096.pt|durations/LJ002-0096.pt|pitch_char/LJ002-0096.pt|The eight courts above enumerated were well supplied with water;
|
||||
mels/LJ018-0288.pt|durations/LJ018-0288.pt|pitch_char/LJ018-0288.pt|After this the other conspirators traveled to obtain genuine bills and master the system of the leading houses at home and abroad.
|
||||
mels/LJ002-0106.pt|durations/LJ002-0106.pt|pitch_char/LJ002-0106.pt|in which latterly a copper had been fixed for the cooking of provisions sent in by charitable persons.
|
||||
mels/LJ025-0129.pt|durations/LJ025-0129.pt|pitch_char/LJ025-0129.pt|On each lobe of the bi-lobed leaf of Venus flytrap are three delicate filaments which stand out at right angles from the surface of the leaf.
|
||||
mels/LJ044-0013.pt|durations/LJ044-0013.pt|pitch_char/LJ044-0013.pt|Hands Off Cuba, end quote, an application form for, and a membership card in,
|
||||
mels/LJ049-0115.pt|durations/LJ049-0115.pt|pitch_char/LJ049-0115.pt|of the person who is actually in the exercise of the executive power, or
|
||||
mels/LJ019-0145.pt|durations/LJ019-0145.pt|pitch_char/LJ019-0145.pt|But reformation was only skin deep. Below the surface many of the old evils still rankled.
|
||||
mels/LJ019-0355.pt|durations/LJ019-0355.pt|pitch_char/LJ019-0355.pt|came up in all respects to modern requirements.
|
||||
mels/LJ019-0289.pt|durations/LJ019-0289.pt|pitch_char/LJ019-0289.pt|There was unrestrained association of untried and convicted, juvenile with adult prisoners, vagrants, misdemeanants, felons.
|
||||
mels/LJ048-0222.pt|durations/LJ048-0222.pt|pitch_char/LJ048-0222.pt|in Fort Worth, there occurred a breach of discipline by some members of the Secret Service who were officially traveling with the President.
|
||||
mels/LJ016-0367.pt|durations/LJ016-0367.pt|pitch_char/LJ016-0367.pt|Under the new system the whole of the arrangements from first to last fell upon the officers.
|
||||
mels/LJ047-0097.pt|durations/LJ047-0097.pt|pitch_char/LJ047-0097.pt|Agent Quigley did not know of Oswald's prior FBI record when he interviewed him,
|
||||
mels/LJ007-0075.pt|durations/LJ007-0075.pt|pitch_char/LJ007-0075.pt|as effectually to rebuke and abash the profane spirit of the more insolent and daring of the criminals.
|
||||
mels/LJ047-0022.pt|durations/LJ047-0022.pt|pitch_char/LJ047-0022.pt|provided by other agencies.
|
||||
mels/LJ007-0085.pt|durations/LJ007-0085.pt|pitch_char/LJ007-0085.pt|at Newgate and York Castle as long as five years; "at Ilchester and Morpeth for seven years; at Warwick for eight years,
|
||||
mels/LJ047-0075.pt|durations/LJ047-0075.pt|pitch_char/LJ047-0075.pt|Hosty had inquired earlier and found no evidence that it was functioning in the Dallas area.
|
||||
mels/LJ008-0098.pt|durations/LJ008-0098.pt|pitch_char/LJ008-0098.pt|One was the "yeoman of the halter," a Newgate official, the executioner's assistant, whom Mr. J. T. Smith, who was present at the execution,
|
||||
mels/LJ017-0102.pt|durations/LJ017-0102.pt|pitch_char/LJ017-0102.pt|The second attack was fatal, and ended in Cook's death from tetanus.
|
||||
mels/LJ046-0105.pt|durations/LJ046-0105.pt|pitch_char/LJ046-0105.pt|Second, the adequacy of other advance preparations for the security of the President, during his visit to Dallas,
|
||||
mels/LJ018-0206.pt|durations/LJ018-0206.pt|pitch_char/LJ018-0206.pt|He was a tall, slender man, with a long face and iron-gray hair.
|
||||
mels/LJ012-0271.pt|durations/LJ012-0271.pt|pitch_char/LJ012-0271.pt|Whether it was greed or a quarrel that drove Greenacre to the desperate deed remains obscure.
|
||||
mels/LJ005-0086.pt|durations/LJ005-0086.pt|pitch_char/LJ005-0086.pt|with such further separation as the justices should deem conducive to good order and discipline.
|
||||
mels/LJ042-0097.pt|durations/LJ042-0097.pt|pitch_char/LJ042-0097.pt|and considerably better living quarters than those accorded to Soviet citizens of equal age and station.
|
||||
mels/LJ047-0126.pt|durations/LJ047-0126.pt|pitch_char/LJ047-0126.pt|we would handle it in due course, in accord with the whole context of the investigation. End quote.
|
||||
mels/LJ041-0022.pt|durations/LJ041-0022.pt|pitch_char/LJ041-0022.pt|Oswald first wrote, quote, Edward Vogel, end quote, an obvious misspelling of Voebel's name,
|
||||
mels/LJ015-0025.pt|durations/LJ015-0025.pt|pitch_char/LJ015-0025.pt|The bank enjoyed an excellent reputation, it had a good connection, and was supposed to be perfectly sound.
|
||||
mels/LJ012-0194.pt|durations/LJ012-0194.pt|pitch_char/LJ012-0194.pt|But Burke and Hare had their imitators further south,
|
||||
mels/LJ028-0416.pt|durations/LJ028-0416.pt|pitch_char/LJ028-0416.pt|(if man may speak so confidently of His great impenetrable counsels), for an eternal Testimony of His great work in the confusion of Man's pride,
|
||||
mels/LJ007-0130.pt|durations/LJ007-0130.pt|pitch_char/LJ007-0130.pt|are all huddled together without discrimination, oversight, or control."
|
||||
mels/LJ015-0005.pt|durations/LJ015-0005.pt|pitch_char/LJ015-0005.pt|About this time Davidson and Gordon, the people above-mentioned,
|
||||
mels/LJ016-0125.pt|durations/LJ016-0125.pt|pitch_char/LJ016-0125.pt|with this, placed against the wall near the chevaux-de-frise, he made an escalade.
|
||||
mels/LJ014-0224.pt|durations/LJ014-0224.pt|pitch_char/LJ014-0224.pt|As Dwyer survived, Cannon escaped the death sentence, which was commuted to penal servitude for life.
|
||||
mels/LJ005-0019.pt|durations/LJ005-0019.pt|pitch_char/LJ005-0019.pt|refuted by abundant evidence, and having no foundation whatever in truth.
|
||||
mels/LJ042-0221.pt|durations/LJ042-0221.pt|pitch_char/LJ042-0221.pt|With either great ambivalence, or cold calculation he prepared completely different answers to the same questions.
|
||||
mels/LJ001-0063.pt|durations/LJ001-0063.pt|pitch_char/LJ001-0063.pt|which was generally more formally Gothic than the printing of the German workmen,
|
||||
mels/LJ030-0006.pt|durations/LJ030-0006.pt|pitch_char/LJ030-0006.pt|They took off in the Presidential plane, Air Force One, at eleven a.m., arriving at San Antonio at one:thirty p.m., Eastern Standard Time.
|
||||
mels/LJ024-0054.pt|durations/LJ024-0054.pt|pitch_char/LJ024-0054.pt|democracy will have failed far beyond the importance to it of any king of precedent concerning the judiciary.
|
||||
mels/LJ006-0044.pt|durations/LJ006-0044.pt|pitch_char/LJ006-0044.pt|the same callous indifference to the moral well-being of the prisoners, the same want of employment and of all disciplinary control.
|
||||
mels/LJ039-0154.pt|durations/LJ039-0154.pt|pitch_char/LJ039-0154.pt|four point eight to five point six seconds if the second shot missed,
|
||||
mels/LJ050-0090.pt|durations/LJ050-0090.pt|pitch_char/LJ050-0090.pt|they seem unduly restrictive in continuing to require some manifestation of animus against a Government official.
|
||||
mels/LJ028-0421.pt|durations/LJ028-0421.pt|pitch_char/LJ028-0421.pt|it was the beginning of the great collections of Babylonian antiquities in the museums of the Western world.
|
||||
mels/LJ033-0205.pt|durations/LJ033-0205.pt|pitch_char/LJ033-0205.pt|then I would say the possibility exists, these fibers could have come from this blanket, end quote.
|
||||
mels/LJ019-0335.pt|durations/LJ019-0335.pt|pitch_char/LJ019-0335.pt|The books and journals he was to keep were minutely specified, and his constant presence in or near the jail was insisted upon.
|
||||
mels/LJ013-0045.pt|durations/LJ013-0045.pt|pitch_char/LJ013-0045.pt|Wallace's relations warned him against his Liverpool friend,
|
||||
mels/LJ037-0002.pt|durations/LJ037-0002.pt|pitch_char/LJ037-0002.pt|Chapter four. The Assassin: Part six.
|
||||
mels/LJ018-0159.pt|durations/LJ018-0159.pt|pitch_char/LJ018-0159.pt|This was all the police wanted to know.
|
||||
mels/LJ026-0140.pt|durations/LJ026-0140.pt|pitch_char/LJ026-0140.pt|In the plant as in the animal metabolism must consist of anabolic and catabolic processes.
|
||||
mels/LJ014-0171.pt|durations/LJ014-0171.pt|pitch_char/LJ014-0171.pt|I will briefly describe one or two of the more remarkable murders in the years immediately following, then pass on to another branch of crime.
|
||||
mels/LJ037-0007.pt|durations/LJ037-0007.pt|pitch_char/LJ037-0007.pt|Three others subsequently identified Oswald from a photograph.
|
||||
mels/LJ033-0174.pt|durations/LJ033-0174.pt|pitch_char/LJ033-0174.pt|microscopic and UV (ultra violet) characteristics, end quote.
|
||||
mels/LJ040-0110.pt|durations/LJ040-0110.pt|pitch_char/LJ040-0110.pt|he apparently adjusted well enough there to have had an average, although gradually deteriorating, school record
|
||||
mels/LJ039-0192.pt|durations/LJ039-0192.pt|pitch_char/LJ039-0192.pt|he had a total of between four point eight and five point six seconds between the two shots which hit
|
||||
mels/LJ032-0261.pt|durations/LJ032-0261.pt|pitch_char/LJ032-0261.pt|When he appeared before the Commission, Michael Paine lifted the blanket
|
||||
mels/LJ040-0097.pt|durations/LJ040-0097.pt|pitch_char/LJ040-0097.pt|Lee was brought up in this atmosphere of constant money problems, and I am sure it had quite an effect on him, and also Robert, end quote.
|
||||
mels/LJ037-0249.pt|durations/LJ037-0249.pt|pitch_char/LJ037-0249.pt|Mrs. Earlene Roberts, the housekeeper at Oswald's roominghouse and the last person known to have seen him before he reached tenth Street and Patton Avenue,
|
||||
mels/LJ016-0248.pt|durations/LJ016-0248.pt|pitch_char/LJ016-0248.pt|Marwood was proud of his calling, and when questioned as to whether his process was satisfactory, replied that he heard "no complaints."
|
||||
mels/LJ004-0083.pt|durations/LJ004-0083.pt|pitch_char/LJ004-0083.pt|As Mr. Buxton pointed out, many old acts of parliament designed to protect the prisoner were still in full force.
|
||||
mels/LJ014-0029.pt|durations/LJ014-0029.pt|pitch_char/LJ014-0029.pt|This was Delarue's watch, fully identified as such, which Hocker told his brother Delarue had given him the morning of the murder.
|
||||
mels/LJ021-0110.pt|durations/LJ021-0110.pt|pitch_char/LJ021-0110.pt|have been best calculated to promote industrial recovery and a permanent improvement of business and labor conditions.
|
||||
mels/LJ003-0107.pt|durations/LJ003-0107.pt|pitch_char/LJ003-0107.pt|he slept in the same bed with a highwayman on one side, and a man charged with murder on the other.
|
||||
mels/LJ039-0076.pt|durations/LJ039-0076.pt|pitch_char/LJ039-0076.pt|Ronald Simmons, chief of the U.S. Army Infantry Weapons Evaluation Branch of the Ballistics Research Laboratory, said, quote,
|
||||
mels/LJ016-0347.pt|durations/LJ016-0347.pt|pitch_char/LJ016-0347.pt|had undoubtedly a solemn, impressive effect upon those outside.
|
||||
mels/LJ001-0072.pt|durations/LJ001-0072.pt|pitch_char/LJ001-0072.pt|After the end of the fifteenth century the degradation of printing, especially in Germany and Italy,
|
||||
mels/LJ024-0018.pt|durations/LJ024-0018.pt|pitch_char/LJ024-0018.pt|Consequently, although there never can be more than fifteen, there may be only fourteen, or thirteen, or twelve.
|
||||
mels/LJ032-0180.pt|durations/LJ032-0180.pt|pitch_char/LJ032-0180.pt|that the fibers were caught in the crevice of the rifle's butt plate, quote, in the recent past, end quote,
|
||||
mels/LJ010-0083.pt|durations/LJ010-0083.pt|pitch_char/LJ010-0083.pt|and measures taken to arrest them when their plans were so far developed that no doubt could remain as to their guilt.
|
||||
mels/LJ002-0299.pt|durations/LJ002-0299.pt|pitch_char/LJ002-0299.pt|and gave the garnish for the common side at that sum, which is five shillings more than Mr. Neild says was extorted on the common side.
|
||||
mels/LJ048-0143.pt|durations/LJ048-0143.pt|pitch_char/LJ048-0143.pt|the Secret Service did not at the time of the assassination have any established procedure governing its relationships with them.
|
||||
mels/LJ012-0054.pt|durations/LJ012-0054.pt|pitch_char/LJ012-0054.pt|Solomons, while waiting to appear in court, persuaded the turnkeys to take him to a public-house, where all might "refresh."
|
||||
mels/LJ019-0270.pt|durations/LJ019-0270.pt|pitch_char/LJ019-0270.pt|Vegetables, especially the potato, that most valuable anti-scorbutic, was too often omitted.
|
||||
mels/LJ035-0164.pt|durations/LJ035-0164.pt|pitch_char/LJ035-0164.pt|three minutes after the shooting.
|
||||
mels/LJ014-0326.pt|durations/LJ014-0326.pt|pitch_char/LJ014-0326.pt|Maltby and Co. would issue warrants on them deliverable to the importer, and the goods were then passed to be stored in neighboring warehouses.
|
||||
mels/LJ001-0173.pt|durations/LJ001-0173.pt|pitch_char/LJ001-0173.pt|The essential point to be remembered is that the ornament, whatever it is, whether picture or pattern-work, should form part of the page,
|
||||
mels/LJ050-0056.pt|durations/LJ050-0056.pt|pitch_char/LJ050-0056.pt|On December twenty-six, nineteen sixty-three, the FBI circulated additional instructions to all its agents,
|
||||
mels/LJ003-0319.pt|durations/LJ003-0319.pt|pitch_char/LJ003-0319.pt|provided only that their security was not jeopardized, and dependent upon the enforcement of another new rule,
|
||||
mels/LJ006-0040.pt|durations/LJ006-0040.pt|pitch_char/LJ006-0040.pt|The fact was that the years as they passed, nearly twenty in all, had worked but little permanent improvement in this detestable prison.
|
||||
mels/LJ017-0231.pt|durations/LJ017-0231.pt|pitch_char/LJ017-0231.pt|His body was found lying in a pool of blood in a night-dress, stabbed over and over again in the left side.
|
||||
mels/LJ017-0226.pt|durations/LJ017-0226.pt|pitch_char/LJ017-0226.pt|One half of the mutineers fell upon him unawares with handspikes and capstan-bars.
|
||||
mels/LJ004-0239.pt|durations/LJ004-0239.pt|pitch_char/LJ004-0239.pt|He had been committed for an offense for which he was acquitted.
|
||||
mels/LJ048-0112.pt|durations/LJ048-0112.pt|pitch_char/LJ048-0112.pt|The Commission also regards the security arrangements worked out by Lawson and Sorrels at Love Field as entirely adequate.
|
||||
mels/LJ039-0125.pt|durations/LJ039-0125.pt|pitch_char/LJ039-0125.pt|that Oswald was a good shot, somewhat better than or equal to -- better than the average let us say.
|
||||
mels/LJ030-0196.pt|durations/LJ030-0196.pt|pitch_char/LJ030-0196.pt|He cried out, quote, Oh, no, no, no. My God, they are going to kill us all, end quote,
|
||||
mels/LJ010-0228.pt|durations/LJ010-0228.pt|pitch_char/LJ010-0228.pt|He was released from Broadmoor in eighteen seventy-eight, and went abroad.
|
||||
mels/LJ045-0228.pt|durations/LJ045-0228.pt|pitch_char/LJ045-0228.pt|On the other hand, he could have traveled some distance with the money he did have and he did return to his room where he obtained his revolver.
|
||||
mels/LJ028-0168.pt|durations/LJ028-0168.pt|pitch_char/LJ028-0168.pt|in the other was the sacred precinct of Jupiter Belus,
|
||||
mels/LJ021-0140.pt|durations/LJ021-0140.pt|pitch_char/LJ021-0140.pt|and in such an effort we should be able to secure for employers and employees and consumers
|
||||
mels/LJ009-0280.pt|durations/LJ009-0280.pt|pitch_char/LJ009-0280.pt|Again the wretched creature succeeded in obtaining foothold, but this time on the left side of the drop.
|
||||
mels/LJ003-0159.pt|durations/LJ003-0159.pt|pitch_char/LJ003-0159.pt|To constitute this the aristocratic quarter, unwarrantable demands were made upon the space properly allotted to the female felons,
|
||||
mels/LJ016-0274.pt|durations/LJ016-0274.pt|pitch_char/LJ016-0274.pt|and the windows of the opposite houses, which commanded a good view, as usual fetched high prices.
|
||||
mels/LJ035-0014.pt|durations/LJ035-0014.pt|pitch_char/LJ035-0014.pt|it sounded high and I immediately kind of looked up,
|
||||
mels/LJ033-0120.pt|durations/LJ033-0120.pt|pitch_char/LJ033-0120.pt|which he believed was where the bag reached when it was laid on the seat with one edge against the door.
|
||||
mels/LJ045-0015.pt|durations/LJ045-0015.pt|pitch_char/LJ045-0015.pt|which Johnson said he did not receive until after the assassination. The letter said in part, quote,
|
||||
mels/LJ003-0299.pt|durations/LJ003-0299.pt|pitch_char/LJ003-0299.pt|the latter end of the nineteenth century, several of which still fall far short of our English ideal,
|
||||
mels/LJ032-0206.pt|durations/LJ032-0206.pt|pitch_char/LJ032-0206.pt|After comparing the rifle in the simulated photograph with the rifle in Exhibit Number one thirty-three A, Shaneyfelt testified, quote,
|
||||
mels/LJ028-0494.pt|durations/LJ028-0494.pt|pitch_char/LJ028-0494.pt|Between the several sections were wide spaces where foot soldiers and charioteers might fight.
|
||||
mels/LJ005-0099.pt|durations/LJ005-0099.pt|pitch_char/LJ005-0099.pt|and report at length upon the condition of the prisons of the country.
|
||||
mels/LJ015-0144.pt|durations/LJ015-0144.pt|pitch_char/LJ015-0144.pt|developed to a colossal extent the frauds he had already practiced as a subordinate.
|
||||
mels/LJ019-0221.pt|durations/LJ019-0221.pt|pitch_char/LJ019-0221.pt|It was intended as far as possible that, except awaiting trial, no prisoner should find himself relegated to Newgate.
|
||||
mels/LJ003-0088.pt|durations/LJ003-0088.pt|pitch_char/LJ003-0088.pt|in one, for seven years -- that of a man sentenced to death, for whom great interest had been made, but whom it was not thought right to pardon.
|
||||
mels/LJ045-0216.pt|durations/LJ045-0216.pt|pitch_char/LJ045-0216.pt|nineteen sixty-three, merely to disarm her and to provide a justification of sorts,
|
||||
mels/LJ042-0135.pt|durations/LJ042-0135.pt|pitch_char/LJ042-0135.pt|that he was not yet twenty years old when he went to the Soviet Union with such high hopes and not quite twenty-three when he returned bitterly disappointed.
|
||||
mels/LJ049-0196.pt|durations/LJ049-0196.pt|pitch_char/LJ049-0196.pt|On the other hand, it is urged that all features of the protection of the President and his family should be committed to an elite and independent corps.
|
||||
mels/LJ018-0278.pt|durations/LJ018-0278.pt|pitch_char/LJ018-0278.pt|This was the well and astutely devised plot of the brothers Bidwell,
|
||||
mels/LJ030-0238.pt|durations/LJ030-0238.pt|pitch_char/LJ030-0238.pt|and then looked around again and saw more of this movement, and so I proceeded to go to the back seat and get on top of him.
|
||||
mels/LJ018-0309.pt|durations/LJ018-0309.pt|pitch_char/LJ018-0309.pt|where probably the money still remains.
|
||||
mels/LJ041-0199.pt|durations/LJ041-0199.pt|pitch_char/LJ041-0199.pt|is shown most clearly by his employment relations after his return from the Soviet Union. Of course, he made his real problems worse to the extent
|
||||
mels/LJ007-0076.pt|durations/LJ007-0076.pt|pitch_char/LJ007-0076.pt|The lax discipline maintained in Newgate was still further deteriorated by the presence of two other classes of prisoners who ought never to have been inmates of such a jail.
|
||||
mels/LJ039-0118.pt|durations/LJ039-0118.pt|pitch_char/LJ039-0118.pt|He had high motivation. He had presumably a good to excellent rifle and good ammunition.
|
||||
mels/LJ024-0019.pt|durations/LJ024-0019.pt|pitch_char/LJ024-0019.pt|And there may be only nine.
|
||||
mels/LJ008-0085.pt|durations/LJ008-0085.pt|pitch_char/LJ008-0085.pt|The fire had not quite burnt out at twelve, in nearly four hours, that is to say.
|
||||
mels/LJ018-0031.pt|durations/LJ018-0031.pt|pitch_char/LJ018-0031.pt|This fixed the crime pretty certainly upon Müller, who had already left the country, thus increasing suspicion under which he lay.
|
||||
mels/LJ030-0032.pt|durations/LJ030-0032.pt|pitch_char/LJ030-0032.pt|Dallas police stood at intervals along the fence and Dallas plain clothes men mixed in the crowd.
|
||||
mels/LJ050-0004.pt|durations/LJ050-0004.pt|pitch_char/LJ050-0004.pt|General Supervision of the Secret Service
|
||||
mels/LJ039-0096.pt|durations/LJ039-0096.pt|pitch_char/LJ039-0096.pt|This is a definite advantage to the shooter, the vehicle moving directly away from him and the downgrade of the street, and he being in an elevated position
|
||||
mels/LJ041-0195.pt|durations/LJ041-0195.pt|pitch_char/LJ041-0195.pt|Oswald's interest in Marxism led some people to avoid him,
|
||||
mels/LJ047-0158.pt|durations/LJ047-0158.pt|pitch_char/LJ047-0158.pt|After a moment's hesitation, she told me that he worked at the Texas School Book Depository near the downtown area of Dallas.
|
||||
mels/LJ050-0162.pt|durations/LJ050-0162.pt|pitch_char/LJ050-0162.pt|In planning its data processing techniques,
|
||||
mels/LJ001-0051.pt|durations/LJ001-0051.pt|pitch_char/LJ001-0051.pt|and paying great attention to the "press work" or actual process of printing,
|
||||
mels/LJ028-0136.pt|durations/LJ028-0136.pt|pitch_char/LJ028-0136.pt|Of all the ancient descriptions of the famous walls and the city they protected, that of Herodotus is the fullest.
|
||||
mels/LJ034-0134.pt|durations/LJ034-0134.pt|pitch_char/LJ034-0134.pt|Shortly after the assassination Brennan noticed
|
||||
mels/LJ019-0348.pt|durations/LJ019-0348.pt|pitch_char/LJ019-0348.pt|Every facility was promised. The sanction of the Secretary of State would not be withheld if plans and estimates were duly submitted,
|
||||
mels/LJ010-0219.pt|durations/LJ010-0219.pt|pitch_char/LJ010-0219.pt|While one stood over the fire with the papers, another stood with lighted torch to fire the house.
|
||||
mels/LJ011-0245.pt|durations/LJ011-0245.pt|pitch_char/LJ011-0245.pt|Mr. Mullay called again, taking with him five hundred pounds in cash. Howard discovered this, and his manner was very suspicious;
|
||||
mels/LJ030-0035.pt|durations/LJ030-0035.pt|pitch_char/LJ030-0035.pt|Organization of the Motorcade
|
||||
mels/LJ044-0135.pt|durations/LJ044-0135.pt|pitch_char/LJ044-0135.pt|While he had drawn some attention to himself and had actually appeared on two radio programs, he had been attacked by Cuban exiles and arrested,
|
||||
mels/LJ045-0090.pt|durations/LJ045-0090.pt|pitch_char/LJ045-0090.pt|He was very much interested in autobiographical works of outstanding statesmen of the United States, to whom his wife thought he compared himself.
|
||||
mels/LJ026-0034.pt|durations/LJ026-0034.pt|pitch_char/LJ026-0034.pt|When any given "protist" has to be classified the case must be decided on its individual merits;
|
||||
mels/LJ045-0092.pt|durations/LJ045-0092.pt|pitch_char/LJ045-0092.pt|as to the fact that he was an outstanding man, end quote.
|
||||
mels/LJ017-0050.pt|durations/LJ017-0050.pt|pitch_char/LJ017-0050.pt|Palmer, who was only thirty-one at the time of his trial, was in appearance short and stout, with a round head
|
||||
mels/LJ036-0104.pt|durations/LJ036-0104.pt|pitch_char/LJ036-0104.pt|Whaley picked Oswald.
|
||||
mels/LJ019-0055.pt|durations/LJ019-0055.pt|pitch_char/LJ019-0055.pt|High authorities were in favor of continuous separation.
|
||||
mels/LJ010-0030.pt|durations/LJ010-0030.pt|pitch_char/LJ010-0030.pt|The brutal ferocity of the wild beast once aroused, the same means, the same weapons were employed to do the dreadful deed,
|
||||
mels/LJ038-0047.pt|durations/LJ038-0047.pt|pitch_char/LJ038-0047.pt|Some of the officers saw Oswald strike McDonald with his fist. Most of them heard a click which they assumed to be a click of the hammer of the revolver.
|
||||
mels/LJ009-0074.pt|durations/LJ009-0074.pt|pitch_char/LJ009-0074.pt|Let us pass on.
|
||||
mels/LJ048-0069.pt|durations/LJ048-0069.pt|pitch_char/LJ048-0069.pt|Efforts made by the Bureau since the assassination, on the other hand,
|
||||
mels/LJ003-0211.pt|durations/LJ003-0211.pt|pitch_char/LJ003-0211.pt|They were never left quite alone for fear of suicide, and for the same reason they were searched for weapons or poisons.
|
||||
mels/LJ048-0053.pt|durations/LJ048-0053.pt|pitch_char/LJ048-0053.pt|It is the conclusion of the Commission that, even in the absence of Secret Service criteria
|
||||
mels/LJ033-0093.pt|durations/LJ033-0093.pt|pitch_char/LJ033-0093.pt|Frazier estimated that the bag was two feet long, quote, give and take a few inches, end quote, and about five or six inches wide.
|
||||
mels/LJ006-0149.pt|durations/LJ006-0149.pt|pitch_char/LJ006-0149.pt|The turnkeys left the prisoners very much to themselves, never entering the wards after locking-up time, at dusk, till unlocking next morning,
|
||||
mels/LJ018-0211.pt|durations/LJ018-0211.pt|pitch_char/LJ018-0211.pt|The false coin was bought by an agent from an agent, and dealings were carried on secretly at the "Clock House" in Seven Dials.
|
||||
mels/LJ008-0054.pt|durations/LJ008-0054.pt|pitch_char/LJ008-0054.pt|This contrivance appears to have been copied with improvements from that which had been used in Dublin at a still earlier date,
|
||||
mels/LJ040-0052.pt|durations/LJ040-0052.pt|pitch_char/LJ040-0052.pt|that his commitment to Marxism was an important factor influencing his conduct during his adult years.
|
||||
mels/LJ028-0023.pt|durations/LJ028-0023.pt|pitch_char/LJ028-0023.pt|Two weeks pass, and at last you stand on the eastern edge of the plateau
|
||||
mels/LJ009-0184.pt|durations/LJ009-0184.pt|pitch_char/LJ009-0184.pt|Lord Ferrers' body was brought to Surgeons' Hall after execution in his own carriage and six;
|
||||
mels/LJ005-0252.pt|durations/LJ005-0252.pt|pitch_char/LJ005-0252.pt|A committee was appointed, under the presidency of the Duke of Richmond
|
||||
mels/LJ015-0266.pt|durations/LJ015-0266.pt|pitch_char/LJ015-0266.pt|has probably no parallel in the annals of crime. Saward himself is a striking and in some respects an unique figure in criminal history.
|
||||
mels/LJ017-0059.pt|durations/LJ017-0059.pt|pitch_char/LJ017-0059.pt|even after sentence, and until within a few hours of execution, he was buoyed up with the hope of reprieve.
|
||||
mels/LJ024-0034.pt|durations/LJ024-0034.pt|pitch_char/LJ024-0034.pt|What do they mean by the words "packing the Court"?
|
||||
mels/LJ016-0089.pt|durations/LJ016-0089.pt|pitch_char/LJ016-0089.pt|He was engaged in whitewashing and cleaning; the officer who had him in charge left him on the stairs leading to the gallery.
|
||||
mels/LJ039-0227.pt|durations/LJ039-0227.pt|pitch_char/LJ039-0227.pt|with two hits, within four point eight and five point six seconds.
|
||||
mels/LJ001-0096.pt|durations/LJ001-0096.pt|pitch_char/LJ001-0096.pt|have now come into general use and are obviously a great improvement on the ordinary "modern style" in use in England, which is in fact the Bodoni type
|
||||
mels/LJ018-0129.pt|durations/LJ018-0129.pt|pitch_char/LJ018-0129.pt|who threatened to betray the theft. But Brewer, either before or after this, succumbed to temptation,
|
||||
mels/LJ010-0157.pt|durations/LJ010-0157.pt|pitch_char/LJ010-0157.pt|and that, as he was starving, he had resolved on this desperate deed,
|
||||
mels/LJ038-0264.pt|durations/LJ038-0264.pt|pitch_char/LJ038-0264.pt|He concluded that, quote, the general rifling characteristics of the rifle are of the same type as those found on the bullet
|
||||
mels/LJ031-0165.pt|durations/LJ031-0165.pt|pitch_char/LJ031-0165.pt|When security arrangements at the airport were complete, the Secret Service made the necessary arrangements for the Vice President to leave the hospital.
|
||||
mels/LJ018-0244.pt|durations/LJ018-0244.pt|pitch_char/LJ018-0244.pt|The effect of establishing the forgeries would be to restore to the Roupell family lands for which a price had already been paid
|
||||
mels/LJ007-0071.pt|durations/LJ007-0071.pt|pitch_char/LJ007-0071.pt|in the face of impediments confessedly discouraging
|
||||
mels/LJ028-0340.pt|durations/LJ028-0340.pt|pitch_char/LJ028-0340.pt|Such of the Babylonians as witnessed the treachery took refuge in the temple of Jupiter Belus;
|
||||
mels/LJ017-0164.pt|durations/LJ017-0164.pt|pitch_char/LJ017-0164.pt|with the idea of subjecting her to the irritant poison slowly but surely until the desired effect, death, was achieved.
|
||||
mels/LJ048-0197.pt|durations/LJ048-0197.pt|pitch_char/LJ048-0197.pt|I then told the officers that their primary duty was traffic and crowd control and that they should be alert for any persons who might attempt to throw anything
|
||||
mels/LJ013-0098.pt|durations/LJ013-0098.pt|pitch_char/LJ013-0098.pt|Mr. Oxenford having denied that he had made any transfer of stock, the matter was at once put into the hands of the police.
|
||||
mels/LJ012-0049.pt|durations/LJ012-0049.pt|pitch_char/LJ012-0049.pt|led him to think seriously of trying his fortunes in another land.
|
||||
mels/LJ030-0014.pt|durations/LJ030-0014.pt|pitch_char/LJ030-0014.pt|quote, that the crowd was about the same as the one which came to see him before but there were one hundred thousand extra people on hand who came to see Mrs. Kennedy.
|
||||
mels/LJ014-0186.pt|durations/LJ014-0186.pt|pitch_char/LJ014-0186.pt|A milliner's porter,
|
||||
mels/LJ015-0027.pt|durations/LJ015-0027.pt|pitch_char/LJ015-0027.pt|Yet even so early as the death of the first Sir John Paul,
|
||||
mels/LJ047-0049.pt|durations/LJ047-0049.pt|pitch_char/LJ047-0049.pt|Marina Oswald, however, recalled that her husband was upset by this interview.
|
||||
mels/LJ012-0021.pt|durations/LJ012-0021.pt|pitch_char/LJ012-0021.pt|at fourteen he was a pickpocket and a "duffer," or a seller of sham goods.
|
||||
mels/LJ003-0140.pt|durations/LJ003-0140.pt|pitch_char/LJ003-0140.pt|otherwise he would have been stripped of his clothes. End quote.
|
||||
mels/LJ042-0130.pt|durations/LJ042-0130.pt|pitch_char/LJ042-0130.pt|Shortly thereafter, less than eighteen months after his defection, about six weeks before he met Marina Prusakova,
|
||||
mels/LJ019-0180.pt|durations/LJ019-0180.pt|pitch_char/LJ019-0180.pt|His letter to the Corporation, under date fourth June,
|
||||
mels/LJ017-0108.pt|durations/LJ017-0108.pt|pitch_char/LJ017-0108.pt|He was struck with the appearance of the corpse, which was not emaciated, as after a long disease ending in death;
|
||||
mels/LJ006-0268.pt|durations/LJ006-0268.pt|pitch_char/LJ006-0268.pt|Women saw men if they merely pretended to be wives; even boys were visited by their sweethearts.
|
||||
mels/LJ044-0125.pt|durations/LJ044-0125.pt|pitch_char/LJ044-0125.pt|of residence in the U.S.S.R. against any cause which I join, by association,
|
||||
mels/LJ015-0231.pt|durations/LJ015-0231.pt|pitch_char/LJ015-0231.pt|It was Tester's business, who had access to the railway company's books, to watch for this.
|
||||
mels/LJ002-0225.pt|durations/LJ002-0225.pt|pitch_char/LJ002-0225.pt|The rentals of rooms and fees went to the warden, whose income was two thousand three hundred seventy-two pounds.
|
||||
mels/LJ034-0072.pt|durations/LJ034-0072.pt|pitch_char/LJ034-0072.pt|The employees raced the elevators to the first floor. Givens saw Oswald standing at the gate on the fifth floor as the elevator went by.
|
||||
mels/LJ045-0033.pt|durations/LJ045-0033.pt|pitch_char/LJ045-0033.pt|He began to treat me better. He helped me more -- although he always did help. But he was more attentive, end quote.
|
||||
mels/LJ031-0058.pt|durations/LJ031-0058.pt|pitch_char/LJ031-0058.pt|to infuse blood and fluids into the circulatory system.
|
||||
mels/LJ029-0197.pt|durations/LJ029-0197.pt|pitch_char/LJ029-0197.pt|During November the Dallas papers reported frequently on the plans for protecting the President, stressing the thoroughness of the preparations.
|
||||
mels/LJ043-0047.pt|durations/LJ043-0047.pt|pitch_char/LJ043-0047.pt|Oswald and his family lived for a brief period with his mother at her urging, but Oswald soon decided to move out.
|
||||
mels/LJ021-0026.pt|durations/LJ021-0026.pt|pitch_char/LJ021-0026.pt|seems necessary to produce the same result of justice and right conduct
|
||||
mels/LJ003-0230.pt|durations/LJ003-0230.pt|pitch_char/LJ003-0230.pt|The prison allowances were eked out by the broken victuals generously given by several eating-house keepers in the city,
|
||||
mels/LJ037-0252.pt|durations/LJ037-0252.pt|pitch_char/LJ037-0252.pt|Ted Callaway, who saw the gunman moments after the shooting, testified that Commission Exhibit Number one sixty-two
|
||||
mels/LJ031-0008.pt|durations/LJ031-0008.pt|pitch_char/LJ031-0008.pt|Meanwhile, Chief Curry ordered the police base station to notify Parkland Hospital that the wounded President was en route.
|
||||
mels/LJ030-0021.pt|durations/LJ030-0021.pt|pitch_char/LJ030-0021.pt|all one had to do was get a high building someday with a telescopic rifle, and there was nothing anybody could do to defend against such an attempt.
|
||||
mels/LJ046-0179.pt|durations/LJ046-0179.pt|pitch_char/LJ046-0179.pt|being reviewed regularly.
|
||||
mels/LJ025-0118.pt|durations/LJ025-0118.pt|pitch_char/LJ025-0118.pt|and that, however diverse may be the fabrics or tissues of which their bodies are composed, all these varied structures result
|
||||
mels/LJ028-0278.pt|durations/LJ028-0278.pt|pitch_char/LJ028-0278.pt|Zopyrus, when they told him, not thinking that it could be true, went and saw the colt with his own eyes;
|
||||
mels/LJ007-0090.pt|durations/LJ007-0090.pt|pitch_char/LJ007-0090.pt|Not only did their presence tend greatly to interfere with the discipline of the prison, but their condition was deplorable in the extreme.
|
||||
mels/LJ045-0045.pt|durations/LJ045-0045.pt|pitch_char/LJ045-0045.pt|that she would be able to leave the Soviet Union. Marina Oswald has denied this.
|
||||
mels/LJ028-0289.pt|durations/LJ028-0289.pt|pitch_char/LJ028-0289.pt|For he cut off his own nose and ears, and then, clipping his hair close and flogging himself with a scourge,
|
||||
mels/LJ009-0276.pt|durations/LJ009-0276.pt|pitch_char/LJ009-0276.pt|Calcraft, the moment he had adjusted the cap and rope, ran down the steps, drew the bolt, and disappeared.
|
||||
mels/LJ031-0122.pt|durations/LJ031-0122.pt|pitch_char/LJ031-0122.pt|treated the gunshot wound in the left thigh.
|
||||
mels/LJ016-0205.pt|durations/LJ016-0205.pt|pitch_char/LJ016-0205.pt|he received a retaining fee of five pounds, five shillings, with the usual guinea for each job;
|
||||
mels/LJ019-0248.pt|durations/LJ019-0248.pt|pitch_char/LJ019-0248.pt|leading to an inequality, uncertainty, and inefficiency of punishment productive of the most prejudicial results.
|
||||
mels/LJ033-0183.pt|durations/LJ033-0183.pt|pitch_char/LJ033-0183.pt|it was not surprising that the replica sack made on December one, nineteen sixty-three,
|
||||
mels/LJ037-0001.pt|durations/LJ037-0001.pt|pitch_char/LJ037-0001.pt|Report of the President's Commission on the Assassination of President Kennedy. The Warren Commission Report. By The President's Commission on the Assassination of President Kennedy.
|
||||
mels/LJ018-0218.pt|durations/LJ018-0218.pt|pitch_char/LJ018-0218.pt|In eighteen fifty-five
|
||||
mels/LJ001-0102.pt|durations/LJ001-0102.pt|pitch_char/LJ001-0102.pt|Here and there a book is printed in France or Germany with some pretension to good taste,
|
||||
mels/LJ007-0125.pt|durations/LJ007-0125.pt|pitch_char/LJ007-0125.pt|It was diverted from its proper uses, and, as the "place of the greatest comfort," was allotted to persons who should not have been sent to Newgate at all.
|
||||
mels/LJ050-0022.pt|durations/LJ050-0022.pt|pitch_char/LJ050-0022.pt|A formal and thorough description of the responsibilities of the advance agent is now in preparation by the Service.
|
||||
mels/LJ028-0212.pt|durations/LJ028-0212.pt|pitch_char/LJ028-0212.pt|On the night of the eleventh day Gobrias killed the son of the King.
|
||||
mels/LJ028-0357.pt|durations/LJ028-0357.pt|pitch_char/LJ028-0357.pt|yet we may be sure that Babylon was taken by Darius only by use of stratagem. Its walls were impregnable.
|
||||
mels/LJ014-0199.pt|durations/LJ014-0199.pt|pitch_char/LJ014-0199.pt|there was no case to make out; why waste money on lawyers for the defense? His demeanor was cool and collected throughout;
|
||||
mels/LJ016-0077.pt|durations/LJ016-0077.pt|pitch_char/LJ016-0077.pt|A man named Lears, under sentence of transportation for an attempt at murder on board ship, got up part of the way,
|
||||
mels/LJ009-0194.pt|durations/LJ009-0194.pt|pitch_char/LJ009-0194.pt|and that executors or persons having lawful possession of the bodies
|
||||
mels/LJ014-0094.pt|durations/LJ014-0094.pt|pitch_char/LJ014-0094.pt|Discovery of the murder came in this wise. O'Connor, a punctual and well-conducted official, was at once missed at the London Docks.
|
||||
mels/LJ001-0079.pt|durations/LJ001-0079.pt|pitch_char/LJ001-0079.pt|Caslon's type is clear and neat, and fairly well designed;
|
||||
mels/LJ026-0052.pt|durations/LJ026-0052.pt|pitch_char/LJ026-0052.pt|In the nutrition of the animal the most essential and characteristic part of the food supply is derived from vegetable
|
||||
mels/LJ013-0005.pt|durations/LJ013-0005.pt|pitch_char/LJ013-0005.pt|One of the earliest of the big operators in fraudulent finance was Edward Beaumont Smith,
|
||||
mels/LJ033-0072.pt|durations/LJ033-0072.pt|pitch_char/LJ033-0072.pt|I then stepped off of it and the officer picked it up in the middle and it bent so.
|
||||
mels/LJ036-0067.pt|durations/LJ036-0067.pt|pitch_char/LJ036-0067.pt|According to McWatters, the Beckley bus was behind the Marsalis bus, but he did not actually see it.
|
||||
mels/LJ025-0098.pt|durations/LJ025-0098.pt|pitch_char/LJ025-0098.pt|and it is probable that amyloid substances are universally present in the animal organism, though not in the precise form of starch.
|
||||
mels/LJ005-0257.pt|durations/LJ005-0257.pt|pitch_char/LJ005-0257.pt|during which time a host of witnesses were examined, and the committee presented three separate reports,
|
||||
mels/LJ004-0024.pt|durations/LJ004-0024.pt|pitch_char/LJ004-0024.pt|Thus in eighteen thirteen the exaction of jail fees had been forbidden by law,
|
||||
mels/LJ049-0154.pt|durations/LJ049-0154.pt|pitch_char/LJ049-0154.pt|In eighteen ninety-four,
|
||||
mels/LJ039-0059.pt|durations/LJ039-0059.pt|pitch_char/LJ039-0059.pt|(three) his experience and practice after leaving the Marine Corps, and (four) the accuracy of the weapon and the quality of the ammunition.
|
||||
mels/LJ007-0150.pt|durations/LJ007-0150.pt|pitch_char/LJ007-0150.pt|He is allowed intercourse with prostitutes who, in nine cases out of ten, have originally conduced to his ruin;
|
||||
mels/LJ015-0001.pt|durations/LJ015-0001.pt|pitch_char/LJ015-0001.pt|Chronicles of Newgate, Volume two. By Arthur Griffiths. Section eighteen: Newgate notorieties continued, part three.
|
||||
mels/LJ010-0158.pt|durations/LJ010-0158.pt|pitch_char/LJ010-0158.pt|feeling, as he said, that he might as well be shot or hanged as remain in such a state.
|
||||
mels/LJ010-0281.pt|durations/LJ010-0281.pt|pitch_char/LJ010-0281.pt|who had borne the Queen's commission, first as cornet, and then lieutenant, in the tenth Hussars.
|
||||
mels/LJ033-0055.pt|durations/LJ033-0055.pt|pitch_char/LJ033-0055.pt|and he could disassemble it more rapidly.
|
||||
mels/LJ015-0218.pt|durations/LJ015-0218.pt|pitch_char/LJ015-0218.pt|A new accomplice was now needed within the company's establishment, and Pierce looked about long before he found the right person.
|
||||
mels/LJ027-0006.pt|durations/LJ027-0006.pt|pitch_char/LJ027-0006.pt|In all these lines the facts are drawn together by a strong thread of unity.
|
||||
mels/LJ016-0049.pt|durations/LJ016-0049.pt|pitch_char/LJ016-0049.pt|He had here completed his ascent.
|
||||
mels/LJ006-0088.pt|durations/LJ006-0088.pt|pitch_char/LJ006-0088.pt|It was not likely that a system which left innocent men -- for the great bulk of new arrivals were still untried
|
||||
mels/LJ042-0133.pt|durations/LJ042-0133.pt|pitch_char/LJ042-0133.pt|a great change must have occurred in Oswald's thinking to induce him to return to the United States.
|
||||
mels/LJ045-0234.pt|durations/LJ045-0234.pt|pitch_char/LJ045-0234.pt|While he did become enraged at at least one point in his interrogation,
|
||||
mels/LJ046-0033.pt|durations/LJ046-0033.pt|pitch_char/LJ046-0033.pt|The adequacy of existing procedures can fairly be assessed only after full consideration of the difficulty of the protective assignment,
|
||||
mels/LJ037-0061.pt|durations/LJ037-0061.pt|pitch_char/LJ037-0061.pt|and having, quote, somewhat bushy, end quote, hair.
|
||||
mels/LJ032-0025.pt|durations/LJ032-0025.pt|pitch_char/LJ032-0025.pt|the officers of Klein's discovered that a rifle bearing serial number C two seven six six had been shipped to one A. Hidell,
|
||||
mels/LJ047-0197.pt|durations/LJ047-0197.pt|pitch_char/LJ047-0197.pt|in view of all the information concerning Oswald in its files, should have alerted the Secret Service to Oswald's presence in Dallas
|
||||
mels/LJ018-0130.pt|durations/LJ018-0130.pt|pitch_char/LJ018-0130.pt|and stole paper on a much larger scale than Brown.
|
||||
mels/LJ005-0265.pt|durations/LJ005-0265.pt|pitch_char/LJ005-0265.pt|It was recommended that the dietaries should be submitted and approved like the rules; that convicted prisoners should not receive any food but the jail allowance;
|
||||
mels/LJ044-0105.pt|durations/LJ044-0105.pt|pitch_char/LJ044-0105.pt|He presented Arnold Johnson, Gus Hall,
|
||||
mels/LJ015-0043.pt|durations/LJ015-0043.pt|pitch_char/LJ015-0043.pt|This went on for some time, and might never have been discovered had some good stroke of luck provided any of the partners
|
||||
mels/LJ030-0125.pt|durations/LJ030-0125.pt|pitch_char/LJ030-0125.pt|On several occasions when the Vice President's car was slowed down by the throng, Special Agent Youngblood stepped out to hold the crowd back.
|
||||
mels/LJ043-0140.pt|durations/LJ043-0140.pt|pitch_char/LJ043-0140.pt|He also studied Dallas bus schedules to prepare for his later use of buses to travel to and from General Walker's house.
|
||||
mels/LJ002-0220.pt|durations/LJ002-0220.pt|pitch_char/LJ002-0220.pt|In consequence of these disclosures, both Bambridge and Huggin, his predecessor in the office, were committed to Newgate,
|
||||
mels/LJ034-0117.pt|durations/LJ034-0117.pt|pitch_char/LJ034-0117.pt|At one:twenty-nine p.m. the police radio reported
|
||||
mels/LJ018-0276.pt|durations/LJ018-0276.pt|pitch_char/LJ018-0276.pt|The first plot was against Mr. Harry Emmanuel, but he escaped, and the attempt was made upon Loudon and Ryder.
|
||||
mels/LJ004-0077.pt|durations/LJ004-0077.pt|pitch_char/LJ004-0077.pt|nor has he a right to poison or starve his fellow-creatures."
|
||||
mels/LJ042-0194.pt|durations/LJ042-0194.pt|pitch_char/LJ042-0194.pt|they should not be confused with slowness, indecision or fear. Only the intellectually fearless could even be remotely attracted to our doctrine,
|
||||
mels/LJ029-0114.pt|durations/LJ029-0114.pt|pitch_char/LJ029-0114.pt|The route chosen from the airport to Main Street was the normal one, except where Harwood Street was selected as the means of access to Main Street
|
||||
mels/LJ014-0194.pt|durations/LJ014-0194.pt|pitch_char/LJ014-0194.pt|The policemen were now in possession;
|
||||
mels/LJ032-0027.pt|durations/LJ032-0027.pt|pitch_char/LJ032-0027.pt|According to its microfilm records, Klein's received an order for a rifle on March thirteen, nineteen sixty-three,
|
||||
mels/LJ048-0289.pt|durations/LJ048-0289.pt|pitch_char/LJ048-0289.pt|However, there is no evidence that these men failed to take any action in Dallas within their power that would have averted the tragedy.
|
||||
mels/LJ043-0188.pt|durations/LJ043-0188.pt|pitch_char/LJ043-0188.pt|that he was the leader of a fascist organization, and when I said that even though all of that might be true, just the same he had no right to take his life,
|
||||
mels/LJ011-0118.pt|durations/LJ011-0118.pt|pitch_char/LJ011-0118.pt|In eighteen twenty-nine the gallows claimed two more victims for this offense.
|
||||
mels/LJ040-0201.pt|durations/LJ040-0201.pt|pitch_char/LJ040-0201.pt|After her interview with Mrs. Oswald,
|
||||
mels/LJ033-0056.pt|durations/LJ033-0056.pt|pitch_char/LJ033-0056.pt|While the rifle may have already been disassembled when Oswald arrived home on Thursday, he had ample time that evening to disassemble the rifle
|
||||
mels/LJ047-0073.pt|durations/LJ047-0073.pt|pitch_char/LJ047-0073.pt|Hosty considered the information to be, quote, stale, unquote, by that time, and did not attempt to verify Oswald's reported statement.
|
||||
mels/LJ001-0153.pt|durations/LJ001-0153.pt|pitch_char/LJ001-0153.pt|only nominally so, however, in many cases, since when he uses a headline he counts that in,
|
||||
mels/LJ007-0158.pt|durations/LJ007-0158.pt|pitch_char/LJ007-0158.pt|or any kind of moral improvement was impossible; the prisoner's career was inevitably downward, till he struck the lowest depths.
|
||||
mels/LJ028-0502.pt|durations/LJ028-0502.pt|pitch_char/LJ028-0502.pt|The Ishtar gateway leading to the palace was encased with beautiful blue glazed bricks,
|
||||
mels/LJ028-0226.pt|durations/LJ028-0226.pt|pitch_char/LJ028-0226.pt|Though Herodotus wrote nearly a hundred years after Babylon fell, his story seems to bear the stamp of truth.
|
||||
mels/LJ010-0038.pt|durations/LJ010-0038.pt|pitch_char/LJ010-0038.pt|as there had been before; as in the year eighteen forty-nine, a year memorable for the Rush murders at Norwich,
|
||||
mels/LJ019-0241.pt|durations/LJ019-0241.pt|pitch_char/LJ019-0241.pt|But in the interval very comprehensive and, I think it must be admitted, salutary changes were successively introduced into the management of prisons.
|
||||
mels/LJ001-0094.pt|durations/LJ001-0094.pt|pitch_char/LJ001-0094.pt|were induced to cut punches for a series of "old style" letters.
|
||||
mels/LJ001-0015.pt|durations/LJ001-0015.pt|pitch_char/LJ001-0015.pt|the forms of printed letters should be beautiful, and that their arrangement on the page should be reasonable and a help to the shapeliness of the letters themselves.
|
||||
mels/LJ047-0015.pt|durations/LJ047-0015.pt|pitch_char/LJ047-0015.pt|From defection to return to Fort Worth.
|
||||
mels/LJ044-0139.pt|durations/LJ044-0139.pt|pitch_char/LJ044-0139.pt|since there was no background to the New Orleans FPCC, quote, organization, end quote, which consisted solely of Oswald.
|
||||
mels/LJ050-0031.pt|durations/LJ050-0031.pt|pitch_char/LJ050-0031.pt|that the Secret Service consciously set about the task of inculcating and maintaining the highest standard of excellence and esprit, for all of its personnel.
|
||||
mels/LJ050-0235.pt|durations/LJ050-0235.pt|pitch_char/LJ050-0235.pt|It has also used other Federal law enforcement agents during Presidential visits to cities in which such agents are stationed.
|
||||
mels/LJ050-0137.pt|durations/LJ050-0137.pt|pitch_char/LJ050-0137.pt|FBI, and the Secret Service.
|
||||
mels/LJ031-0109.pt|durations/LJ031-0109.pt|pitch_char/LJ031-0109.pt|At one:thirty-five p.m., after Governor Connally had been moved to the operating room, Dr. Shaw started the first operation
|
||||
mels/LJ031-0041.pt|durations/LJ031-0041.pt|pitch_char/LJ031-0041.pt|He noted that the President was blue-white or ashen in color; had slow, spasmodic, agonal respiration without any coordination;
|
||||
mels/LJ021-0139.pt|durations/LJ021-0139.pt|pitch_char/LJ021-0139.pt|There should be at least a full and fair trial given to these means of ending industrial warfare;
|
||||
mels/LJ029-0004.pt|durations/LJ029-0004.pt|pitch_char/LJ029-0004.pt|The narrative of these events is based largely on the recollections of the participants,
|
||||
mels/LJ023-0122.pt|durations/LJ023-0122.pt|pitch_char/LJ023-0122.pt|It was said in last year's Democratic platform,
|
||||
mels/LJ005-0264.pt|durations/LJ005-0264.pt|pitch_char/LJ005-0264.pt|inspectors of prisons should be appointed, who should visit all the prisons from time to time and report to the Secretary of State.
|
||||
mels/LJ002-0105.pt|durations/LJ002-0105.pt|pitch_char/LJ002-0105.pt|and beyond it was a room called the "wine room," because formerly used for the sale of wine, but
|
||||
mels/LJ017-0035.pt|durations/LJ017-0035.pt|pitch_char/LJ017-0035.pt|in the interests and for the due protection of the public, that the fullest and fairest inquiry should be made,
|
||||
mels/LJ048-0252.pt|durations/LJ048-0252.pt|pitch_char/LJ048-0252.pt|Three of these agents occupied positions on the running boards of the car, and the fourth was seated in the car.
|
||||
mels/LJ013-0109.pt|durations/LJ013-0109.pt|pitch_char/LJ013-0109.pt|The proceeds of the robbery were lodged in a Boston bank,
|
||||
mels/LJ039-0139.pt|durations/LJ039-0139.pt|pitch_char/LJ039-0139.pt|Oswald obtained a hunting license, joined a hunting club and went hunting about six times, as discussed more fully in chapter six.
|
||||
mels/LJ044-0047.pt|durations/LJ044-0047.pt|pitch_char/LJ044-0047.pt|that anyone ever attacked any street demonstration in which Oswald was involved, except for the Bringuier incident mentioned above,
|
||||
mels/LJ016-0417.pt|durations/LJ016-0417.pt|pitch_char/LJ016-0417.pt|Catherine Wilson, the poisoner, was reserved and reticent to the last, expressing no contrition, but also no fear --
|
||||
mels/LJ045-0178.pt|durations/LJ045-0178.pt|pitch_char/LJ045-0178.pt|he left his wedding ring in a cup on the dresser in his room. He also left one hundred seventy dollars in a wallet in one of the dresser drawers.
|
||||
mels/LJ009-0172.pt|durations/LJ009-0172.pt|pitch_char/LJ009-0172.pt|While in London, for instance, in eighteen twenty-nine, twenty-four persons had been executed for crimes other than murder,
|
||||
mels/LJ049-0202.pt|durations/LJ049-0202.pt|pitch_char/LJ049-0202.pt|incident to its responsibilities.
|
||||
mels/LJ032-0103.pt|durations/LJ032-0103.pt|pitch_char/LJ032-0103.pt|The name "Hidell" was stamped on some of the "Chapter's" printed literature and on the membership application blanks.
|
||||
mels/LJ013-0091.pt|durations/LJ013-0091.pt|pitch_char/LJ013-0091.pt|and Elder had to be assisted by two bank porters, who carried it for him to a carriage waiting near the Mansion House.
|
||||
mels/LJ037-0208.pt|durations/LJ037-0208.pt|pitch_char/LJ037-0208.pt|nineteen dollars, ninety-five cents, plus one dollar, twenty-seven cents shipping charge, had been collected from the consignee, Hidell.
|
||||
mels/LJ014-0128.pt|durations/LJ014-0128.pt|pitch_char/LJ014-0128.pt|her hair was dressed in long crepe bands. She had lace ruffles at her wrist, and wore primrose-colored kid gloves.
|
||||
mels/LJ015-0007.pt|durations/LJ015-0007.pt|pitch_char/LJ015-0007.pt|This affected Cole's credit, and ugly reports were in circulation charging him with the issue of simulated warrants.
|
||||
mels/LJ036-0169.pt|durations/LJ036-0169.pt|pitch_char/LJ036-0169.pt|he would have reached his destination at approximately twelve:fifty-four p.m.
|
||||
mels/LJ021-0040.pt|durations/LJ021-0040.pt|pitch_char/LJ021-0040.pt|The second step we have taken in the restoration of normal business enterprise
|
||||
mels/LJ015-0036.pt|durations/LJ015-0036.pt|pitch_char/LJ015-0036.pt|The bank was already insolvent,
|
||||
mels/LJ034-0041.pt|durations/LJ034-0041.pt|pitch_char/LJ034-0041.pt|Although Bureau experiments had shown that twenty-four hours was a likely maximum time, Latona stated
|
||||
mels/LJ009-0192.pt|durations/LJ009-0192.pt|pitch_char/LJ009-0192.pt|The dissection of executed criminals was abolished soon after the discovery of the crime of burking,
|
||||
mels/LJ037-0248.pt|durations/LJ037-0248.pt|pitch_char/LJ037-0248.pt|The eyewitnesses vary in their identification of the jacket.
|
||||
mels/LJ015-0289.pt|durations/LJ015-0289.pt|pitch_char/LJ015-0289.pt|As each transaction was carried out from a different address, and a different messenger always employed,
|
||||
mels/LJ005-0072.pt|durations/LJ005-0072.pt|pitch_char/LJ005-0072.pt|After a few years of active exertion the Society was rewarded by fresh legislation.
|
||||
mels/LJ023-0047.pt|durations/LJ023-0047.pt|pitch_char/LJ023-0047.pt|The three horses are, of course, the three branches of government -- the Congress, the Executive and the courts.
|
||||
mels/LJ009-0126.pt|durations/LJ009-0126.pt|pitch_char/LJ009-0126.pt|Hardly any one.
|
||||
mels/LJ034-0097.pt|durations/LJ034-0097.pt|pitch_char/LJ034-0097.pt|The window was approximately one hundred twenty feet away.
|
||||
mels/LJ028-0462.pt|durations/LJ028-0462.pt|pitch_char/LJ028-0462.pt|They were laid in bitumen.
|
||||
mels/LJ046-0055.pt|durations/LJ046-0055.pt|pitch_char/LJ046-0055.pt|It is now possible for Presidents to travel the length and breadth of a land far larger than the United States
|
||||
mels/LJ019-0371.pt|durations/LJ019-0371.pt|pitch_char/LJ019-0371.pt|Yet the law was seldom if ever enforced.
|
||||
mels/LJ039-0207.pt|durations/LJ039-0207.pt|pitch_char/LJ039-0207.pt|Although all of the shots were a few inches high and to the right of the target,
|
||||
mels/LJ002-0174.pt|durations/LJ002-0174.pt|pitch_char/LJ002-0174.pt|Mr. Buxton's friends at once paid the forty shillings, and the boy was released.
|
||||
mels/LJ016-0233.pt|durations/LJ016-0233.pt|pitch_char/LJ016-0233.pt|In his own profession
|
||||
mels/LJ026-0108.pt|durations/LJ026-0108.pt|pitch_char/LJ026-0108.pt|It is clear that there are upward and downward currents of water containing food (comparable to blood of an animal),
|
||||
mels/LJ038-0035.pt|durations/LJ038-0035.pt|pitch_char/LJ038-0035.pt|Oswald rose from his seat, bringing up both hands.
|
||||
mels/LJ026-0148.pt|durations/LJ026-0148.pt|pitch_char/LJ026-0148.pt|water which is lost by evaporation, especially from the leaf surface through the stomata;
|
||||
mels/LJ001-0186.pt|durations/LJ001-0186.pt|pitch_char/LJ001-0186.pt|the position of our Society that a work of utility might be also a work of art, if we cared to make it so.
|
||||
mels/LJ016-0264.pt|durations/LJ016-0264.pt|pitch_char/LJ016-0264.pt|The upturned faces of the eager spectators resembled those of the 'gods' at Drury Lane on Boxing Night;
|
||||
mels/LJ009-0041.pt|durations/LJ009-0041.pt|pitch_char/LJ009-0041.pt|The occupants of this terrible black pew were the last always to enter the chapel.
|
||||
mels/LJ010-0297.pt|durations/LJ010-0297.pt|pitch_char/LJ010-0297.pt|But there were other notorious cases of forgery.
|
||||
mels/LJ040-0018.pt|durations/LJ040-0018.pt|pitch_char/LJ040-0018.pt|the Commission is not able to reach any definite conclusions as to whether or not he was, quote, sane, unquote, under prevailing legal standards.
|
||||
mels/LJ005-0253.pt|durations/LJ005-0253.pt|pitch_char/LJ005-0253.pt|"to inquire into and report upon the several jails and houses of correction in the counties, cities, and corporate towns within England and Wales
|
||||
mels/LJ027-0176.pt|durations/LJ027-0176.pt|pitch_char/LJ027-0176.pt|Fishes first appeared in the Devonian and Upper Silurian in very reptilian or rather amphibian forms.
|
||||
mels/LJ034-0035.pt|durations/LJ034-0035.pt|pitch_char/LJ034-0035.pt|The position of this palmprint on the carton was parallel with the long axis of the box, and at right angles with the short axis;
|
||||
mels/LJ016-0054.pt|durations/LJ016-0054.pt|pitch_char/LJ016-0054.pt|But he did not like the risk of entering a room by the fireplace, and the chances of detection it offered.
|
||||
mels/LJ018-0262.pt|durations/LJ018-0262.pt|pitch_char/LJ018-0262.pt|Roupell received the announcement with a cheerful countenance,
|
||||
mels/LJ044-0237.pt|durations/LJ044-0237.pt|pitch_char/LJ044-0237.pt|with thirteen dollars, eighty-seven cents when considerably greater resources were available to him.
|
||||
mels/LJ034-0166.pt|durations/LJ034-0166.pt|pitch_char/LJ034-0166.pt|Two other witnesses were able to offer partial descriptions of a man they saw in the southeast corner window
|
||||
mels/LJ016-0238.pt|durations/LJ016-0238.pt|pitch_char/LJ016-0238.pt|"just to steady their legs a little;" in other words, to add his weight to that of the hanging bodies.
|
||||
mels/LJ042-0198.pt|durations/LJ042-0198.pt|pitch_char/LJ042-0198.pt|The discussion above has already set forth examples of his expression of hatred for the United States.
|
||||
mels/LJ031-0189.pt|durations/LJ031-0189.pt|pitch_char/LJ031-0189.pt|At two:thirty-eight p.m., Eastern Standard Time, Lyndon Baines Johnson took the oath of office as the thirty-sixth President of the United States.
|
||||
mels/LJ050-0084.pt|durations/LJ050-0084.pt|pitch_char/LJ050-0084.pt|or, quote, other high government officials in the nature of a complaint coupled with an expressed or implied determination to use a means,
|
||||
mels/LJ044-0158.pt|durations/LJ044-0158.pt|pitch_char/LJ044-0158.pt|As for my return entrance visa please consider it separately. End quote.
|
||||
mels/LJ045-0082.pt|durations/LJ045-0082.pt|pitch_char/LJ045-0082.pt|it appears that Marina Oswald also complained that her husband was not able to provide more material things for her.
|
||||
mels/LJ045-0190.pt|durations/LJ045-0190.pt|pitch_char/LJ045-0190.pt|appeared in The Dallas Times Herald on November fifteen, nineteen sixty-three.
|
||||
mels/LJ035-0155.pt|durations/LJ035-0155.pt|pitch_char/LJ035-0155.pt|The only exit from the office in the direction Oswald was moving was through the door to the front stairway.
|
||||
mels/LJ044-0004.pt|durations/LJ044-0004.pt|pitch_char/LJ044-0004.pt|Political Activities
|
||||
mels/LJ046-0016.pt|durations/LJ046-0016.pt|pitch_char/LJ046-0016.pt|The Commission has not undertaken a comprehensive examination of all facets of this subject;
|
||||
mels/LJ019-0368.pt|durations/LJ019-0368.pt|pitch_char/LJ019-0368.pt|The latter too was to be laid before the House of Commons.
|
||||
mels/LJ010-0062.pt|durations/LJ010-0062.pt|pitch_char/LJ010-0062.pt|But they proceeded in all seriousness, and would have shrunk from no outrage or atrocity in furtherance of their foolhardy enterprise.
|
||||
mels/LJ033-0159.pt|durations/LJ033-0159.pt|pitch_char/LJ033-0159.pt|It was from Oswald's right hand, in which he carried the long package as he walked from Frazier's car to the building.
|
||||
mels/LJ002-0171.pt|durations/LJ002-0171.pt|pitch_char/LJ002-0171.pt|The boy declared he saw no one, and accordingly passed through without paying the toll of a penny.
|
||||
mels/LJ002-0298.pt|durations/LJ002-0298.pt|pitch_char/LJ002-0298.pt|in his evidence in eighteen fourteen, said it was more,
|
||||
mels/LJ012-0219.pt|durations/LJ012-0219.pt|pitch_char/LJ012-0219.pt|and in one corner, at some depth, a bundle of clothes were unearthed, which, with a hairy cap,
|
||||
mels/LJ017-0190.pt|durations/LJ017-0190.pt|pitch_char/LJ017-0190.pt|After this came the charge of administering oil of vitriol, which failed, as has been described.
|
||||
mels/LJ019-0179.pt|durations/LJ019-0179.pt|pitch_char/LJ019-0179.pt|This, with a scheme for limiting the jail to untried prisoners, had been urgently recommended by Lord John Russell in eighteen thirty.
|
||||
mels/LJ050-0188.pt|durations/LJ050-0188.pt|pitch_char/LJ050-0188.pt|each patrolman might be given a prepared booklet of instructions explaining what is expected of him. The Secret Service has expressed concern
|
||||
mels/LJ006-0043.pt|durations/LJ006-0043.pt|pitch_char/LJ006-0043.pt|The disgraceful overcrowding had been partially ended, but the same evils of indiscriminate association were still present; there was the old neglect of decency,
|
||||
mels/LJ029-0060.pt|durations/LJ029-0060.pt|pitch_char/LJ029-0060.pt|A number of people who resembled some of those in the photographs were placed under surveillance at the Trade Mart.
|
||||
mels/LJ019-0052.pt|durations/LJ019-0052.pt|pitch_char/LJ019-0052.pt|Both systems came to us from the United States. The difference was really more in degree than in principle,
|
||||
mels/LJ037-0081.pt|durations/LJ037-0081.pt|pitch_char/LJ037-0081.pt|Later in the day each woman found an empty shell on the ground near the house. These two shells were delivered to the police.
|
||||
mels/LJ048-0200.pt|durations/LJ048-0200.pt|pitch_char/LJ048-0200.pt|paying particular attention to the crowd for any unusual activity.
|
||||
mels/LJ016-0426.pt|durations/LJ016-0426.pt|pitch_char/LJ016-0426.pt|come along, gallows.
|
||||
mels/LJ008-0182.pt|durations/LJ008-0182.pt|pitch_char/LJ008-0182.pt|A tremendous crowd assembled when Bellingham was executed in eighteen twelve for the murder of Spencer Percival, at that time prime minister;
|
||||
mels/LJ043-0107.pt|durations/LJ043-0107.pt|pitch_char/LJ043-0107.pt|Upon moving to New Orleans on April twenty-four, nineteen sixty-three,
|
||||
mels/LJ006-0084.pt|durations/LJ006-0084.pt|pitch_char/LJ006-0084.pt|and so numerous were his opportunities of showing favoritism, that all the prisoners may be said to be in his power.
|
||||
mels/LJ025-0081.pt|durations/LJ025-0081.pt|pitch_char/LJ025-0081.pt|has no permanent digestive cavity or mouth, but takes in its food anywhere and digests, so to speak, all over its body.
|
||||
mels/LJ019-0042.pt|durations/LJ019-0042.pt|pitch_char/LJ019-0042.pt|These were either satisfied with a makeshift, and modified existing buildings, without close regard to their suitability, or for a long time did nothing at all.
|
||||
mels/LJ047-0240.pt|durations/LJ047-0240.pt|pitch_char/LJ047-0240.pt|They agree that Hosty told Revill
|
||||
mels/LJ032-0012.pt|durations/LJ032-0012.pt|pitch_char/LJ032-0012.pt|the resistance to arrest and the attempted shooting of another police officer by the man (Lee Harvey Oswald) subsequently accused of assassinating President Kennedy
|
||||
mels/LJ050-0209.pt|durations/LJ050-0209.pt|pitch_char/LJ050-0209.pt|The assistant to the Director of the FBI testified that
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,100 @@
|
|||
mels/LJ022-0023.pt|durations/LJ022-0023.pt|pitch_char/LJ022-0023.pt|The overwhelming majority of people in this country know how to sift the wheat from the chaff in what they hear and what they read.
|
||||
mels/LJ043-0030.pt|durations/LJ043-0030.pt|pitch_char/LJ043-0030.pt|If somebody did that to me, a lousy trick like that, to take my wife away, and all the furniture, I would be mad as hell, too.
|
||||
mels/LJ005-0201.pt|durations/LJ005-0201.pt|pitch_char/LJ005-0201.pt|as is shown by the report of the Commissioners to inquire into the state of the municipal corporations in eighteen thirty-five.
|
||||
mels/LJ001-0110.pt|durations/LJ001-0110.pt|pitch_char/LJ001-0110.pt|Even the Caslon type when enlarged shows great shortcomings in this respect:
|
||||
mels/LJ003-0345.pt|durations/LJ003-0345.pt|pitch_char/LJ003-0345.pt|All the committee could do in this respect was to throw the responsibility on others.
|
||||
mels/LJ007-0154.pt|durations/LJ007-0154.pt|pitch_char/LJ007-0154.pt|These pungent and well-grounded strictures applied with still greater force to the unconvicted prisoner, the man who came to the prison innocent, and still uncontaminated,
|
||||
mels/LJ018-0098.pt|durations/LJ018-0098.pt|pitch_char/LJ018-0098.pt|and recognized as one of the frequenters of the bogus law-stationers. His arrest led to that of others.
|
||||
mels/LJ047-0044.pt|durations/LJ047-0044.pt|pitch_char/LJ047-0044.pt|Oswald was, however, willing to discuss his contacts with Soviet authorities. He denied having any involvement with Soviet intelligence agencies
|
||||
mels/LJ031-0038.pt|durations/LJ031-0038.pt|pitch_char/LJ031-0038.pt|The first physician to see the President at Parkland Hospital was Dr. Charles J. Carrico, a resident in general surgery.
|
||||
mels/LJ048-0194.pt|durations/LJ048-0194.pt|pitch_char/LJ048-0194.pt|during the morning of November twenty-two prior to the motorcade.
|
||||
mels/LJ049-0026.pt|durations/LJ049-0026.pt|pitch_char/LJ049-0026.pt|On occasion the Secret Service has been permitted to have an agent riding in the passenger compartment with the President.
|
||||
mels/LJ004-0152.pt|durations/LJ004-0152.pt|pitch_char/LJ004-0152.pt|although at Mr. Buxton's visit a new jail was in process of erection, the first step towards reform since Howard's visitation in seventeen seventy-four.
|
||||
mels/LJ008-0278.pt|durations/LJ008-0278.pt|pitch_char/LJ008-0278.pt|or theirs might be one of many, and it might be considered necessary to "make an example."
|
||||
mels/LJ043-0002.pt|durations/LJ043-0002.pt|pitch_char/LJ043-0002.pt|The Warren Commission Report. By The President's Commission on the Assassination of President Kennedy. Chapter seven. Lee Harvey Oswald:
|
||||
mels/LJ009-0114.pt|durations/LJ009-0114.pt|pitch_char/LJ009-0114.pt|Mr. Wakefield winds up his graphic but somewhat sensational account by describing another religious service, which may appropriately be inserted here.
|
||||
mels/LJ028-0506.pt|durations/LJ028-0506.pt|pitch_char/LJ028-0506.pt|A modern artist would have difficulty in doing such accurate work.
|
||||
mels/LJ050-0168.pt|durations/LJ050-0168.pt|pitch_char/LJ050-0168.pt|with the particular purposes of the agency involved. The Commission recognizes that this is a controversial area
|
||||
mels/LJ039-0223.pt|durations/LJ039-0223.pt|pitch_char/LJ039-0223.pt|Oswald's Marine training in marksmanship, his other rifle experience and his established familiarity with this particular weapon
|
||||
mels/LJ029-0032.pt|durations/LJ029-0032.pt|pitch_char/LJ029-0032.pt|According to O'Donnell, quote, we had a motorcade wherever we went, end quote.
|
||||
mels/LJ031-0070.pt|durations/LJ031-0070.pt|pitch_char/LJ031-0070.pt|Dr. Clark, who most closely observed the head wound,
|
||||
mels/LJ034-0198.pt|durations/LJ034-0198.pt|pitch_char/LJ034-0198.pt|Euins, who was on the southwest corner of Elm and Houston Streets testified that he could not describe the man he saw in the window.
|
||||
mels/LJ026-0068.pt|durations/LJ026-0068.pt|pitch_char/LJ026-0068.pt|Energy enters the plant, to a small extent,
|
||||
mels/LJ039-0075.pt|durations/LJ039-0075.pt|pitch_char/LJ039-0075.pt|once you know that you must put the crosshairs on the target and that is all that is necessary.
|
||||
mels/LJ004-0096.pt|durations/LJ004-0096.pt|pitch_char/LJ004-0096.pt|the fatal consequences whereof might be prevented if the justices of the peace were duly authorized
|
||||
mels/LJ005-0014.pt|durations/LJ005-0014.pt|pitch_char/LJ005-0014.pt|Speaking on a debate on prison matters, he declared that
|
||||
mels/LJ012-0161.pt|durations/LJ012-0161.pt|pitch_char/LJ012-0161.pt|he was reported to have fallen away to a shadow.
|
||||
mels/LJ018-0239.pt|durations/LJ018-0239.pt|pitch_char/LJ018-0239.pt|His disappearance gave color and substance to evil reports already in circulation that the will and conveyance above referred to
|
||||
mels/LJ019-0257.pt|durations/LJ019-0257.pt|pitch_char/LJ019-0257.pt|Here the tread-wheel was in use, there cellular cranks, or hard-labor machines.
|
||||
mels/LJ028-0008.pt|durations/LJ028-0008.pt|pitch_char/LJ028-0008.pt|you tap gently with your heel upon the shoulder of the dromedary to urge her on.
|
||||
mels/LJ024-0083.pt|durations/LJ024-0083.pt|pitch_char/LJ024-0083.pt|This plan of mine is no attack on the Court;
|
||||
mels/LJ042-0129.pt|durations/LJ042-0129.pt|pitch_char/LJ042-0129.pt|No night clubs or bowling alleys, no places of recreation except the trade union dances. I have had enough.
|
||||
mels/LJ036-0103.pt|durations/LJ036-0103.pt|pitch_char/LJ036-0103.pt|The police asked him whether he could pick out his passenger from the lineup.
|
||||
mels/LJ046-0058.pt|durations/LJ046-0058.pt|pitch_char/LJ046-0058.pt|During his Presidency, Franklin D. Roosevelt made almost four hundred journeys and traveled more than three hundred fifty thousand miles.
|
||||
mels/LJ014-0076.pt|durations/LJ014-0076.pt|pitch_char/LJ014-0076.pt|He was seen afterwards smoking and talking with his hosts in their back parlor, and never seen again alive.
|
||||
mels/LJ002-0043.pt|durations/LJ002-0043.pt|pitch_char/LJ002-0043.pt|long narrow rooms -- one thirty-six feet, six twenty-three feet, and the eighth eighteen,
|
||||
mels/LJ009-0076.pt|durations/LJ009-0076.pt|pitch_char/LJ009-0076.pt|We come to the sermon.
|
||||
mels/LJ017-0131.pt|durations/LJ017-0131.pt|pitch_char/LJ017-0131.pt|even when the high sheriff had told him there was no possibility of a reprieve, and within a few hours of execution.
|
||||
mels/LJ046-0184.pt|durations/LJ046-0184.pt|pitch_char/LJ046-0184.pt|but there is a system for the immediate notification of the Secret Service by the confining institution when a subject is released or escapes.
|
||||
mels/LJ014-0263.pt|durations/LJ014-0263.pt|pitch_char/LJ014-0263.pt|When other pleasures palled he took a theatre, and posed as a munificent patron of the dramatic art.
|
||||
mels/LJ042-0096.pt|durations/LJ042-0096.pt|pitch_char/LJ042-0096.pt|(old exchange rate) in addition to his factory salary of approximately equal amount
|
||||
mels/LJ049-0050.pt|durations/LJ049-0050.pt|pitch_char/LJ049-0050.pt|Hill had both feet on the car and was climbing aboard to assist President and Mrs. Kennedy.
|
||||
mels/LJ019-0186.pt|durations/LJ019-0186.pt|pitch_char/LJ019-0186.pt|seeing that since the establishment of the Central Criminal Court, Newgate received prisoners for trial from several counties,
|
||||
mels/LJ028-0307.pt|durations/LJ028-0307.pt|pitch_char/LJ028-0307.pt|then let twenty days pass, and at the end of that time station near the Chaldasan gates a body of four thousand.
|
||||
mels/LJ012-0235.pt|durations/LJ012-0235.pt|pitch_char/LJ012-0235.pt|While they were in a state of insensibility the murder was committed.
|
||||
mels/LJ034-0053.pt|durations/LJ034-0053.pt|pitch_char/LJ034-0053.pt|reached the same conclusion as Latona that the prints found on the cartons were those of Lee Harvey Oswald.
|
||||
mels/LJ014-0030.pt|durations/LJ014-0030.pt|pitch_char/LJ014-0030.pt|These were damnatory facts which well supported the prosecution.
|
||||
mels/LJ015-0203.pt|durations/LJ015-0203.pt|pitch_char/LJ015-0203.pt|but were the precautions too minute, the vigilance too close to be eluded or overcome?
|
||||
mels/LJ028-0093.pt|durations/LJ028-0093.pt|pitch_char/LJ028-0093.pt|but his scribe wrote it in the manner customary for the scribes of those days to write of their royal masters.
|
||||
mels/LJ002-0018.pt|durations/LJ002-0018.pt|pitch_char/LJ002-0018.pt|The inadequacy of the jail was noticed and reported upon again and again by the grand juries of the city of London,
|
||||
mels/LJ028-0275.pt|durations/LJ028-0275.pt|pitch_char/LJ028-0275.pt|At last, in the twentieth month,
|
||||
mels/LJ012-0042.pt|durations/LJ012-0042.pt|pitch_char/LJ012-0042.pt|which he kept concealed in a hiding-place with a trap-door just under his bed.
|
||||
mels/LJ011-0096.pt|durations/LJ011-0096.pt|pitch_char/LJ011-0096.pt|He married a lady also belonging to the Society of Friends, who brought him a large fortune, which, and his own money, he put into a city firm,
|
||||
mels/LJ036-0077.pt|durations/LJ036-0077.pt|pitch_char/LJ036-0077.pt|Roger D. Craig, a deputy sheriff of Dallas County,
|
||||
mels/LJ016-0318.pt|durations/LJ016-0318.pt|pitch_char/LJ016-0318.pt|Other officials, great lawyers, governors of prisons, and chaplains supported this view.
|
||||
mels/LJ013-0164.pt|durations/LJ013-0164.pt|pitch_char/LJ013-0164.pt|who came from his room ready dressed, a suspicious circumstance, as he was always late in the morning.
|
||||
mels/LJ027-0141.pt|durations/LJ027-0141.pt|pitch_char/LJ027-0141.pt|is closely reproduced in the life-history of existing deer. Or, in other words,
|
||||
mels/LJ028-0335.pt|durations/LJ028-0335.pt|pitch_char/LJ028-0335.pt|accordingly they committed to him the command of their whole army, and put the keys of their city into his hands.
|
||||
mels/LJ031-0202.pt|durations/LJ031-0202.pt|pitch_char/LJ031-0202.pt|Mrs. Kennedy chose the hospital in Bethesda for the autopsy because the President had served in the Navy.
|
||||
mels/LJ021-0145.pt|durations/LJ021-0145.pt|pitch_char/LJ021-0145.pt|From those willing to join in establishing this hoped-for period of peace,
|
||||
mels/LJ016-0288.pt|durations/LJ016-0288.pt|pitch_char/LJ016-0288.pt|"Müller, Müller, He's the man," till a diversion was created by the appearance of the gallows, which was received with continuous yells.
|
||||
mels/LJ028-0081.pt|durations/LJ028-0081.pt|pitch_char/LJ028-0081.pt|Years later, when the archaeologists could readily distinguish the false from the true,
|
||||
mels/LJ018-0081.pt|durations/LJ018-0081.pt|pitch_char/LJ018-0081.pt|his defense being that he had intended to commit suicide, but that, on the appearance of this officer who had wronged him,
|
||||
mels/LJ021-0066.pt|durations/LJ021-0066.pt|pitch_char/LJ021-0066.pt|together with a great increase in the payrolls, there has come a substantial rise in the total of industrial profits
|
||||
mels/LJ009-0238.pt|durations/LJ009-0238.pt|pitch_char/LJ009-0238.pt|After this the sheriffs sent for another rope, but the spectators interfered, and the man was carried back to jail.
|
||||
mels/LJ005-0079.pt|durations/LJ005-0079.pt|pitch_char/LJ005-0079.pt|and improve the morals of the prisoners, and shall insure the proper measure of punishment to convicted offenders.
|
||||
mels/LJ035-0019.pt|durations/LJ035-0019.pt|pitch_char/LJ035-0019.pt|drove to the northwest corner of Elm and Houston, and parked approximately ten feet from the traffic signal.
|
||||
mels/LJ036-0174.pt|durations/LJ036-0174.pt|pitch_char/LJ036-0174.pt|This is the approximate time he entered the roominghouse, according to Earlene Roberts, the housekeeper there.
|
||||
mels/LJ046-0146.pt|durations/LJ046-0146.pt|pitch_char/LJ046-0146.pt|The criteria in effect prior to November twenty-two, nineteen sixty-three, for determining whether to accept material for the PRS general files
|
||||
mels/LJ017-0044.pt|durations/LJ017-0044.pt|pitch_char/LJ017-0044.pt|and the deepest anxiety was felt that the crime, if crime there had been, should be brought home to its perpetrator.
|
||||
mels/LJ017-0070.pt|durations/LJ017-0070.pt|pitch_char/LJ017-0070.pt|but his sporting operations did not prosper, and he became a needy man, always driven to desperate straits for cash.
|
||||
mels/LJ014-0020.pt|durations/LJ014-0020.pt|pitch_char/LJ014-0020.pt|He was soon afterwards arrested on suspicion, and a search of his lodgings brought to light several garments saturated with blood;
|
||||
mels/LJ016-0020.pt|durations/LJ016-0020.pt|pitch_char/LJ016-0020.pt|He never reached the cistern, but fell back into the yard, injuring his legs severely.
|
||||
mels/LJ045-0230.pt|durations/LJ045-0230.pt|pitch_char/LJ045-0230.pt|when he was finally apprehended in the Texas Theatre. Although it is not fully corroborated by others who were present,
|
||||
mels/LJ035-0129.pt|durations/LJ035-0129.pt|pitch_char/LJ035-0129.pt|and she must have run down the stairs ahead of Oswald and would probably have seen or heard him.
|
||||
mels/LJ008-0307.pt|durations/LJ008-0307.pt|pitch_char/LJ008-0307.pt|afterwards express a wish to murder the Recorder for having kept them so long in suspense.
|
||||
mels/LJ008-0294.pt|durations/LJ008-0294.pt|pitch_char/LJ008-0294.pt|nearly indefinitely deferred.
|
||||
mels/LJ047-0148.pt|durations/LJ047-0148.pt|pitch_char/LJ047-0148.pt|On October twenty-five,
|
||||
mels/LJ008-0111.pt|durations/LJ008-0111.pt|pitch_char/LJ008-0111.pt|They entered a "stone cold room," and were presently joined by the prisoner.
|
||||
mels/LJ034-0042.pt|durations/LJ034-0042.pt|pitch_char/LJ034-0042.pt|that he could only testify with certainty that the print was less than three days old.
|
||||
mels/LJ037-0234.pt|durations/LJ037-0234.pt|pitch_char/LJ037-0234.pt|Mrs. Mary Brock, the wife of a mechanic who worked at the station, was there at the time and she saw a white male,
|
||||
mels/LJ040-0002.pt|durations/LJ040-0002.pt|pitch_char/LJ040-0002.pt|Chapter seven. Lee Harvey Oswald: Background and Possible Motives, Part one.
|
||||
mels/LJ045-0140.pt|durations/LJ045-0140.pt|pitch_char/LJ045-0140.pt|The arguments he used to justify his use of the alias suggest that Oswald may have come to think that the whole world was becoming involved
|
||||
mels/LJ012-0035.pt|durations/LJ012-0035.pt|pitch_char/LJ012-0035.pt|the number and names on watches, were carefully removed or obliterated after the goods passed out of his hands.
|
||||
mels/LJ012-0250.pt|durations/LJ012-0250.pt|pitch_char/LJ012-0250.pt|On the seventh July, eighteen thirty-seven,
|
||||
mels/LJ016-0179.pt|durations/LJ016-0179.pt|pitch_char/LJ016-0179.pt|contracted with sheriffs and conveners to work by the job.
|
||||
mels/LJ016-0138.pt|durations/LJ016-0138.pt|pitch_char/LJ016-0138.pt|at a distance from the prison.
|
||||
mels/LJ027-0052.pt|durations/LJ027-0052.pt|pitch_char/LJ027-0052.pt|These principles of homology are essential to a correct interpretation of the facts of morphology.
|
||||
mels/LJ031-0134.pt|durations/LJ031-0134.pt|pitch_char/LJ031-0134.pt|On one occasion Mrs. Johnson, accompanied by two Secret Service agents, left the room to see Mrs. Kennedy and Mrs. Connally.
|
||||
mels/LJ019-0273.pt|durations/LJ019-0273.pt|pitch_char/LJ019-0273.pt|which Sir Joshua Jebb told the committee he considered the proper elements of penal discipline.
|
||||
mels/LJ014-0110.pt|durations/LJ014-0110.pt|pitch_char/LJ014-0110.pt|At the first the boxes were impounded, opened, and found to contain many of O'Connor's effects.
|
||||
mels/LJ034-0160.pt|durations/LJ034-0160.pt|pitch_char/LJ034-0160.pt|on Brennan's subsequent certain identification of Lee Harvey Oswald as the man he saw fire the rifle.
|
||||
mels/LJ038-0199.pt|durations/LJ038-0199.pt|pitch_char/LJ038-0199.pt|eleven. If I am alive and taken prisoner,
|
||||
mels/LJ014-0010.pt|durations/LJ014-0010.pt|pitch_char/LJ014-0010.pt|yet he could not overcome the strange fascination it had for him, and remained by the side of the corpse till the stretcher came.
|
||||
mels/LJ033-0047.pt|durations/LJ033-0047.pt|pitch_char/LJ033-0047.pt|I noticed when I went out that the light was on, end quote,
|
||||
mels/LJ040-0027.pt|durations/LJ040-0027.pt|pitch_char/LJ040-0027.pt|He was never satisfied with anything.
|
||||
mels/LJ048-0228.pt|durations/LJ048-0228.pt|pitch_char/LJ048-0228.pt|and others who were present say that no agent was inebriated or acted improperly.
|
||||
mels/LJ003-0111.pt|durations/LJ003-0111.pt|pitch_char/LJ003-0111.pt|He was in consequence put out of the protection of their internal law, end quote. Their code was a subject of some curiosity.
|
||||
mels/LJ008-0258.pt|durations/LJ008-0258.pt|pitch_char/LJ008-0258.pt|Let me retrace my steps, and speak more in detail of the treatment of the condemned in those bloodthirsty and brutally indifferent days,
|
||||
mels/LJ029-0022.pt|durations/LJ029-0022.pt|pitch_char/LJ029-0022.pt|The original plan called for the President to spend only one day in the State, making whirlwind visits to Dallas, Fort Worth, San Antonio, and Houston.
|
||||
mels/LJ004-0045.pt|durations/LJ004-0045.pt|pitch_char/LJ004-0045.pt|Mr. Sturges Bourne, Sir James Mackintosh, Sir James Scarlett, and William Wilberforce.
|
BIN
PyTorch/SpeechSynthesis/FastPitch/img/fastpitch_model.png
Normal file
BIN
PyTorch/SpeechSynthesis/FastPitch/img/fastpitch_model.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
BIN
PyTorch/SpeechSynthesis/FastPitch/img/loss_fp16.png
Normal file
BIN
PyTorch/SpeechSynthesis/FastPitch/img/loss_fp16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
BIN
PyTorch/SpeechSynthesis/FastPitch/img/loss_fp32.png
Normal file
BIN
PyTorch/SpeechSynthesis/FastPitch/img/loss_fp32.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
BIN
PyTorch/SpeechSynthesis/FastPitch/img/pitch.png
Normal file
BIN
PyTorch/SpeechSynthesis/FastPitch/img/pitch.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
386
PyTorch/SpeechSynthesis/FastPitch/inference.py
Normal file
386
PyTorch/SpeechSynthesis/FastPitch/inference.py
Normal file
|
@ -0,0 +1,386 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
import argparse
|
||||
import models
|
||||
import time
|
||||
import tqdm
|
||||
import sys
|
||||
import warnings
|
||||
from pathlib import Path
|
||||
|
||||
import torch
|
||||
import numpy as np
|
||||
from scipy.stats import norm
|
||||
from scipy.io.wavfile import write
|
||||
from torch.nn.utils.rnn import pad_sequence
|
||||
|
||||
import dllogger as DLLogger
|
||||
from apex import amp
|
||||
from dllogger import StdOutBackend, JSONStreamBackend, Verbosity
|
||||
|
||||
from common import utils
|
||||
from common.text import text_to_sequence
|
||||
from waveglow import model as glow
|
||||
from waveglow.denoiser import Denoiser
|
||||
|
||||
sys.modules['glow'] = glow
|
||||
|
||||
|
||||
def parse_args(parser):
|
||||
"""
|
||||
Parse commandline arguments.
|
||||
"""
|
||||
parser.add_argument('-i', '--input', type=str, required=True,
|
||||
help='Full path to the input text (phareses separated by newlines)')
|
||||
parser.add_argument('-o', '--output', default=None,
|
||||
help='Output folder to save audio (file per phrase)')
|
||||
parser.add_argument('--log-file', type=str, default='nvlog.json',
|
||||
help='Filename for logging')
|
||||
parser.add_argument('--cuda', action='store_true',
|
||||
help='Run inference on a GPU using CUDA')
|
||||
parser.add_argument('--fastpitch', type=str,
|
||||
help='Full path to the generator checkpoint file (skip to use ground truth mels)')
|
||||
parser.add_argument('--waveglow', type=str,
|
||||
help='Full path to the WaveGlow model checkpoint file (skip to only generate mels)')
|
||||
parser.add_argument('-s', '--sigma-infer', default=0.9, type=float,
|
||||
help='WaveGlow sigma')
|
||||
parser.add_argument('-d', '--denoising-strength', default=0.01, type=float,
|
||||
help='WaveGlow denoising')
|
||||
parser.add_argument('-sr', '--sampling-rate', default=22050, type=int,
|
||||
help='Sampling rate')
|
||||
parser.add_argument('--stft-hop-length', type=int, default=256,
|
||||
help='STFT hop length for estimating audio length from mel size')
|
||||
parser.add_argument('--amp-run', action='store_true',
|
||||
help='Inference with AMP')
|
||||
parser.add_argument('--batch-size', type=int, default=64)
|
||||
parser.add_argument('--include-warmup', action='store_true',
|
||||
help='Include warmup')
|
||||
parser.add_argument('--repeats', type=int, default=1,
|
||||
help='Repeat inference for benchmarking')
|
||||
parser.add_argument('--torchscript', action='store_true',
|
||||
help='Apply TorchScript')
|
||||
parser.add_argument('--ema', action='store_true',
|
||||
help='Use EMA averaged model (if saved in checkpoints)')
|
||||
parser.add_argument('--dataset-path', type=str,
|
||||
help='Path to dataset (for loading extra data fields)')
|
||||
|
||||
transform = parser.add_argument_group('transform')
|
||||
transform.add_argument('--fade-out', type=int, default=5,
|
||||
help='Number of fadeout frames at the end')
|
||||
transform.add_argument('--pace', type=float, default=1.0,
|
||||
help='Adjust the pace of speech')
|
||||
transform.add_argument('--pitch-transform-flatten', action='store_true',
|
||||
help='Flatten the pitch')
|
||||
transform.add_argument('--pitch-transform-invert', action='store_true',
|
||||
help='Invert the pitch wrt mean value')
|
||||
transform.add_argument('--pitch-transform-amplify', action='store_true',
|
||||
help='Amplify the pitch variability')
|
||||
transform.add_argument('--pitch-transform-shift', type=float, default=0.0,
|
||||
help='Raise/lower the pitch by <hz>')
|
||||
return parser
|
||||
|
||||
|
||||
def load_and_setup_model(model_name, parser, checkpoint, amp_run, device,
|
||||
unk_args=[], forward_is_infer=False, ema=True,
|
||||
jitable=False):
|
||||
model_parser = models.parse_model_args(model_name, parser, add_help=False)
|
||||
model_args, model_unk_args = model_parser.parse_known_args()
|
||||
unk_args[:] = list(set(unk_args) & set(model_unk_args))
|
||||
|
||||
model_config = models.get_model_config(model_name, model_args)
|
||||
|
||||
model = models.get_model(model_name, model_config, device,
|
||||
forward_is_infer=forward_is_infer,
|
||||
jitable=jitable)
|
||||
|
||||
if checkpoint is not None:
|
||||
checkpoint_data = torch.load(checkpoint)
|
||||
status = ''
|
||||
|
||||
if 'state_dict' in checkpoint_data:
|
||||
sd = checkpoint_data['state_dict']
|
||||
if ema and 'ema_state_dict' in checkpoint_data:
|
||||
sd = checkpoint_data['ema_state_dict']
|
||||
status += ' (EMA)'
|
||||
elif ema and not 'ema_state_dict' in checkpoint_data:
|
||||
print(f'WARNING: EMA weights missing for {model_name}')
|
||||
|
||||
if any(key.startswith('module.') for key in sd):
|
||||
sd = {k.replace('module.', ''): v for k,v in sd.items()}
|
||||
status += ' ' + str(model.load_state_dict(sd, strict=False))
|
||||
else:
|
||||
model = checkpoint_data['model']
|
||||
print(f'Loaded {model_name}{status}')
|
||||
|
||||
if model_name == "WaveGlow":
|
||||
model = model.remove_weightnorm(model)
|
||||
if amp_run:
|
||||
model.half()
|
||||
model.eval()
|
||||
return model.to(device)
|
||||
|
||||
|
||||
def load_fields(fpath):
|
||||
lines = [l.strip() for l in open(fpath, encoding='utf-8')]
|
||||
if fpath.endswith('.tsv'):
|
||||
columns = lines[0].split('\t')
|
||||
fields = list(zip(*[t.split('\t') for t in lines[1:]]))
|
||||
else:
|
||||
columns = ['text']
|
||||
fields = [lines]
|
||||
return {c:f for c, f in zip(columns, fields)}
|
||||
|
||||
|
||||
def prepare_input_sequence(fields, device, batch_size=128, dataset=None,
|
||||
load_mels=False, load_pitch=False):
|
||||
fields['text'] = [torch.LongTensor(text_to_sequence(t, ['english_cleaners']))
|
||||
for t in fields['text']]
|
||||
order = np.argsort([-t.size(0) for t in fields['text']])
|
||||
|
||||
fields['text'] = [fields['text'][i] for i in order]
|
||||
fields['text_lens'] = torch.LongTensor([t.size(0) for t in fields['text']])
|
||||
|
||||
if load_mels:
|
||||
assert 'mel' in fields
|
||||
fields['mel'] = [
|
||||
torch.load(Path(dataset, fields['mel'][i])).t() for i in order]
|
||||
fields['mel_lens'] = torch.LongTensor([t.size(0) for t in fields['mel']])
|
||||
|
||||
if load_pitch:
|
||||
assert 'pitch' in fields
|
||||
fields['pitch'] = [
|
||||
torch.load(Path(dataset, fields['pitch'][i])) for i in order]
|
||||
fields['pitch_lens'] = torch.LongTensor([t.size(0) for t in fields['pitch']])
|
||||
|
||||
if 'output' in fields:
|
||||
fields['output'] = [fields['output'][i] for i in order]
|
||||
|
||||
# cut into batches & pad
|
||||
batches = []
|
||||
for b in range(0, len(order), batch_size):
|
||||
batch = {f: values[b:b+batch_size] for f, values in fields.items()}
|
||||
for f in batch:
|
||||
if f == 'text':
|
||||
batch[f] = pad_sequence(batch[f], batch_first=True)
|
||||
elif f == 'mel' and load_mels:
|
||||
batch[f] = pad_sequence(batch[f], batch_first=True).permute(0, 2, 1)
|
||||
elif f == 'pitch' and load_pitch:
|
||||
batch[f] = pad_sequence(batch[f], batch_first=True)
|
||||
|
||||
if type(batch[f]) is torch.Tensor:
|
||||
batch[f] = batch[f].to(device)
|
||||
batches.append(batch)
|
||||
|
||||
return batches
|
||||
|
||||
|
||||
def build_pitch_transformation(args):
|
||||
fun = 'pitch'
|
||||
if args.pitch_transform_flatten:
|
||||
fun = f'({fun}) * 0.0'
|
||||
if args.pitch_transform_invert:
|
||||
fun = f'({fun}) * -1.0'
|
||||
if args.pitch_transform_amplify:
|
||||
fun = f'({fun}) * 2.0'
|
||||
if args.pitch_transform_shift != 0.0:
|
||||
hz = args.pitch_transform_shift
|
||||
fun = f'({fun}) + {hz} / std'
|
||||
return eval(f'lambda pitch, mean, std: {fun}')
|
||||
|
||||
|
||||
class MeasureTime(list):
|
||||
def __enter__(self):
|
||||
torch.cuda.synchronize()
|
||||
self.t0 = time.perf_counter()
|
||||
|
||||
def __exit__(self, exc_type, exc_value, exc_traceback):
|
||||
torch.cuda.synchronize()
|
||||
self.append(time.perf_counter() - self.t0)
|
||||
|
||||
def __add__(self, other):
|
||||
assert len(self) == len(other)
|
||||
return MeasureTime(sum(ab) for ab in zip(self, other))
|
||||
|
||||
|
||||
def main():
|
||||
"""
|
||||
Launches text to speech (inference).
|
||||
Inference is executed on a single GPU.
|
||||
"""
|
||||
parser = argparse.ArgumentParser(description='PyTorch FastPitch Inference',
|
||||
allow_abbrev=False)
|
||||
parser = parse_args(parser)
|
||||
args, unk_args = parser.parse_known_args()
|
||||
|
||||
DLLogger.init(backends=[JSONStreamBackend(Verbosity.DEFAULT, args.log_file),
|
||||
StdOutBackend(Verbosity.VERBOSE)])
|
||||
for k,v in vars(args).items():
|
||||
DLLogger.log(step="PARAMETER", data={k:v})
|
||||
DLLogger.log(step="PARAMETER", data={'model_name': 'FastPitch_PyT'})
|
||||
|
||||
if args.output is not None:
|
||||
Path(args.output).mkdir(parents=False, exist_ok=True)
|
||||
|
||||
device = torch.device('cuda' if args.cuda else 'cpu')
|
||||
|
||||
if args.fastpitch is not None:
|
||||
generator = load_and_setup_model(
|
||||
'FastPitch', parser, args.fastpitch, args.amp_run, device,
|
||||
unk_args=unk_args, forward_is_infer=True, ema=args.ema,
|
||||
jitable=args.torchscript)
|
||||
|
||||
if args.torchscript:
|
||||
generator = torch.jit.script(generator)
|
||||
else:
|
||||
generator = None
|
||||
|
||||
if args.waveglow is not None:
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter("ignore")
|
||||
waveglow = load_and_setup_model(
|
||||
'WaveGlow', parser, args.waveglow, args.amp_run, device,
|
||||
unk_args=unk_args, forward_is_infer=True, ema=args.ema)
|
||||
denoiser = Denoiser(waveglow).to(device)
|
||||
waveglow = getattr(waveglow, 'infer', waveglow)
|
||||
else:
|
||||
waveglow = None
|
||||
|
||||
if len(unk_args) > 0:
|
||||
raise ValueError(f'Invalid options {unk_args}')
|
||||
|
||||
fields = load_fields(args.input)
|
||||
batches = prepare_input_sequence(
|
||||
fields, device, args.batch_size, args.dataset_path,
|
||||
load_mels=(generator is None))
|
||||
|
||||
if args.include_warmup:
|
||||
# Use real data rather than synthetic - FastPitch predicts len
|
||||
for i in range(3):
|
||||
with torch.no_grad():
|
||||
if generator is not None:
|
||||
b = batches[0]
|
||||
mel, *_ = generator(b['text'], b['text_lens'])
|
||||
if waveglow is not None:
|
||||
audios = waveglow(mel, sigma=args.sigma_infer).float()
|
||||
_ = denoiser(audios, strength=args.denoising_strength)
|
||||
|
||||
gen_measures = MeasureTime()
|
||||
waveglow_measures = MeasureTime()
|
||||
|
||||
gen_kw = {'pace': args.pace,
|
||||
'pitch_tgt': None,
|
||||
'pitch_transform': build_pitch_transformation(args)}
|
||||
|
||||
all_utterances = 0
|
||||
all_samples = 0
|
||||
all_letters = 0
|
||||
all_frames = 0
|
||||
|
||||
reps = args.repeats
|
||||
log_enabled = reps == 1
|
||||
log = lambda s, d: DLLogger.log(step=s, data=d) if log_enabled else None
|
||||
|
||||
for repeat in (tqdm.tqdm(range(reps)) if reps > 1 else range(reps)):
|
||||
for b in batches:
|
||||
if generator is None:
|
||||
log(0, {'Synthesizing from ground truth mels'})
|
||||
mel, mel_lens = b['mel'], b['mel_lens']
|
||||
else:
|
||||
with torch.no_grad(), gen_measures:
|
||||
mel, mel_lens, *_ = generator(
|
||||
b['text'], b['text_lens'], **gen_kw)
|
||||
|
||||
gen_infer_perf = mel.size(0) * mel.size(2) / gen_measures[-1]
|
||||
all_letters += b['text_lens'].sum().item()
|
||||
all_frames += mel.size(0) * mel.size(2)
|
||||
log(0, {"generator_frames_per_sec": gen_infer_perf})
|
||||
log(0, {"generator_latency": gen_measures[-1]})
|
||||
|
||||
if waveglow is not None:
|
||||
with torch.no_grad(), waveglow_measures:
|
||||
audios = waveglow(mel, sigma=args.sigma_infer)
|
||||
audios = denoiser(audios.float(),
|
||||
strength=args.denoising_strength
|
||||
).squeeze(1)
|
||||
|
||||
all_utterances += len(audios)
|
||||
all_samples += sum(audio.size(0) for audio in audios)
|
||||
waveglow_infer_perf = (
|
||||
audios.size(0) * audios.size(1) / waveglow_measures[-1])
|
||||
|
||||
log(0, {"waveglow_samples_per_sec": waveglow_infer_perf})
|
||||
log(0, {"waveglow_latency": waveglow_measures[-1]})
|
||||
|
||||
if args.output is not None and reps == 1:
|
||||
for i, audio in enumerate(audios):
|
||||
audio = audio[:mel_lens[i].item() * args.stft_hop_length]
|
||||
|
||||
if args.fade_out:
|
||||
fade_len = args.fade_out * args.stft_hop_length
|
||||
fade_w = torch.linspace(1.0, 0.0, fade_len)
|
||||
audio[-fade_len:] *= fade_w.to(audio.device)
|
||||
|
||||
audio = audio/torch.max(torch.abs(audio))
|
||||
fname = b['output'][i] if 'output' in b else f'audio_{i}.wav'
|
||||
audio_path = Path(args.output, fname)
|
||||
write(audio_path, args.sampling_rate, audio.cpu().numpy())
|
||||
|
||||
if generator is not None and waveglow is not None:
|
||||
log(0, {"latency": (gen_measures[-1] + waveglow_measures[-1])})
|
||||
|
||||
log_enabled = True
|
||||
if generator is not None:
|
||||
gm = np.sort(np.asarray(gen_measures))
|
||||
log('avg', {"generator letters/s": all_letters / gm.sum()})
|
||||
log('avg', {"generator_frames/s": all_frames / gm.sum()})
|
||||
log('avg', {"generator_latency": gm.mean()})
|
||||
log('90%', {"generator_latency": gm.mean() + norm.ppf((1.0 + 0.90) / 2) * gm.std()})
|
||||
log('95%', {"generator_latency": gm.mean() + norm.ppf((1.0 + 0.95) / 2) * gm.std()})
|
||||
log('99%', {"generator_latency": gm.mean() + norm.ppf((1.0 + 0.99) / 2) * gm.std()})
|
||||
if waveglow is not None:
|
||||
wm = np.sort(np.asarray(waveglow_measures))
|
||||
log('avg', {"waveglow_samples/s": all_samples / wm.sum()})
|
||||
log('avg', {"waveglow_latency": wm.mean()})
|
||||
log('90%', {"waveglow_latency": wm.mean() + norm.ppf((1.0 + 0.90) / 2) * wm.std()})
|
||||
log('95%', {"waveglow_latency": wm.mean() + norm.ppf((1.0 + 0.95) / 2) * wm.std()})
|
||||
log('99%', {"waveglow_latency": wm.mean() + norm.ppf((1.0 + 0.99) / 2) * wm.std()})
|
||||
if generator is not None and waveglow is not None:
|
||||
m = gm + wm
|
||||
rtf = all_samples / (len(batches) * all_utterances * m.mean() * args.sampling_rate)
|
||||
log('avg', {"samples/s": all_samples / m.sum()})
|
||||
log('avg', {"letters/s": all_letters / m.sum()})
|
||||
log('avg', {"latency": m.mean()})
|
||||
log('avg', {"RTF": rtf})
|
||||
log('90%', {"latency": m.mean() + norm.ppf((1.0 + 0.90) / 2) * m.std()})
|
||||
log('95%', {"latency": m.mean() + norm.ppf((1.0 + 0.95) / 2) * m.std()})
|
||||
log('99%', {"latency": m.mean() + norm.ppf((1.0 + 0.99) / 2) * m.std()})
|
||||
DLLogger.flush()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
107
PyTorch/SpeechSynthesis/FastPitch/inference_perf.py
Normal file
107
PyTorch/SpeechSynthesis/FastPitch/inference_perf.py
Normal file
|
@ -0,0 +1,107 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import time
|
||||
|
||||
import torch
|
||||
import numpy as np
|
||||
|
||||
import dllogger as DLLogger
|
||||
from apex import amp
|
||||
from dllogger import StdOutBackend, JSONStreamBackend, Verbosity
|
||||
|
||||
import models
|
||||
from inference import load_and_setup_model, MeasureTime
|
||||
|
||||
|
||||
def parse_args(parser):
|
||||
"""
|
||||
Parse commandline arguments.
|
||||
"""
|
||||
parser.add_argument('--amp-run', action='store_true',
|
||||
help='inference with AMP')
|
||||
parser.add_argument('-bs', '--batch-size', type=int, default=1)
|
||||
parser.add_argument('-o', '--output', type=str, required=True,
|
||||
help='Directory to save results')
|
||||
parser.add_argument('--log-file', type=str, default='nvlog.json',
|
||||
help='Filename for logging')
|
||||
return parser
|
||||
|
||||
|
||||
def main():
|
||||
"""
|
||||
Launches inference benchmark.
|
||||
Inference is executed on a single GPU.
|
||||
"""
|
||||
parser = argparse.ArgumentParser(
|
||||
description='PyTorch FastPitch Inference Benchmark')
|
||||
parser = parse_args(parser)
|
||||
args, _ = parser.parse_known_args()
|
||||
|
||||
log_file = args.log_file
|
||||
DLLogger.init(backends=[JSONStreamBackend(Verbosity.DEFAULT,
|
||||
args.log_file),
|
||||
StdOutBackend(Verbosity.VERBOSE)])
|
||||
for k,v in vars(args).items():
|
||||
DLLogger.log(step="PARAMETER", data={k:v})
|
||||
DLLogger.log(step="PARAMETER", data={'model_name': 'FastPitch_PyT'})
|
||||
|
||||
model = load_and_setup_model('FastPitch', parser, None, args.amp_run,
|
||||
'cuda', unk_args=[], forward_is_infer=True,
|
||||
ema=False, jitable=True)
|
||||
|
||||
# FIXME Temporarily disabled due to nn.LayerNorm fp16 casting bug in pytorch:20.02-py3 and 20.03
|
||||
# model = torch.jit.script(model)
|
||||
|
||||
warmup_iters = 3
|
||||
iters = 1
|
||||
gen_measures = MeasureTime()
|
||||
all_frames = 0
|
||||
for i in range(-warmup_iters, iters):
|
||||
text_padded = torch.randint(low=0, high=148, size=(args.batch_size, 128),
|
||||
dtype=torch.long).to('cuda')
|
||||
input_lengths = torch.IntTensor([text_padded.size(1)] * args.batch_size).to('cuda')
|
||||
durs = torch.ones_like(text_padded).mul_(4).to('cuda')
|
||||
|
||||
with torch.no_grad(), gen_measures:
|
||||
mels, *_ = model(text_padded, input_lengths, dur_tgt=durs)
|
||||
num_frames = mels.size(0) * mels.size(2)
|
||||
|
||||
if i >= 0:
|
||||
all_frames += num_frames
|
||||
DLLogger.log(step=(i,), data={"latency": gen_measures[-1]})
|
||||
DLLogger.log(step=(i,), data={"frames/s": num_frames / gen_measures[-1]})
|
||||
|
||||
measures = gen_measures[warmup_iters:]
|
||||
DLLogger.log(step=(), data={'avg latency': np.mean(measures)})
|
||||
DLLogger.log(step=(), data={'avg frames/s': all_frames / np.sum(measures)})
|
||||
DLLogger.flush()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
46
PyTorch/SpeechSynthesis/FastPitch/loss_functions.py
Normal file
46
PyTorch/SpeechSynthesis/FastPitch/loss_functions.py
Normal file
|
@ -0,0 +1,46 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
|
||||
from fastpitch.loss_function import FastPitchLoss
|
||||
from tacotron2.loss_function import Tacotron2Loss
|
||||
from waveglow.loss_function import WaveGlowLoss
|
||||
|
||||
|
||||
def get_loss_function(loss_function, **kw):
|
||||
if loss_function == 'Tacotron2':
|
||||
loss = Tacotron2Loss()
|
||||
elif loss_function == 'WaveGlow':
|
||||
loss = WaveGlowLoss(**kw)
|
||||
elif loss_function == 'FastPitch':
|
||||
loss = FastPitchLoss(**kw)
|
||||
else:
|
||||
raise NotImplementedError(
|
||||
"unknown loss function requested: {}".format(loss_function))
|
||||
return loss.cuda()
|
223
PyTorch/SpeechSynthesis/FastPitch/models.py
Normal file
223
PyTorch/SpeechSynthesis/FastPitch/models.py
Normal file
|
@ -0,0 +1,223 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
import sys
|
||||
from typing import Optional
|
||||
from os.path import abspath, dirname
|
||||
|
||||
import torch
|
||||
|
||||
# enabling modules discovery from global entrypoint
|
||||
sys.path.append(abspath(dirname(__file__)+'/'))
|
||||
from fastpitch.model import FastPitch as _FastPitch
|
||||
from fastpitch.model_jit import FastPitch as _FastPitchJIT
|
||||
from tacotron2.model import Tacotron2
|
||||
from waveglow.model import WaveGlow
|
||||
|
||||
|
||||
def parse_model_args(model_name, parser, add_help=False):
|
||||
if model_name == 'Tacotron2':
|
||||
from tacotron2.arg_parser import parse_tacotron2_args
|
||||
return parse_tacotron2_args(parser, add_help)
|
||||
if model_name == 'WaveGlow':
|
||||
from waveglow.arg_parser import parse_waveglow_args
|
||||
return parse_waveglow_args(parser, add_help)
|
||||
elif model_name == 'FastPitch':
|
||||
from fastpitch.arg_parser import parse_fastpitch_args
|
||||
return parse_fastpitch_args(parser, add_help)
|
||||
else:
|
||||
raise NotImplementedError(model_name)
|
||||
|
||||
|
||||
def batchnorm_to_float(module):
|
||||
"""Converts batch norm to FP32"""
|
||||
if isinstance(module, torch.nn.modules.batchnorm._BatchNorm):
|
||||
module.float()
|
||||
for child in module.children():
|
||||
batchnorm_to_float(child)
|
||||
return module
|
||||
|
||||
|
||||
def init_bn(module):
|
||||
if isinstance(module, torch.nn.modules.batchnorm._BatchNorm):
|
||||
if module.affine:
|
||||
module.weight.data.uniform_()
|
||||
for child in module.children():
|
||||
init_bn(child)
|
||||
|
||||
|
||||
def get_model(model_name, model_config, device,
|
||||
uniform_initialize_bn_weight=False, forward_is_infer=False,
|
||||
jitable=False):
|
||||
""" Code chooses a model based on name"""
|
||||
model = None
|
||||
if model_name == 'Tacotron2':
|
||||
if forward_is_infer:
|
||||
class Tacotron2__forward_is_infer(Tacotron2):
|
||||
def forward(self, inputs, input_lengths):
|
||||
return self.infer(inputs, input_lengths)
|
||||
model = Tacotron2__forward_is_infer(**model_config)
|
||||
else:
|
||||
model = Tacotron2(**model_config)
|
||||
|
||||
elif model_name == 'WaveGlow':
|
||||
if forward_is_infer:
|
||||
class WaveGlow__forward_is_infer(WaveGlow):
|
||||
def forward(self, spect, sigma=1.0):
|
||||
return self.infer(spect, sigma)
|
||||
model = WaveGlow__forward_is_infer(**model_config)
|
||||
else:
|
||||
model = WaveGlow(**model_config)
|
||||
|
||||
elif model_name == 'FastPitch':
|
||||
|
||||
if forward_is_infer:
|
||||
|
||||
if jitable:
|
||||
class FastPitch__forward_is_infer(_FastPitchJIT):
|
||||
def forward(self, inputs, input_lengths, pace: float = 1.0,
|
||||
dur_tgt: Optional[torch.Tensor] = None,
|
||||
pitch_tgt: Optional[torch.Tensor] = None,
|
||||
pitch_transform: Optional[bool] = None):
|
||||
return self.infer(inputs, input_lengths, pace=pace,
|
||||
dur_tgt=dur_tgt, pitch_tgt=pitch_tgt)
|
||||
else:
|
||||
class FastPitch__forward_is_infer(_FastPitch):
|
||||
def forward(self, inputs, input_lengths, pace: float = 1.0,
|
||||
dur_tgt: Optional[torch.Tensor] = None,
|
||||
pitch_tgt: Optional[torch.Tensor] = None,
|
||||
pitch_transform=None):
|
||||
return self.infer(inputs, input_lengths, pace=pace,
|
||||
dur_tgt=dur_tgt, pitch_tgt=pitch_tgt,
|
||||
pitch_transform=pitch_transform)
|
||||
|
||||
model = FastPitch__forward_is_infer(**model_config)
|
||||
else:
|
||||
model = _FastPitch(**model_config)
|
||||
|
||||
else:
|
||||
raise NotImplementedError(model_name)
|
||||
|
||||
if uniform_initialize_bn_weight:
|
||||
init_bn(model)
|
||||
|
||||
return model.to(device)
|
||||
|
||||
|
||||
def get_model_config(model_name, args):
|
||||
""" Code chooses a model based on name"""
|
||||
if model_name == 'Tacotron2':
|
||||
model_config = dict(
|
||||
# optimization
|
||||
mask_padding=args.mask_padding,
|
||||
# audio
|
||||
n_mel_channels=args.n_mel_channels,
|
||||
# symbols
|
||||
n_symbols=args.n_symbols,
|
||||
symbols_embedding_dim=args.symbols_embedding_dim,
|
||||
# encoder
|
||||
encoder_kernel_size=args.encoder_kernel_size,
|
||||
encoder_n_convolutions=args.encoder_n_convolutions,
|
||||
encoder_embedding_dim=args.encoder_embedding_dim,
|
||||
# attention
|
||||
attention_rnn_dim=args.attention_rnn_dim,
|
||||
attention_dim=args.attention_dim,
|
||||
# attention location
|
||||
attention_location_n_filters=args.attention_location_n_filters,
|
||||
attention_location_kernel_size=args.attention_location_kernel_size,
|
||||
# decoder
|
||||
n_frames_per_step=args.n_frames_per_step,
|
||||
decoder_rnn_dim=args.decoder_rnn_dim,
|
||||
prenet_dim=args.prenet_dim,
|
||||
max_decoder_steps=args.max_decoder_steps,
|
||||
gate_threshold=args.gate_threshold,
|
||||
p_attention_dropout=args.p_attention_dropout,
|
||||
p_decoder_dropout=args.p_decoder_dropout,
|
||||
# postnet
|
||||
postnet_embedding_dim=args.postnet_embedding_dim,
|
||||
postnet_kernel_size=args.postnet_kernel_size,
|
||||
postnet_n_convolutions=args.postnet_n_convolutions,
|
||||
decoder_no_early_stopping=args.decoder_no_early_stopping,
|
||||
)
|
||||
return model_config
|
||||
elif model_name == 'WaveGlow':
|
||||
model_config = dict(
|
||||
n_mel_channels=args.n_mel_channels,
|
||||
n_flows=args.flows,
|
||||
n_group=args.groups,
|
||||
n_early_every=args.early_every,
|
||||
n_early_size=args.early_size,
|
||||
WN_config=dict(
|
||||
n_layers=args.wn_layers,
|
||||
kernel_size=args.wn_kernel_size,
|
||||
n_channels=args.wn_channels
|
||||
)
|
||||
)
|
||||
return model_config
|
||||
elif model_name == 'FastPitch':
|
||||
model_config = dict(
|
||||
# io
|
||||
n_mel_channels=args.n_mel_channels,
|
||||
max_seq_len=args.max_seq_len,
|
||||
# symbols
|
||||
n_symbols=args.n_symbols,
|
||||
symbols_embedding_dim=args.symbols_embedding_dim,
|
||||
# input FFT
|
||||
in_fft_n_layers=args.in_fft_n_layers,
|
||||
in_fft_n_heads=args.in_fft_n_heads,
|
||||
in_fft_d_head=args.in_fft_d_head,
|
||||
in_fft_conv1d_kernel_size=args.in_fft_conv1d_kernel_size,
|
||||
in_fft_conv1d_filter_size=args.in_fft_conv1d_filter_size,
|
||||
in_fft_output_size=args.in_fft_output_size,
|
||||
p_in_fft_dropout=args.p_in_fft_dropout,
|
||||
p_in_fft_dropatt=args.p_in_fft_dropatt,
|
||||
p_in_fft_dropemb=args.p_in_fft_dropemb,
|
||||
# output FFT
|
||||
out_fft_n_layers=args.out_fft_n_layers,
|
||||
out_fft_n_heads=args.out_fft_n_heads,
|
||||
out_fft_d_head=args.out_fft_d_head,
|
||||
out_fft_conv1d_kernel_size=args.out_fft_conv1d_kernel_size,
|
||||
out_fft_conv1d_filter_size=args.out_fft_conv1d_filter_size,
|
||||
out_fft_output_size=args.out_fft_output_size,
|
||||
p_out_fft_dropout=args.p_out_fft_dropout,
|
||||
p_out_fft_dropatt=args.p_out_fft_dropatt,
|
||||
p_out_fft_dropemb=args.p_out_fft_dropemb,
|
||||
# duration predictor
|
||||
dur_predictor_kernel_size=args.dur_predictor_kernel_size,
|
||||
dur_predictor_filter_size=args.dur_predictor_filter_size,
|
||||
p_dur_predictor_dropout=args.p_dur_predictor_dropout,
|
||||
dur_predictor_n_layers=args.dur_predictor_n_layers,
|
||||
# pitch predictor
|
||||
pitch_predictor_kernel_size=args.pitch_predictor_kernel_size,
|
||||
pitch_predictor_filter_size=args.pitch_predictor_filter_size,
|
||||
p_pitch_predictor_dropout=args.p_pitch_predictor_dropout,
|
||||
pitch_predictor_n_layers=args.pitch_predictor_n_layers,
|
||||
)
|
||||
return model_config
|
||||
|
||||
else:
|
||||
raise NotImplementedError(model_name)
|
91
PyTorch/SpeechSynthesis/FastPitch/multiproc.py
Normal file
91
PyTorch/SpeechSynthesis/FastPitch/multiproc.py
Normal file
|
@ -0,0 +1,91 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
import torch
|
||||
|
||||
|
||||
def main():
|
||||
argslist = list(sys.argv)[1:]
|
||||
world_size = torch.cuda.device_count()
|
||||
|
||||
if '--set-world-size' in argslist:
|
||||
idx = argslist.index('--set-world-size')
|
||||
world_size = int(argslist[idx + 1])
|
||||
del argslist[idx + 1]
|
||||
del argslist[idx]
|
||||
|
||||
if '--world-size' in argslist:
|
||||
argslist[argslist.index('--world-size') + 1] = str(world_size)
|
||||
else:
|
||||
argslist.append('--world-size')
|
||||
argslist.append(str(world_size))
|
||||
|
||||
workers = []
|
||||
|
||||
for i in range(world_size):
|
||||
if '--rank' in argslist:
|
||||
argslist[argslist.index('--rank') + 1] = str(i)
|
||||
else:
|
||||
argslist.append('--rank')
|
||||
argslist.append(str(i))
|
||||
stdout = None if i == 0 else subprocess.DEVNULL
|
||||
worker = subprocess.Popen(
|
||||
[str(sys.executable)] + argslist, stdout=stdout)
|
||||
workers.append(worker)
|
||||
|
||||
returncode = 0
|
||||
try:
|
||||
pending = len(workers)
|
||||
while pending > 0:
|
||||
for worker in workers:
|
||||
try:
|
||||
worker_returncode = worker.wait(1)
|
||||
except subprocess.TimeoutExpired:
|
||||
continue
|
||||
pending -= 1
|
||||
if worker_returncode != 0:
|
||||
if returncode != 1:
|
||||
for worker in workers:
|
||||
worker.terminate()
|
||||
returncode = 1
|
||||
|
||||
except KeyboardInterrupt:
|
||||
print('Pressed CTRL-C, TERMINATING')
|
||||
for worker in workers:
|
||||
worker.terminate()
|
||||
for worker in workers:
|
||||
worker.wait()
|
||||
raise
|
||||
|
||||
sys.exit(returncode)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
|
@ -0,0 +1,9 @@
|
|||
output text
|
||||
01_his_dissapearance_gave_color_and_substance His disappearance gave color and substance to evil reports already in circulation that the will and conveyance above referred to
|
||||
02_his_dissapearance_gave_color_and_substance His disappearance gave color and substance to evil reports already in circulation that the will and conveyance above referred to
|
||||
03_his_dissapearance_gave_color_and_substance His disappearance gave color and substance to evil reports already in circulation that the will and conveyance above referred to
|
||||
04_his_dissapearance_gave_color_and_substance His disappearance gave color and substance to evil reports already in circulation that the will and conveyance above referred to
|
||||
05_his_dissapearance_gave_color_and_substance His disappearance gave color and substance to evil reports already in circulation that the will and conveyance above referred to
|
||||
06_his_dissapearance_gave_color_and_substance His disappearance gave color and substance to evil reports already in circulation that the will and conveyance above referred to
|
||||
07_his_dissapearance_gave_color_and_substance His disappearance gave color and substance to evil reports already in circulation that the will and conveyance above referred to
|
||||
08_his_dissapearance_gave_color_and_substance His disappearance gave color and substance to evil reports already in circulation that the will and conveyance above referred to
|
|
11
PyTorch/SpeechSynthesis/FastPitch/phrases/devset10.tsv
Normal file
11
PyTorch/SpeechSynthesis/FastPitch/phrases/devset10.tsv
Normal file
|
@ -0,0 +1,11 @@
|
|||
mel output text
|
||||
mels/LJ022-0023.pt 001_the_overwhelming_majority_of_people_in.wav The overwhelming majority of people in this country know how to sift the wheat from the chaff in what they hear and what they read.
|
||||
mels/LJ043-0030.pt 002_if_somebody_did_that_to_me,.wav If somebody did that to me, a lousy trick like that, to take my wife away, and all the furniture, I would be mad as hell, too.
|
||||
mels/LJ005-0201.pt 003_as_is_shown_by_the_report.wav as is shown by the report of the Commissioners to inquire into the state of the municipal corporations in eighteen thirty-five.
|
||||
mels/LJ001-0110.pt 004_even_the_caslon_type_when_enlarged.wav Even the Caslon type when enlarged shows great shortcomings in this respect:
|
||||
mels/LJ003-0345.pt 005_all_the_committee_could_do_in.wav All the committee could do in this respect was to throw the responsibility on others.
|
||||
mels/LJ007-0154.pt 006_these_pungent_and_well-grounded_strictures_applied.wav These pungent and well-grounded strictures applied with still greater force to the unconvicted prisoner, the man who came to the prison innocent, and still uncontaminated,
|
||||
mels/LJ018-0098.pt 007_and_recognized_as_one_of_the.wav and recognized as one of the frequenters of the bogus law-stationers. His arrest led to that of others.
|
||||
mels/LJ047-0044.pt 008_oswald_was,_however,_willing_to_discuss.wav Oswald was, however, willing to discuss his contacts with Soviet authorities. He denied having any involvement with Soviet intelligence agencies
|
||||
mels/LJ031-0038.pt 009_the_first_physician_to_see_the.wav The first physician to see the President at Parkland Hospital was Dr. Charles J. Carrico, a resident in general surgery.
|
||||
mels/LJ048-0194.pt 010_during_the_morning_of_november_twenty-two.wav during the morning of November twenty-two prior to the motorcade.
|
|
1
PyTorch/SpeechSynthesis/FastPitch/phrases/phrase.txt
Normal file
1
PyTorch/SpeechSynthesis/FastPitch/phrases/phrase.txt
Normal file
|
@ -0,0 +1 @@
|
|||
The forms of printed letters should be beautiful, and that their arrangement on the page should be reasonable and a help to the shapeliness of the letters themselves.
|
|
@ -0,0 +1,2 @@
|
|||
The forms of printed letters should be beautiful, and that their arrangement on the page should be reasonable and a help to the shapeliness of the letters themselves and the form of printed letters should be beautiful, and that their arrangement on pages.
|
||||
|
|
@ -0,0 +1 @@
|
|||
She sells seashells by the seashore, shells she sells are great
|
|
@ -0,0 +1,4 @@
|
|||
The forms of printed letters should be beautiful, and that their arrangement on the page should be reasonable and a help to the shapeliness of the letters themselves and the form of printed letters should be beautiful, and that their arrangement on pages.
|
||||
The forms of printed letters should be beautiful, and that their arrangement on the page should be reasonable and a help to the shapeliness of the letters themselves and the form of printed letters should be beautiful, and that their arrangement on pages.
|
||||
The forms of printed letters should be beautiful, and that their arrangement on the page should be reasonable and a help to the shapeliness of the letters themselves and the form of printed letters should be beautiful, and that their arrangement on pages.
|
||||
The forms of printed letters should be beautiful, and that their arrangement on the page should be reasonable and a help to the shapeliness of the letters themselves and the form of printed letters should be beautiful, and that their arrangement on pages.
|
|
@ -0,0 +1,4 @@
|
|||
She sells seashells by the seashore, shells she sells are great
|
||||
She sells seashells by the seashore, shells she sells are great
|
||||
She sells seashells by the seashore, shells she sells are great
|
||||
She sells seashells by the seashore, shells she sells are great
|
|
@ -0,0 +1,8 @@
|
|||
The forms of printed letters should be beautiful, and that their arrangement on the page should be reasonable and a help to the shapeliness of the letters themselves and the form of printed letters should be beautiful, and that their arrangement on pages.
|
||||
The forms of printed letters should be beautiful, and that their arrangement on the page should be reasonable and a help to the shapeliness of the letters themselves and the form of printed letters should be beautiful, and that their arrangement on pages.
|
||||
The forms of printed letters should be beautiful, and that their arrangement on the page should be reasonable and a help to the shapeliness of the letters themselves and the form of printed letters should be beautiful, and that their arrangement on pages.
|
||||
The forms of printed letters should be beautiful, and that their arrangement on the page should be reasonable and a help to the shapeliness of the letters themselves and the form of printed letters should be beautiful, and that their arrangement on pages.
|
||||
The forms of printed letters should be beautiful, and that their arrangement on the page should be reasonable and a help to the shapeliness of the letters themselves and the form of printed letters should be beautiful, and that their arrangement on pages.
|
||||
The forms of printed letters should be beautiful, and that their arrangement on the page should be reasonable and a help to the shapeliness of the letters themselves and the form of printed letters should be beautiful, and that their arrangement on pages.
|
||||
The forms of printed letters should be beautiful, and that their arrangement on the page should be reasonable and a help to the shapeliness of the letters themselves and the form of printed letters should be beautiful, and that their arrangement on pages.
|
||||
The forms of printed letters should be beautiful, and that their arrangement on the page should be reasonable and a help to the shapeliness of the letters themselves and the form of printed letters should be beautiful, and that their arrangement on pages.
|
|
@ -0,0 +1,8 @@
|
|||
She sells seashells by the seashore, shells she sells are great
|
||||
She sells seashells by the seashore, shells she sells are great
|
||||
She sells seashells by the seashore, shells she sells are great
|
||||
She sells seashells by the seashore, shells she sells are great
|
||||
She sells seashells by the seashore, shells she sells are great
|
||||
She sells seashells by the seashore, shells she sells are great
|
||||
She sells seashells by the seashore, shells she sells are great
|
||||
She sells seashells by the seashore, shells she sells are great
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
mkdir -p output
|
||||
python train.py \
|
||||
--amp-run \
|
||||
--cuda \
|
||||
--cudnn-enabled \
|
||||
-o ./output/ \
|
||||
--log-file output/nvlog.json \
|
||||
--dataset-path LJSpeech-1.1 \
|
||||
--training-files filelists/ljs_mel_dur_pitch_text_train_filelist.txt \
|
||||
--validation-files filelists/ljs_mel_dur_pitch_text_test_filelist.txt \
|
||||
--pitch-mean-std LJSpeech-1.1/pitch_char_stats__ljs_audio_text_train_filelist.json \
|
||||
--epochs 1500 \
|
||||
--epochs-per-checkpoint 100 \
|
||||
--warmup-steps 1000 \
|
||||
-lr 0.1 \
|
||||
-bs 64 \
|
||||
--optimizer lamb \
|
||||
--grad-clip-thresh 1000.0 \
|
||||
--dur-predictor-loss-scale 0.1 \
|
||||
--pitch-predictor-loss-scale 0.1 \
|
||||
--weight-decay 1e-6 \
|
||||
--gradient-accumulation-steps 4
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
mkdir -p output
|
||||
python -m multiproc train.py \
|
||||
--amp-run \
|
||||
--set-world-size 4 \
|
||||
--cuda \
|
||||
--cudnn-enabled \
|
||||
-o ./output/ \
|
||||
--log-file output/nvlog.json \
|
||||
--dataset-path LJSpeech-1.1 \
|
||||
--training-files filelists/ljs_mel_dur_pitch_text_train_filelist.txt \
|
||||
--validation-files filelists/ljs_mel_dur_pitch_text_test_filelist.txt \
|
||||
--pitch-mean-std LJSpeech-1.1/pitch_char_stats__ljs_audio_text_train_filelist.json \
|
||||
--epochs 1500 \
|
||||
--epochs-per-checkpoint 100 \
|
||||
--warmup-steps 1000 \
|
||||
-lr 0.1 \
|
||||
-bs 64 \
|
||||
--optimizer lamb \
|
||||
--grad-clip-thresh 1000.0 \
|
||||
--dur-predictor-loss-scale 0.1 \
|
||||
--pitch-predictor-loss-scale 0.1 \
|
||||
--weight-decay 1e-6 \
|
||||
--gradient-accumulation-steps 1
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
mkdir -p output
|
||||
python -m multiproc train.py \
|
||||
--amp-run \
|
||||
--cuda \
|
||||
--cudnn-enabled \
|
||||
-o ./output/ \
|
||||
--log-file output/nvlog.json \
|
||||
--dataset-path LJSpeech-1.1 \
|
||||
--training-files filelists/ljs_mel_dur_pitch_text_train_filelist.txt \
|
||||
--validation-files filelists/ljs_mel_dur_pitch_text_test_filelist.txt \
|
||||
--pitch-mean-std LJSpeech-1.1/pitch_char_stats__ljs_audio_text_train_filelist.json \
|
||||
--epochs 1500 \
|
||||
--epochs-per-checkpoint 100 \
|
||||
--warmup-steps 1000 \
|
||||
-lr 0.1 \
|
||||
-bs 32 \
|
||||
--optimizer lamb \
|
||||
--grad-clip-thresh 1000.0 \
|
||||
--dur-predictor-loss-scale 0.1 \
|
||||
--pitch-predictor-loss-scale 0.1 \
|
||||
--weight-decay 1e-6 \
|
||||
--gradient-accumulation-steps 1
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
|
||||
mkdir -p output
|
||||
python train.py \
|
||||
--cuda \
|
||||
--cudnn-enabled \
|
||||
-o ./output/ \
|
||||
--log-file output/nvlog.json \
|
||||
--dataset-path LJSpeech-1.1 \
|
||||
--training-files filelists/ljs_mel_dur_pitch_text_train_filelist.txt \
|
||||
--validation-files filelists/ljs_mel_dur_pitch_text_test_filelist.txt \
|
||||
--pitch-mean-std LJSpeech-1.1/pitch_char_stats__ljs_audio_text_train_filelist.json \
|
||||
--epochs 1500 \
|
||||
--epochs-per-checkpoint 100 \
|
||||
--warmup-steps 1000 \
|
||||
-lr 0.1 \
|
||||
-bs 32 \
|
||||
--optimizer lamb \
|
||||
--grad-clip-thresh 1000.0 \
|
||||
--dur-predictor-loss-scale 0.1 \
|
||||
--pitch-predictor-loss-scale 0.1 \
|
||||
--weight-decay 1e-6 \
|
||||
--gradient-accumulation-steps 8
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
mkdir -p output
|
||||
python -m multiproc train.py \
|
||||
--set-world-size 4 \
|
||||
--cuda \
|
||||
--cudnn-enabled \
|
||||
-o ./output/ \
|
||||
--log-file output/nvlog.json \
|
||||
--dataset-path LJSpeech-1.1 \
|
||||
--training-files filelists/ljs_mel_dur_pitch_text_train_filelist.txt \
|
||||
--validation-files filelists/ljs_mel_dur_pitch_text_test_filelist.txt \
|
||||
--pitch-mean-std LJSpeech-1.1/pitch_char_stats__ljs_audio_text_train_filelist.json \
|
||||
--epochs 1500 \
|
||||
--epochs-per-checkpoint 100 \
|
||||
--warmup-steps 1000 \
|
||||
-lr 0.1 \
|
||||
-bs 32 \
|
||||
--optimizer lamb \
|
||||
--grad-clip-thresh 1000.0 \
|
||||
--dur-predictor-loss-scale 0.1 \
|
||||
--pitch-predictor-loss-scale 0.1 \
|
||||
--weight-decay 1e-6 \
|
||||
--gradient-accumulation-steps 2
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
|
||||
mkdir -p output
|
||||
python -m multiproc train.py \
|
||||
--cuda \
|
||||
--cudnn-enabled \
|
||||
-o ./output/ \
|
||||
--log-file output/nvlog.json \
|
||||
--dataset-path LJSpeech-1.1 \
|
||||
--training-files filelists/ljs_mel_dur_pitch_text_train_filelist.txt \
|
||||
--validation-files filelists/ljs_mel_dur_pitch_text_test_filelist.txt \
|
||||
--pitch-mean-std LJSpeech-1.1/pitch_char_stats__ljs_audio_text_train_filelist.json \
|
||||
--epochs 1500 \
|
||||
--epochs-per-checkpoint 100 \
|
||||
--warmup-steps 1000 \
|
||||
-lr 0.1 \
|
||||
-bs 32 \
|
||||
--optimizer lamb \
|
||||
--grad-clip-thresh 1000.0 \
|
||||
--dur-predictor-loss-scale 0.1 \
|
||||
--pitch-predictor-loss-scale 0.1 \
|
||||
--weight-decay 1e-6 \
|
||||
--gradient-accumulation-steps 1
|
9
PyTorch/SpeechSynthesis/FastPitch/requirements.txt
Normal file
9
PyTorch/SpeechSynthesis/FastPitch/requirements.txt
Normal file
|
@ -0,0 +1,9 @@
|
|||
matplotlib
|
||||
numpy
|
||||
inflect
|
||||
librosa
|
||||
scipy
|
||||
Unidecode
|
||||
praat-parselmouth==0.3.3
|
||||
tensorboardX==2.0
|
||||
git+git://github.com/NVIDIA/dllogger.git@26a0f8f1958de2c0c460925ff6102a4d2486d6cc#egg=dllogger
|
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
docker build . -t fastpitch:latest
|
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
docker run --gpus=all -it --rm -e CUDA_VISIBLE_DEVICES --ipc=host -v $PWD:/workspace/fastpitch/ fastpitch:latest bash
|
39
PyTorch/SpeechSynthesis/FastPitch/scripts/download_dataset.sh
Executable file
39
PyTorch/SpeechSynthesis/FastPitch/scripts/download_dataset.sh
Executable file
|
@ -0,0 +1,39 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
DATA_DIR="LJSpeech-1.1"
|
||||
MODEL_DIR="pretrained_models"
|
||||
|
||||
LJS_ARCH="LJSpeech-1.1.tar.bz2"
|
||||
LJS_URL="http://data.keithito.com/data/speech/${LJS_ARCH}"
|
||||
|
||||
TACO_CH="nvidia_tacotron2pyt_fp32_20190427.pt"
|
||||
TACO_URL="https://api.ngc.nvidia.com/v2/models/nvidia/tacotron2pyt_fp32/versions/2/files/nvidia_tacotron2pyt_fp32_20190427"
|
||||
|
||||
WAVEG_CH="waveglow_256channels_ljs_v3.pt"
|
||||
WAVEG_URL="https://api.ngc.nvidia.com/v2/models/nvidia/waveglow_ljs_256channels/versions/3/files/waveglow_256channels_ljs_v3.pt"
|
||||
|
||||
|
||||
if [ ! -f ${LJS_ARCH} ]; then
|
||||
echo "Downloading ${LJS_ARCH} ..."
|
||||
wget -q ${LJS_URL}
|
||||
fi
|
||||
|
||||
if [ ! -d ${DATA_DIR} ]; then
|
||||
echo "Extracting ${LJS_ARCH} ..."
|
||||
tar jxvf ${LJS_ARCH}
|
||||
rm -f ${LJS_ARCH}
|
||||
fi
|
||||
|
||||
if [ ! -f "${MODEL_DIR}/tacotron2/${TACO_CH}" ]; then
|
||||
echo "Downloading ${TACO_CH} ..."
|
||||
mkdir -p "$MODEL_DIR"/tacotron2
|
||||
wget -qO ${MODEL_DIR}/tacotron2/${TACO_CH} ${TACO_URL}
|
||||
fi
|
||||
|
||||
if [ ! -f "${MODEL_DIR}/waveglow/${WAVEG_CH}" ]; then
|
||||
echo "Downloading ${WAVEG_CH} ..."
|
||||
mkdir -p ${MODEL_DIR}/waveglow
|
||||
wget -qO ${MODEL_DIR}/waveglow/${WAVEG_CH} ${WAVEG_URL}
|
||||
fi
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash
|
||||
|
||||
MODEL_DIR="pretrained_models"
|
||||
EXP_DIR="output"
|
||||
|
||||
WAVEG_CH="waveglow_256channels_ljs_v3.pt"
|
||||
|
||||
BSZ=${1:-4}
|
||||
PRECISION=${2:-fp16}
|
||||
|
||||
for PRECISION in fp16 fp32; do
|
||||
for BSZ in 1 4 8 ; do
|
||||
|
||||
echo -e "\nprecision=${PRECISION} batch size=${BSZ}\n"
|
||||
|
||||
[ "$PRECISION" == "fp16" ] && AMP_FLAG="--amp-run" || AMP_FLAG=""
|
||||
|
||||
python inference.py --cuda --wn-channels 256 ${AMP_FLAG} \
|
||||
--fastpitch ${EXP_DIR}/checkpoint_FastPitch_1500.pt \
|
||||
--waveglow ${MODEL_DIR}/waveglow/${WAVEG_CH} \
|
||||
--include-warmup \
|
||||
--batch-size ${BSZ} \
|
||||
--repeats 1000 \
|
||||
-i phrases/benchmark_8_128.tsv
|
||||
done
|
||||
done
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
DATA_DIR="LJSpeech-1.1"
|
||||
EXP_DIR="output"
|
||||
WAVEG_CH="pretrained_models/waveglow/waveglow_256channels_ljs_v3.pt"
|
||||
|
||||
CHECKPOINT=${1:-1500}
|
||||
|
||||
python inference.py -i phrases/devset10.tsv \
|
||||
-o ${EXP_DIR}/audio_devset10_checkpoint${CHECKPOINT} \
|
||||
--log-file ${EXP_DIR}/nvlog_inference.json \
|
||||
--dataset-path ${DATA_DIR} \
|
||||
--fastpitch ${EXP_DIR}/checkpoint_FastPitch_${CHECKPOINT}.pt \
|
||||
--waveglow ${WAVEG_CH} \
|
||||
--wn-channels 256 \
|
||||
--batch-size 32 \
|
||||
--amp-run \
|
||||
--cuda
|
20
PyTorch/SpeechSynthesis/FastPitch/scripts/prepare_dataset.sh
Executable file
20
PyTorch/SpeechSynthesis/FastPitch/scripts/prepare_dataset.sh
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
DATA_DIR="LJSpeech-1.1"
|
||||
TACO_CH="pretrained_models/tacotron2/nvidia_tacotron2pyt_fp32_20190427.pt"
|
||||
for FILELIST in ljs_audio_text_train_filelist.txt \
|
||||
ljs_audio_text_val_filelist.txt \
|
||||
ljs_audio_text_test_filelist.txt \
|
||||
; do
|
||||
python extract_mels.py \
|
||||
--cuda \
|
||||
--dataset-path ${DATA_DIR} \
|
||||
--wav-text-filelist filelists/${FILELIST} \
|
||||
--batch-size 256 \
|
||||
--extract-mels \
|
||||
--extract-durations \
|
||||
--extract-pitch-char \
|
||||
--tacotron2-checkpoint ${TACO_CH}
|
||||
done
|
40
PyTorch/SpeechSynthesis/FastPitch/scripts/train.sh
Executable file
40
PyTorch/SpeechSynthesis/FastPitch/scripts/train.sh
Executable file
|
@ -0,0 +1,40 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Default recipe for 8x GPU 16GB with TensorCores (fp16/AMP).
|
||||
# For other configurations, adjust
|
||||
#
|
||||
# batch-size x graient-accumulation-steps
|
||||
#
|
||||
# to maintain a total of 64x4=256 samples per step.
|
||||
#
|
||||
# | Prec. | #GPU | -bs | --gradient-accumulation-steps |
|
||||
# |-------|------|-----|-------------------------------|
|
||||
# | AMP | 1 | 64 | 4 |
|
||||
# | AMP | 4 | 64 | 1 |
|
||||
# | AMP | 8 | 32 | 1 |
|
||||
# | FP32 | 1 | 32 | 8 |
|
||||
# | FP32 | 4 | 32 | 2 |
|
||||
# | FP32 | 8 | 32 | 1 |
|
||||
|
||||
mkdir -p output
|
||||
python -m multiproc train.py \
|
||||
--cuda \
|
||||
--cudnn-enabled \
|
||||
-o ./output/ \
|
||||
--log-file ./output/nvlog.json \
|
||||
--dataset-path LJSpeech-1.1 \
|
||||
--training-files filelists/ljs_mel_dur_pitch_text_train_filelist.txt \
|
||||
--validation-files filelists/ljs_mel_dur_pitch_text_test_filelist.txt \
|
||||
--pitch-mean-std-file LJSpeech-1.1/pitch_char_stats__ljs_audio_text_train_filelist.json \
|
||||
--epochs 1500 \
|
||||
--epochs-per-checkpoint 100 \
|
||||
--warmup-steps 1000 \
|
||||
-lr 0.1 \
|
||||
-bs 32 \
|
||||
--optimizer lamb \
|
||||
--grad-clip-thresh 1000.0 \
|
||||
--dur-predictor-loss-scale 0.1 \
|
||||
--pitch-predictor-loss-scale 0.1 \
|
||||
--weight-decay 1e-6 \
|
||||
--gradient-accumulation-steps 1 \
|
||||
--amp-run
|
108
PyTorch/SpeechSynthesis/FastPitch/tacotron2/arg_parser.py
Normal file
108
PyTorch/SpeechSynthesis/FastPitch/tacotron2/arg_parser.py
Normal file
|
@ -0,0 +1,108 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
import argparse
|
||||
|
||||
from common.text import symbols
|
||||
|
||||
|
||||
def parse_tacotron2_args(parent, add_help=False):
|
||||
"""
|
||||
Parse commandline arguments.
|
||||
"""
|
||||
parser = argparse.ArgumentParser(parents=[parent], add_help=add_help)
|
||||
|
||||
# misc parameters
|
||||
parser.add_argument('--mask-padding', default=False, type=bool,
|
||||
help='Use mask padding')
|
||||
parser.add_argument('--n-mel-channels', default=80, type=int,
|
||||
help='Number of bins in mel-spectrograms')
|
||||
|
||||
# symbols parameters
|
||||
global symbols
|
||||
len_symbols = len(symbols)
|
||||
symbols = parser.add_argument_group('symbols parameters')
|
||||
symbols.add_argument('--n-symbols', default=len_symbols, type=int,
|
||||
help='Number of symbols in dictionary')
|
||||
symbols.add_argument('--symbols-embedding-dim', default=512, type=int,
|
||||
help='Input embedding dimension')
|
||||
|
||||
# encoder parameters
|
||||
encoder = parser.add_argument_group('encoder parameters')
|
||||
encoder.add_argument('--encoder-kernel-size', default=5, type=int,
|
||||
help='Encoder kernel size')
|
||||
encoder.add_argument('--encoder-n-convolutions', default=3, type=int,
|
||||
help='Number of encoder convolutions')
|
||||
encoder.add_argument('--encoder-embedding-dim', default=512, type=int,
|
||||
help='Encoder embedding dimension')
|
||||
|
||||
# decoder parameters
|
||||
decoder = parser.add_argument_group('decoder parameters')
|
||||
decoder.add_argument('--n-frames-per-step', default=1,
|
||||
type=int,
|
||||
help='Number of frames processed per step') # currently only 1 is supported
|
||||
decoder.add_argument('--decoder-rnn-dim', default=1024, type=int,
|
||||
help='Number of units in decoder LSTM')
|
||||
decoder.add_argument('--prenet-dim', default=256, type=int,
|
||||
help='Number of ReLU units in prenet layers')
|
||||
decoder.add_argument('--max-decoder-steps', default=2000, type=int,
|
||||
help='Maximum number of output mel spectrograms')
|
||||
decoder.add_argument('--gate-threshold', default=0.5, type=float,
|
||||
help='Probability threshold for stop token')
|
||||
decoder.add_argument('--p-attention-dropout', default=0.1, type=float,
|
||||
help='Dropout probability for attention LSTM')
|
||||
decoder.add_argument('--p-decoder-dropout', default=0.1, type=float,
|
||||
help='Dropout probability for decoder LSTM')
|
||||
decoder.add_argument('--decoder-no-early-stopping', action='store_true',
|
||||
help='Stop decoding once all samples are finished')
|
||||
|
||||
# attention parameters
|
||||
attention = parser.add_argument_group('attention parameters')
|
||||
attention.add_argument('--attention-rnn-dim', default=1024, type=int,
|
||||
help='Number of units in attention LSTM')
|
||||
attention.add_argument('--attention-dim', default=128, type=int,
|
||||
help='Dimension of attention hidden representation')
|
||||
|
||||
# location layer parameters
|
||||
location = parser.add_argument_group('location parameters')
|
||||
location.add_argument(
|
||||
'--attention-location-n-filters', default=32, type=int,
|
||||
help='Number of filters for location-sensitive attention')
|
||||
location.add_argument(
|
||||
'--attention-location-kernel-size', default=31, type=int,
|
||||
help='Kernel size for location-sensitive attention')
|
||||
|
||||
# Mel-post processing network parameters
|
||||
postnet = parser.add_argument_group('postnet parameters')
|
||||
postnet.add_argument('--postnet-embedding-dim', default=512, type=int,
|
||||
help='Postnet embedding dimension')
|
||||
postnet.add_argument('--postnet-kernel-size', default=5, type=int,
|
||||
help='Postnet kernel size')
|
||||
postnet.add_argument('--postnet-n-convolutions', default=5, type=int,
|
||||
help='Number of postnet convolutions')
|
||||
|
||||
return parser
|
160
PyTorch/SpeechSynthesis/FastPitch/tacotron2/data_function.py
Normal file
160
PyTorch/SpeechSynthesis/FastPitch/tacotron2/data_function.py
Normal file
|
@ -0,0 +1,160 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
import random
|
||||
import numpy as np
|
||||
|
||||
import torch
|
||||
import torch.utils.data
|
||||
|
||||
import common.layers as layers
|
||||
from common.utils import load_wav_to_torch, load_filepaths_and_text, to_gpu
|
||||
from common.text import text_to_sequence
|
||||
|
||||
|
||||
class TextMelLoader(torch.utils.data.Dataset):
|
||||
"""
|
||||
1) loads audio,text pairs
|
||||
2) normalizes text and converts them to sequences of one-hot vectors
|
||||
3) computes mel-spectrograms from audio files.
|
||||
"""
|
||||
def __init__(self, dataset_path, audiopaths_and_text, args, load_mel_from_disk=True):
|
||||
self.audiopaths_and_text = load_filepaths_and_text(dataset_path, audiopaths_and_text)
|
||||
self.text_cleaners = args.text_cleaners
|
||||
self.load_mel_from_disk = load_mel_from_disk
|
||||
if not load_mel_from_disk:
|
||||
self.max_wav_value = args.max_wav_value
|
||||
self.sampling_rate = args.sampling_rate
|
||||
self.stft = layers.TacotronSTFT(
|
||||
args.filter_length, args.hop_length, args.win_length,
|
||||
args.n_mel_channels, args.sampling_rate, args.mel_fmin,
|
||||
args.mel_fmax)
|
||||
|
||||
def get_mel(self, filename):
|
||||
if not self.load_mel_from_disk:
|
||||
audio, sampling_rate = load_wav_to_torch(filename)
|
||||
if sampling_rate != self.stft.sampling_rate:
|
||||
raise ValueError("{} {} SR doesn't match target {} SR".format(
|
||||
sampling_rate, self.stft.sampling_rate))
|
||||
audio_norm = audio / self.max_wav_value
|
||||
audio_norm = audio_norm.unsqueeze(0)
|
||||
audio_norm = torch.autograd.Variable(audio_norm, requires_grad=False)
|
||||
melspec = self.stft.mel_spectrogram(audio_norm)
|
||||
melspec = torch.squeeze(melspec, 0)
|
||||
else:
|
||||
melspec = torch.load(filename)
|
||||
# assert melspec.size(0) == self.stft.n_mel_channels, (
|
||||
# 'Mel dimension mismatch: given {}, expected {}'.format(
|
||||
# melspec.size(0), self.stft.n_mel_channels))
|
||||
|
||||
return melspec
|
||||
|
||||
def get_text(self, text):
|
||||
text_norm = torch.IntTensor(text_to_sequence(text, self.text_cleaners))
|
||||
return text_norm
|
||||
|
||||
def __getitem__(self, index):
|
||||
# separate filename and text
|
||||
audiopath, text = self.audiopaths_and_text[index]
|
||||
len_text = len(text)
|
||||
text = self.get_text(text)
|
||||
mel = self.get_mel(audiopath)
|
||||
return (text, mel, len_text)
|
||||
|
||||
def __len__(self):
|
||||
return len(self.audiopaths_and_text)
|
||||
|
||||
|
||||
class TextMelCollate():
|
||||
""" Zero-pads model inputs and targets based on number of frames per step
|
||||
"""
|
||||
def __init__(self, n_frames_per_step):
|
||||
self.n_frames_per_step = n_frames_per_step
|
||||
|
||||
def __call__(self, batch):
|
||||
"""Collate's training batch from normalized text and mel-spectrogram
|
||||
PARAMS
|
||||
------
|
||||
batch: [text_normalized, mel_normalized]
|
||||
"""
|
||||
# Right zero-pad all one-hot text sequences to max input length
|
||||
input_lengths, ids_sorted_decreasing = torch.sort(
|
||||
torch.LongTensor([len(x[0]) for x in batch]),
|
||||
dim=0, descending=True)
|
||||
max_input_len = input_lengths[0]
|
||||
|
||||
text_padded = torch.LongTensor(len(batch), max_input_len)
|
||||
text_padded.zero_()
|
||||
for i in range(len(ids_sorted_decreasing)):
|
||||
text = batch[ids_sorted_decreasing[i]][0]
|
||||
text_padded[i, :text.size(0)] = text
|
||||
|
||||
# Right zero-pad mel-spec
|
||||
num_mels = batch[0][1].size(0)
|
||||
max_target_len = max([x[1].size(1) for x in batch])
|
||||
if max_target_len % self.n_frames_per_step != 0:
|
||||
max_target_len += self.n_frames_per_step - max_target_len % self.n_frames_per_step
|
||||
assert max_target_len % self.n_frames_per_step == 0
|
||||
|
||||
# include mel padded and gate padded
|
||||
mel_padded = torch.FloatTensor(len(batch), num_mels, max_target_len)
|
||||
mel_padded.zero_()
|
||||
gate_padded = torch.FloatTensor(len(batch), max_target_len)
|
||||
gate_padded.zero_()
|
||||
output_lengths = torch.LongTensor(len(batch))
|
||||
for i in range(len(ids_sorted_decreasing)):
|
||||
mel = batch[ids_sorted_decreasing[i]][1]
|
||||
mel_padded[i, :, :mel.size(1)] = mel
|
||||
gate_padded[i, mel.size(1)-1:] = 1
|
||||
output_lengths[i] = mel.size(1)
|
||||
|
||||
# count number of items - characters in text
|
||||
len_x = [x[2] for x in batch]
|
||||
len_x = torch.Tensor(len_x)
|
||||
|
||||
# Return any extra fields as sorted lists
|
||||
num_fields = len(batch[0])
|
||||
extra_fields = tuple([batch[i][f] for i in ids_sorted_decreasing]
|
||||
for f in range(3, num_fields))
|
||||
|
||||
return (text_padded, input_lengths, mel_padded, gate_padded, \
|
||||
output_lengths, len_x) + extra_fields
|
||||
|
||||
|
||||
def batch_to_gpu(batch):
|
||||
text_padded, input_lengths, mel_padded, gate_padded, \
|
||||
output_lengths, len_x = batch
|
||||
text_padded = to_gpu(text_padded).long()
|
||||
input_lengths = to_gpu(input_lengths).long()
|
||||
max_len = torch.max(input_lengths.data).item()
|
||||
mel_padded = to_gpu(mel_padded).float()
|
||||
gate_padded = to_gpu(gate_padded).float()
|
||||
output_lengths = to_gpu(output_lengths).long()
|
||||
x = (text_padded, input_lengths, mel_padded, max_len, output_lengths)
|
||||
y = (mel_padded, gate_padded)
|
||||
len_x = torch.sum(output_lengths)
|
||||
return (x, y, len_x)
|
47
PyTorch/SpeechSynthesis/FastPitch/tacotron2/loss_function.py
Normal file
47
PyTorch/SpeechSynthesis/FastPitch/tacotron2/loss_function.py
Normal file
|
@ -0,0 +1,47 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
from torch import nn
|
||||
|
||||
|
||||
class Tacotron2Loss(nn.Module):
|
||||
def __init__(self):
|
||||
super(Tacotron2Loss, self).__init__()
|
||||
|
||||
def forward(self, model_output, targets):
|
||||
mel_target, gate_target = targets[0], targets[1]
|
||||
mel_target.requires_grad = False
|
||||
gate_target.requires_grad = False
|
||||
gate_target = gate_target.view(-1, 1)
|
||||
|
||||
mel_out, mel_out_postnet, gate_out, _ = model_output
|
||||
gate_out = gate_out.view(-1, 1)
|
||||
mel_loss = nn.MSELoss()(mel_out, mel_target) + \
|
||||
nn.MSELoss()(mel_out_postnet, mel_target)
|
||||
gate_loss = nn.BCEWithLogitsLoss()(gate_out, gate_target)
|
||||
meta = {}
|
||||
return mel_loss + gate_loss, meta
|
695
PyTorch/SpeechSynthesis/FastPitch/tacotron2/model.py
Normal file
695
PyTorch/SpeechSynthesis/FastPitch/tacotron2/model.py
Normal file
|
@ -0,0 +1,695 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
import sys
|
||||
from math import sqrt
|
||||
from os.path import abspath, dirname
|
||||
|
||||
import torch
|
||||
from torch import nn
|
||||
from torch.nn import functional as F
|
||||
|
||||
# enabling modules discovery from global entrypoint
|
||||
sys.path.append(abspath(dirname(__file__)+'/../'))
|
||||
from common.layers import ConvNorm, LinearNorm
|
||||
from common.utils import mask_from_lens, to_gpu
|
||||
|
||||
|
||||
class LocationLayer(nn.Module):
|
||||
def __init__(self, attention_n_filters, attention_kernel_size,
|
||||
attention_dim):
|
||||
super(LocationLayer, self).__init__()
|
||||
padding = int((attention_kernel_size - 1) / 2)
|
||||
self.location_conv = ConvNorm(2, attention_n_filters,
|
||||
kernel_size=attention_kernel_size,
|
||||
padding=padding, bias=False, stride=1,
|
||||
dilation=1)
|
||||
self.location_dense = LinearNorm(attention_n_filters, attention_dim,
|
||||
bias=False, w_init_gain='tanh')
|
||||
|
||||
def forward(self, attention_weights_cat):
|
||||
processed_attention = self.location_conv(attention_weights_cat)
|
||||
processed_attention = processed_attention.transpose(1, 2)
|
||||
processed_attention = self.location_dense(processed_attention)
|
||||
return processed_attention
|
||||
|
||||
|
||||
class Attention(nn.Module):
|
||||
def __init__(self, attention_rnn_dim, embedding_dim,
|
||||
attention_dim, attention_location_n_filters,
|
||||
attention_location_kernel_size):
|
||||
super(Attention, self).__init__()
|
||||
self.query_layer = LinearNorm(attention_rnn_dim, attention_dim,
|
||||
bias=False, w_init_gain='tanh')
|
||||
self.memory_layer = LinearNorm(embedding_dim, attention_dim, bias=False,
|
||||
w_init_gain='tanh')
|
||||
self.v = LinearNorm(attention_dim, 1, bias=False)
|
||||
self.location_layer = LocationLayer(attention_location_n_filters,
|
||||
attention_location_kernel_size,
|
||||
attention_dim)
|
||||
self.score_mask_value = -float("inf")
|
||||
|
||||
def get_alignment_energies(self, query, processed_memory,
|
||||
attention_weights_cat):
|
||||
"""
|
||||
PARAMS
|
||||
------
|
||||
query: decoder output (batch, n_mel_channels * n_frames_per_step)
|
||||
processed_memory: processed encoder outputs (B, T_in, attention_dim)
|
||||
attention_weights_cat: cumulative and prev. att weights (B, 2, max_time)
|
||||
|
||||
RETURNS
|
||||
-------
|
||||
alignment (batch, max_time)
|
||||
"""
|
||||
|
||||
processed_query = self.query_layer(query.unsqueeze(1))
|
||||
processed_attention_weights = self.location_layer(attention_weights_cat)
|
||||
energies = self.v(torch.tanh(
|
||||
processed_query + processed_attention_weights + processed_memory))
|
||||
|
||||
energies = energies.squeeze(-1)
|
||||
return energies
|
||||
|
||||
def forward(self, attention_hidden_state, memory, processed_memory,
|
||||
attention_weights_cat, mask):
|
||||
"""
|
||||
PARAMS
|
||||
------
|
||||
attention_hidden_state: attention rnn last output
|
||||
memory: encoder outputs
|
||||
processed_memory: processed encoder outputs
|
||||
attention_weights_cat: previous and cummulative attention weights
|
||||
mask: binary mask for padded data
|
||||
"""
|
||||
alignment = self.get_alignment_energies(
|
||||
attention_hidden_state, processed_memory, attention_weights_cat)
|
||||
|
||||
alignment.masked_fill_(mask, self.score_mask_value)
|
||||
|
||||
attention_weights = F.softmax(alignment, dim=1)
|
||||
attention_context = torch.bmm(attention_weights.unsqueeze(1), memory)
|
||||
attention_context = attention_context.squeeze(1)
|
||||
|
||||
return attention_context, attention_weights
|
||||
|
||||
|
||||
class Prenet(nn.Module):
|
||||
def __init__(self, in_dim, sizes):
|
||||
super(Prenet, self).__init__()
|
||||
in_sizes = [in_dim] + sizes[:-1]
|
||||
self.layers = nn.ModuleList(
|
||||
[LinearNorm(in_size, out_size, bias=False)
|
||||
for (in_size, out_size) in zip(in_sizes, sizes)])
|
||||
|
||||
def forward(self, x):
|
||||
for linear in self.layers:
|
||||
x = F.dropout(F.relu(linear(x)), p=0.5, training=True)
|
||||
return x
|
||||
|
||||
|
||||
class Postnet(nn.Module):
|
||||
"""Postnet
|
||||
- Five 1-d convolution with 512 channels and kernel size 5
|
||||
"""
|
||||
|
||||
def __init__(self, n_mel_channels, postnet_embedding_dim,
|
||||
postnet_kernel_size, postnet_n_convolutions):
|
||||
super(Postnet, self).__init__()
|
||||
self.convolutions = nn.ModuleList()
|
||||
|
||||
self.convolutions.append(
|
||||
nn.Sequential(
|
||||
ConvNorm(n_mel_channels, postnet_embedding_dim,
|
||||
kernel_size=postnet_kernel_size, stride=1,
|
||||
padding=int((postnet_kernel_size - 1) / 2),
|
||||
dilation=1, w_init_gain='tanh'),
|
||||
nn.BatchNorm1d(postnet_embedding_dim))
|
||||
)
|
||||
|
||||
for i in range(1, postnet_n_convolutions - 1):
|
||||
self.convolutions.append(
|
||||
nn.Sequential(
|
||||
ConvNorm(postnet_embedding_dim,
|
||||
postnet_embedding_dim,
|
||||
kernel_size=postnet_kernel_size, stride=1,
|
||||
padding=int((postnet_kernel_size - 1) / 2),
|
||||
dilation=1, w_init_gain='tanh'),
|
||||
nn.BatchNorm1d(postnet_embedding_dim))
|
||||
)
|
||||
|
||||
self.convolutions.append(
|
||||
nn.Sequential(
|
||||
ConvNorm(postnet_embedding_dim, n_mel_channels,
|
||||
kernel_size=postnet_kernel_size, stride=1,
|
||||
padding=int((postnet_kernel_size - 1) / 2),
|
||||
dilation=1, w_init_gain='linear'),
|
||||
nn.BatchNorm1d(n_mel_channels))
|
||||
)
|
||||
self.n_convs = len(self.convolutions)
|
||||
|
||||
def forward(self, x):
|
||||
i = 0
|
||||
for conv in self.convolutions:
|
||||
if i < self.n_convs - 1:
|
||||
x = F.dropout(torch.tanh(conv(x)), 0.5, training=self.training)
|
||||
else:
|
||||
x = F.dropout(conv(x), 0.5, training=self.training)
|
||||
i += 1
|
||||
|
||||
return x
|
||||
|
||||
|
||||
class Encoder(nn.Module):
|
||||
"""Encoder module:
|
||||
- Three 1-d convolution banks
|
||||
- Bidirectional LSTM
|
||||
"""
|
||||
def __init__(self, encoder_n_convolutions,
|
||||
encoder_embedding_dim, encoder_kernel_size):
|
||||
super(Encoder, self).__init__()
|
||||
|
||||
convolutions = []
|
||||
for _ in range(encoder_n_convolutions):
|
||||
conv_layer = nn.Sequential(
|
||||
ConvNorm(encoder_embedding_dim,
|
||||
encoder_embedding_dim,
|
||||
kernel_size=encoder_kernel_size, stride=1,
|
||||
padding=int((encoder_kernel_size - 1) / 2),
|
||||
dilation=1, w_init_gain='relu'),
|
||||
nn.BatchNorm1d(encoder_embedding_dim))
|
||||
convolutions.append(conv_layer)
|
||||
self.convolutions = nn.ModuleList(convolutions)
|
||||
|
||||
self.lstm = nn.LSTM(encoder_embedding_dim,
|
||||
int(encoder_embedding_dim / 2), 1,
|
||||
batch_first=True, bidirectional=True)
|
||||
|
||||
@torch.jit.ignore
|
||||
def forward(self, x, input_lengths):
|
||||
for conv in self.convolutions:
|
||||
x = F.dropout(F.relu(conv(x)), 0.5, self.training)
|
||||
|
||||
x = x.transpose(1, 2)
|
||||
|
||||
# pytorch tensor are not reversible, hence the conversion
|
||||
input_lengths = input_lengths.cpu().numpy()
|
||||
x = nn.utils.rnn.pack_padded_sequence(
|
||||
x, input_lengths, batch_first=True)
|
||||
|
||||
self.lstm.flatten_parameters()
|
||||
outputs, _ = self.lstm(x)
|
||||
|
||||
outputs, _ = nn.utils.rnn.pad_packed_sequence(
|
||||
outputs, batch_first=True)
|
||||
|
||||
return outputs
|
||||
|
||||
@torch.jit.export
|
||||
def infer(self, x, input_lengths):
|
||||
device = x.device
|
||||
for conv in self.convolutions:
|
||||
x = F.dropout(F.relu(conv(x.to(device))), 0.5, self.training)
|
||||
|
||||
x = x.transpose(1, 2)
|
||||
|
||||
input_lengths = input_lengths.cpu()
|
||||
x = nn.utils.rnn.pack_padded_sequence(
|
||||
x, input_lengths, batch_first=True)
|
||||
|
||||
outputs, _ = self.lstm(x)
|
||||
|
||||
outputs, _ = nn.utils.rnn.pad_packed_sequence(
|
||||
outputs, batch_first=True)
|
||||
|
||||
return outputs
|
||||
|
||||
|
||||
class Decoder(nn.Module):
|
||||
def __init__(self, n_mel_channels, n_frames_per_step,
|
||||
encoder_embedding_dim, attention_dim,
|
||||
attention_location_n_filters,
|
||||
attention_location_kernel_size,
|
||||
attention_rnn_dim, decoder_rnn_dim,
|
||||
prenet_dim, max_decoder_steps, gate_threshold,
|
||||
p_attention_dropout, p_decoder_dropout,
|
||||
early_stopping):
|
||||
super(Decoder, self).__init__()
|
||||
self.n_mel_channels = n_mel_channels
|
||||
self.n_frames_per_step = n_frames_per_step
|
||||
self.encoder_embedding_dim = encoder_embedding_dim
|
||||
self.attention_rnn_dim = attention_rnn_dim
|
||||
self.decoder_rnn_dim = decoder_rnn_dim
|
||||
self.prenet_dim = prenet_dim
|
||||
self.max_decoder_steps = max_decoder_steps
|
||||
self.gate_threshold = gate_threshold
|
||||
self.p_attention_dropout = p_attention_dropout
|
||||
self.p_decoder_dropout = p_decoder_dropout
|
||||
self.early_stopping = early_stopping
|
||||
|
||||
self.prenet = Prenet(
|
||||
n_mel_channels * n_frames_per_step,
|
||||
[prenet_dim, prenet_dim])
|
||||
|
||||
self.attention_rnn = nn.LSTMCell(
|
||||
prenet_dim + encoder_embedding_dim,
|
||||
attention_rnn_dim)
|
||||
|
||||
self.attention_layer = Attention(
|
||||
attention_rnn_dim, encoder_embedding_dim,
|
||||
attention_dim, attention_location_n_filters,
|
||||
attention_location_kernel_size)
|
||||
|
||||
self.decoder_rnn = nn.LSTMCell(
|
||||
attention_rnn_dim + encoder_embedding_dim,
|
||||
decoder_rnn_dim, 1)
|
||||
|
||||
self.linear_projection = LinearNorm(
|
||||
decoder_rnn_dim + encoder_embedding_dim,
|
||||
n_mel_channels * n_frames_per_step)
|
||||
|
||||
self.gate_layer = LinearNorm(
|
||||
decoder_rnn_dim + encoder_embedding_dim, 1,
|
||||
bias=True, w_init_gain='sigmoid')
|
||||
|
||||
def get_go_frame(self, memory):
|
||||
""" Gets all zeros frames to use as first decoder input
|
||||
PARAMS
|
||||
------
|
||||
memory: decoder outputs
|
||||
|
||||
RETURNS
|
||||
-------
|
||||
decoder_input: all zeros frames
|
||||
"""
|
||||
B = memory.size(0)
|
||||
dtype = memory.dtype
|
||||
device = memory.device
|
||||
decoder_input = torch.zeros(
|
||||
B, self.n_mel_channels*self.n_frames_per_step,
|
||||
dtype=dtype, device=device)
|
||||
return decoder_input
|
||||
|
||||
def initialize_decoder_states(self, memory):
|
||||
""" Initializes attention rnn states, decoder rnn states, attention
|
||||
weights, attention cumulative weights, attention context, stores memory
|
||||
and stores processed memory
|
||||
PARAMS
|
||||
------
|
||||
memory: Encoder outputs
|
||||
mask: Mask for padded data if training, expects None for inference
|
||||
"""
|
||||
B = memory.size(0)
|
||||
MAX_TIME = memory.size(1)
|
||||
dtype = memory.dtype
|
||||
device = memory.device
|
||||
|
||||
attention_hidden = torch.zeros(
|
||||
B, self.attention_rnn_dim, dtype=dtype, device=device)
|
||||
attention_cell = torch.zeros(
|
||||
B, self.attention_rnn_dim, dtype=dtype, device=device)
|
||||
|
||||
decoder_hidden = torch.zeros(
|
||||
B, self.decoder_rnn_dim, dtype=dtype, device=device)
|
||||
decoder_cell = torch.zeros(
|
||||
B, self.decoder_rnn_dim, dtype=dtype, device=device)
|
||||
|
||||
attention_weights = torch.zeros(
|
||||
B, MAX_TIME, dtype=dtype, device=device)
|
||||
attention_weights_cum = torch.zeros(
|
||||
B, MAX_TIME, dtype=dtype, device=device)
|
||||
attention_context = torch.zeros(
|
||||
B, self.encoder_embedding_dim, dtype=dtype, device=device)
|
||||
|
||||
processed_memory = self.attention_layer.memory_layer(memory)
|
||||
|
||||
return (attention_hidden, attention_cell, decoder_hidden,
|
||||
decoder_cell, attention_weights, attention_weights_cum,
|
||||
attention_context, processed_memory)
|
||||
|
||||
def parse_decoder_inputs(self, decoder_inputs):
|
||||
""" Prepares decoder inputs, i.e. mel outputs
|
||||
PARAMS
|
||||
------
|
||||
decoder_inputs: inputs used for teacher-forced training, i.e. mel-specs
|
||||
|
||||
RETURNS
|
||||
-------
|
||||
inputs: processed decoder inputs
|
||||
|
||||
"""
|
||||
# (B, n_mel_channels, T_out) -> (B, T_out, n_mel_channels)
|
||||
decoder_inputs = decoder_inputs.transpose(1, 2)
|
||||
decoder_inputs = decoder_inputs.view(
|
||||
decoder_inputs.size(0),
|
||||
int(decoder_inputs.size(1)/self.n_frames_per_step), -1)
|
||||
# (B, T_out, n_mel_channels) -> (T_out, B, n_mel_channels)
|
||||
decoder_inputs = decoder_inputs.transpose(0, 1)
|
||||
return decoder_inputs
|
||||
|
||||
def parse_decoder_outputs(self, mel_outputs, gate_outputs, alignments):
|
||||
""" Prepares decoder outputs for output
|
||||
PARAMS
|
||||
------
|
||||
mel_outputs:
|
||||
gate_outputs: gate output energies
|
||||
alignments:
|
||||
|
||||
RETURNS
|
||||
-------
|
||||
mel_outputs:
|
||||
gate_outpust: gate output energies
|
||||
alignments:
|
||||
"""
|
||||
# (T_out, B) -> (B, T_out)
|
||||
alignments = alignments.transpose(0, 1).contiguous()
|
||||
# (T_out, B) -> (B, T_out)
|
||||
gate_outputs = gate_outputs.transpose(0, 1).contiguous()
|
||||
# (T_out, B, n_mel_channels) -> (B, T_out, n_mel_channels)
|
||||
mel_outputs = mel_outputs.transpose(0, 1).contiguous()
|
||||
# decouple frames per step
|
||||
shape = (mel_outputs.shape[0], -1, self.n_mel_channels)
|
||||
mel_outputs = mel_outputs.view(*shape)
|
||||
# (B, T_out, n_mel_channels) -> (B, n_mel_channels, T_out)
|
||||
mel_outputs = mel_outputs.transpose(1, 2)
|
||||
|
||||
return mel_outputs, gate_outputs, alignments
|
||||
|
||||
def decode(self, decoder_input, attention_hidden, attention_cell,
|
||||
decoder_hidden, decoder_cell, attention_weights,
|
||||
attention_weights_cum, attention_context, memory,
|
||||
processed_memory, mask):
|
||||
""" Decoder step using stored states, attention and memory
|
||||
PARAMS
|
||||
------
|
||||
decoder_input: previous mel output
|
||||
|
||||
RETURNS
|
||||
-------
|
||||
mel_output:
|
||||
gate_output: gate output energies
|
||||
attention_weights:
|
||||
"""
|
||||
cell_input = torch.cat((decoder_input, attention_context), -1)
|
||||
|
||||
attention_hidden, attention_cell = self.attention_rnn(
|
||||
cell_input, (attention_hidden, attention_cell))
|
||||
attention_hidden = F.dropout(
|
||||
attention_hidden, self.p_attention_dropout, self.training)
|
||||
|
||||
attention_weights_cat = torch.cat(
|
||||
(attention_weights.unsqueeze(1),
|
||||
attention_weights_cum.unsqueeze(1)), dim=1)
|
||||
attention_context, attention_weights = self.attention_layer(
|
||||
attention_hidden, memory, processed_memory,
|
||||
attention_weights_cat, mask)
|
||||
|
||||
attention_weights_cum += attention_weights
|
||||
decoder_input = torch.cat(
|
||||
(attention_hidden, attention_context), -1)
|
||||
|
||||
decoder_hidden, decoder_cell = self.decoder_rnn(
|
||||
decoder_input, (decoder_hidden, decoder_cell))
|
||||
decoder_hidden = F.dropout(
|
||||
decoder_hidden, self.p_decoder_dropout, self.training)
|
||||
|
||||
decoder_hidden_attention_context = torch.cat(
|
||||
(decoder_hidden, attention_context), dim=1)
|
||||
decoder_output = self.linear_projection(
|
||||
decoder_hidden_attention_context)
|
||||
|
||||
gate_prediction = self.gate_layer(decoder_hidden_attention_context)
|
||||
|
||||
return (decoder_output, gate_prediction, attention_hidden,
|
||||
attention_cell, decoder_hidden, decoder_cell, attention_weights,
|
||||
attention_weights_cum, attention_context)
|
||||
|
||||
@torch.jit.ignore
|
||||
def forward(self, memory, decoder_inputs, memory_lengths):
|
||||
""" Decoder forward pass for training
|
||||
PARAMS
|
||||
------
|
||||
memory: Encoder outputs
|
||||
decoder_inputs: Decoder inputs for teacher forcing. i.e. mel-specs
|
||||
memory_lengths: Encoder output lengths for attention masking.
|
||||
|
||||
RETURNS
|
||||
-------
|
||||
mel_outputs: mel outputs from the decoder
|
||||
gate_outputs: gate outputs from the decoder
|
||||
alignments: sequence of attention weights from the decoder
|
||||
"""
|
||||
|
||||
decoder_input = self.get_go_frame(memory).unsqueeze(0)
|
||||
decoder_inputs = self.parse_decoder_inputs(decoder_inputs)
|
||||
decoder_inputs = torch.cat((decoder_input, decoder_inputs), dim=0)
|
||||
decoder_inputs = self.prenet(decoder_inputs)
|
||||
|
||||
mask = ~mask_from_lens(memory_lengths)
|
||||
(attention_hidden,
|
||||
attention_cell,
|
||||
decoder_hidden,
|
||||
decoder_cell,
|
||||
attention_weights,
|
||||
attention_weights_cum,
|
||||
attention_context,
|
||||
processed_memory) = self.initialize_decoder_states(memory)
|
||||
|
||||
mel_outputs, gate_outputs, alignments = [], [], []
|
||||
while len(mel_outputs) < decoder_inputs.size(0) - 1:
|
||||
decoder_input = decoder_inputs[len(mel_outputs)]
|
||||
(mel_output,
|
||||
gate_output,
|
||||
attention_hidden,
|
||||
attention_cell,
|
||||
decoder_hidden,
|
||||
decoder_cell,
|
||||
attention_weights,
|
||||
attention_weights_cum,
|
||||
attention_context) = self.decode(decoder_input,
|
||||
attention_hidden,
|
||||
attention_cell,
|
||||
decoder_hidden,
|
||||
decoder_cell,
|
||||
attention_weights,
|
||||
attention_weights_cum,
|
||||
attention_context,
|
||||
memory,
|
||||
processed_memory,
|
||||
mask)
|
||||
|
||||
mel_outputs += [mel_output.squeeze(1)]
|
||||
gate_outputs += [gate_output.squeeze()]
|
||||
alignments += [attention_weights]
|
||||
|
||||
mel_outputs, gate_outputs, alignments = self.parse_decoder_outputs(
|
||||
torch.stack(mel_outputs),
|
||||
torch.stack(gate_outputs),
|
||||
torch.stack(alignments))
|
||||
|
||||
return mel_outputs, gate_outputs, alignments
|
||||
|
||||
@torch.jit.export
|
||||
def infer(self, memory, memory_lengths):
|
||||
""" Decoder inference
|
||||
PARAMS
|
||||
------
|
||||
memory: Encoder outputs
|
||||
|
||||
RETURNS
|
||||
-------
|
||||
mel_outputs: mel outputs from the decoder
|
||||
gate_outputs: gate outputs from the decoder
|
||||
alignments: sequence of attention weights from the decoder
|
||||
"""
|
||||
decoder_input = self.get_go_frame(memory)
|
||||
|
||||
mask = ~mask_from_lens(memory_lengths)
|
||||
(attention_hidden,
|
||||
attention_cell,
|
||||
decoder_hidden,
|
||||
decoder_cell,
|
||||
attention_weights,
|
||||
attention_weights_cum,
|
||||
attention_context,
|
||||
processed_memory) = self.initialize_decoder_states(memory)
|
||||
|
||||
mel_lengths = torch.zeros([memory.size(0)], dtype=torch.int32).cuda()
|
||||
not_finished = torch.ones([memory.size(0)], dtype=torch.int32).cuda()
|
||||
|
||||
mel_outputs, gate_outputs, alignments = (
|
||||
torch.zeros(1), torch.zeros(1), torch.zeros(1))
|
||||
first_iter = True
|
||||
while True:
|
||||
decoder_input = self.prenet(decoder_input)
|
||||
(mel_output,
|
||||
gate_output,
|
||||
attention_hidden,
|
||||
attention_cell,
|
||||
decoder_hidden,
|
||||
decoder_cell,
|
||||
attention_weights,
|
||||
attention_weights_cum,
|
||||
attention_context) = self.decode(decoder_input,
|
||||
attention_hidden,
|
||||
attention_cell,
|
||||
decoder_hidden,
|
||||
decoder_cell,
|
||||
attention_weights,
|
||||
attention_weights_cum,
|
||||
attention_context,
|
||||
memory,
|
||||
processed_memory,
|
||||
mask)
|
||||
|
||||
if first_iter:
|
||||
mel_outputs = mel_output.unsqueeze(0)
|
||||
gate_outputs = gate_output
|
||||
alignments = attention_weights
|
||||
first_iter = False
|
||||
else:
|
||||
mel_outputs = torch.cat(
|
||||
(mel_outputs, mel_output.unsqueeze(0)), dim=0)
|
||||
gate_outputs = torch.cat((gate_outputs, gate_output), dim=0)
|
||||
alignments = torch.cat((alignments, attention_weights), dim=0)
|
||||
|
||||
dec = torch.le(torch.sigmoid(gate_output),
|
||||
self.gate_threshold).to(torch.int32).squeeze(1)
|
||||
|
||||
not_finished = not_finished*dec
|
||||
mel_lengths += not_finished
|
||||
|
||||
if self.early_stopping and torch.sum(not_finished) == 0:
|
||||
break
|
||||
if len(mel_outputs) == self.max_decoder_steps:
|
||||
print("Warning! Reached max decoder steps")
|
||||
break
|
||||
|
||||
decoder_input = mel_output
|
||||
|
||||
# NOTE(Adrian): This makes it consitent with training-time dims
|
||||
# (ML x B) x L --> ML x B x L
|
||||
mel_len, bsz, _ = mel_outputs.size()
|
||||
alignments = alignments.view(mel_len, bsz, -1)
|
||||
|
||||
mel_outputs, gate_outputs, alignments = self.parse_decoder_outputs(
|
||||
mel_outputs, gate_outputs, alignments)
|
||||
|
||||
return mel_outputs, gate_outputs, alignments, mel_lengths
|
||||
|
||||
|
||||
class Tacotron2(nn.Module):
|
||||
def __init__(self, mask_padding, n_mel_channels,
|
||||
n_symbols, symbols_embedding_dim, encoder_kernel_size,
|
||||
encoder_n_convolutions, encoder_embedding_dim,
|
||||
attention_rnn_dim, attention_dim, attention_location_n_filters,
|
||||
attention_location_kernel_size, n_frames_per_step,
|
||||
decoder_rnn_dim, prenet_dim, max_decoder_steps, gate_threshold,
|
||||
p_attention_dropout, p_decoder_dropout,
|
||||
postnet_embedding_dim, postnet_kernel_size,
|
||||
postnet_n_convolutions, decoder_no_early_stopping):
|
||||
super(Tacotron2, self).__init__()
|
||||
self.mask_padding = mask_padding
|
||||
self.n_mel_channels = n_mel_channels
|
||||
self.n_frames_per_step = n_frames_per_step
|
||||
self.embedding = nn.Embedding(n_symbols, symbols_embedding_dim)
|
||||
std = sqrt(2.0 / (n_symbols + symbols_embedding_dim))
|
||||
val = sqrt(3.0) * std # uniform bounds for std
|
||||
self.embedding.weight.data.uniform_(-val, val)
|
||||
self.encoder = Encoder(encoder_n_convolutions,
|
||||
encoder_embedding_dim,
|
||||
encoder_kernel_size)
|
||||
self.decoder = Decoder(n_mel_channels, n_frames_per_step,
|
||||
encoder_embedding_dim, attention_dim,
|
||||
attention_location_n_filters,
|
||||
attention_location_kernel_size,
|
||||
attention_rnn_dim, decoder_rnn_dim,
|
||||
prenet_dim, max_decoder_steps,
|
||||
gate_threshold, p_attention_dropout,
|
||||
p_decoder_dropout,
|
||||
not decoder_no_early_stopping)
|
||||
self.postnet = Postnet(n_mel_channels, postnet_embedding_dim,
|
||||
postnet_kernel_size,
|
||||
postnet_n_convolutions)
|
||||
|
||||
def parse_batch(self, batch):
|
||||
text_padded, input_lengths, mel_padded, gate_padded, \
|
||||
output_lengths = batch
|
||||
text_padded = to_gpu(text_padded).long()
|
||||
input_lengths = to_gpu(input_lengths).long()
|
||||
max_len = torch.max(input_lengths.data).item()
|
||||
mel_padded = to_gpu(mel_padded).float()
|
||||
gate_padded = to_gpu(gate_padded).float()
|
||||
output_lengths = to_gpu(output_lengths).long()
|
||||
|
||||
return (
|
||||
(text_padded, input_lengths, mel_padded, max_len, output_lengths),
|
||||
(mel_padded, gate_padded))
|
||||
|
||||
def parse_output(self, outputs, output_lengths):
|
||||
# type: (List[Tensor], Tensor) -> List[Tensor]
|
||||
if self.mask_padding and output_lengths is not None:
|
||||
mask = ~mask_from_lens(output_lengths)
|
||||
mask = mask.expand(self.n_mel_channels, mask.size(0), mask.size(1))
|
||||
mask = mask.permute(1, 0, 2)
|
||||
|
||||
outputs[0].masked_fill_(mask, 0.0)
|
||||
outputs[1].masked_fill_(mask, 0.0)
|
||||
outputs[2].masked_fill_(mask[:, 0, :], 1e3) # gate energies
|
||||
|
||||
return outputs
|
||||
|
||||
def forward(self, inputs):
|
||||
inputs, input_lengths, targets, max_len, output_lengths = inputs
|
||||
input_lengths, output_lengths = input_lengths.data, output_lengths.data
|
||||
|
||||
embedded_inputs = self.embedding(inputs).transpose(1, 2)
|
||||
|
||||
encoder_outputs = self.encoder(embedded_inputs, input_lengths)
|
||||
|
||||
mel_outputs, gate_outputs, alignments = self.decoder(
|
||||
encoder_outputs, targets, memory_lengths=input_lengths)
|
||||
|
||||
mel_outputs_postnet = self.postnet(mel_outputs)
|
||||
mel_outputs_postnet = mel_outputs + mel_outputs_postnet
|
||||
|
||||
return self.parse_output(
|
||||
[mel_outputs, mel_outputs_postnet, gate_outputs, alignments],
|
||||
output_lengths)
|
||||
|
||||
|
||||
def infer(self, inputs, input_lengths):
|
||||
|
||||
embedded_inputs = self.embedding(inputs).transpose(1, 2)
|
||||
encoder_outputs = self.encoder.infer(embedded_inputs, input_lengths)
|
||||
mel_outputs, gate_outputs, alignments, mel_lengths = self.decoder.infer(
|
||||
encoder_outputs, input_lengths)
|
||||
|
||||
mel_outputs_postnet = self.postnet(mel_outputs)
|
||||
mel_outputs_postnet = mel_outputs + mel_outputs_postnet
|
||||
|
||||
return mel_outputs_postnet, mel_lengths # XXX , alignments
|
560
PyTorch/SpeechSynthesis/FastPitch/train.py
Normal file
560
PyTorch/SpeechSynthesis/FastPitch/train.py
Normal file
|
@ -0,0 +1,560 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
import argparse
|
||||
import copy
|
||||
import json
|
||||
import glob
|
||||
import os
|
||||
import re
|
||||
import time
|
||||
from collections import defaultdict, OrderedDict
|
||||
from contextlib import contextmanager
|
||||
|
||||
import torch
|
||||
import numpy as np
|
||||
import torch.distributed as dist
|
||||
from scipy.io.wavfile import write as write_wav
|
||||
from torch.autograd import Variable
|
||||
from torch.nn.parameter import Parameter
|
||||
from torch.utils.data import DataLoader
|
||||
from torch.utils.data.distributed import DistributedSampler
|
||||
|
||||
import dllogger as DLLogger
|
||||
from apex import amp
|
||||
from apex.optimizers import FusedAdam, FusedLAMB
|
||||
from apex.parallel import DistributedDataParallel as DDP
|
||||
|
||||
import common
|
||||
import data_functions
|
||||
import loss_functions
|
||||
import models
|
||||
from common.log_helper import init_dllogger, TBLogger
|
||||
|
||||
|
||||
def parse_args(parser):
|
||||
"""
|
||||
Parse commandline arguments.
|
||||
"""
|
||||
parser.add_argument('-o', '--output', type=str, required=True,
|
||||
help='Directory to save checkpoints')
|
||||
parser.add_argument('-d', '--dataset-path', type=str, default='./',
|
||||
help='Path to dataset')
|
||||
parser.add_argument('--log-file', type=str, default='nvlog.json',
|
||||
help='Filename for logging')
|
||||
|
||||
training = parser.add_argument_group('training setup')
|
||||
training.add_argument('--epochs', type=int, required=True,
|
||||
help='Number of total epochs to run')
|
||||
training.add_argument('--epochs-per-checkpoint', type=int, default=50,
|
||||
help='Number of epochs per checkpoint')
|
||||
training.add_argument('--checkpoint-path', type=str, default=None,
|
||||
help='Checkpoint path to resume training')
|
||||
training.add_argument('--checkpoint-resume', action='store_true',
|
||||
help='Resume training from the last available checkpoint')
|
||||
training.add_argument('--seed', type=int, default=1234,
|
||||
help='Seed for PyTorch random number generators')
|
||||
training.add_argument('--amp-run', action='store_true',
|
||||
help='Enable AMP')
|
||||
training.add_argument('--cuda', action='store_true',
|
||||
help='Run on GPU using CUDA')
|
||||
training.add_argument('--cudnn-enabled', action='store_true',
|
||||
help='Enable cudnn')
|
||||
training.add_argument('--cudnn-benchmark', action='store_true',
|
||||
help='Run cudnn benchmark')
|
||||
training.add_argument('--ema-decay', type=float, default=0,
|
||||
help='Discounting factor for training weights EMA')
|
||||
training.add_argument('--gradient-accumulation-steps', type=int, default=1,
|
||||
help='Training steps to accumulate gradients for')
|
||||
|
||||
optimization = parser.add_argument_group('optimization setup')
|
||||
optimization.add_argument('--optimizer', type=str, default='lamb',
|
||||
help='Optimization algorithm')
|
||||
optimization.add_argument('-lr', '--learning-rate', type=float, required=True,
|
||||
help='Learing rate')
|
||||
optimization.add_argument('--weight-decay', default=1e-6, type=float,
|
||||
help='Weight decay')
|
||||
optimization.add_argument('--grad-clip-thresh', default=1000.0, type=float,
|
||||
help='Clip threshold for gradients')
|
||||
optimization.add_argument('-bs', '--batch-size', type=int, required=True,
|
||||
help='Batch size per GPU')
|
||||
optimization.add_argument('--warmup-steps', type=int, default=1000,
|
||||
help='Number of steps for lr warmup')
|
||||
optimization.add_argument('--dur-predictor-loss-scale', type=float,
|
||||
default=1.0, help='Rescale duration predictor loss')
|
||||
optimization.add_argument('--pitch-predictor-loss-scale', type=float,
|
||||
default=1.0, help='Rescale pitch predictor loss')
|
||||
|
||||
dataset = parser.add_argument_group('dataset parameters')
|
||||
dataset.add_argument('--training-files', type=str, required=True,
|
||||
help='Path to training filelist')
|
||||
dataset.add_argument('--validation-files', type=str, required=True,
|
||||
help='Path to validation filelist')
|
||||
dataset.add_argument('--pitch-mean-std-file', type=str, default=None,
|
||||
help='Path to pitch stats to be stored in the model')
|
||||
dataset.add_argument('--text-cleaners', nargs='*',
|
||||
default=['english_cleaners'], type=str,
|
||||
help='Type of text cleaners for input text')
|
||||
|
||||
distributed = parser.add_argument_group('distributed setup')
|
||||
distributed.add_argument('--rank', default=0, type=int,
|
||||
help='Rank of the process for multiproc. Do not set manually.')
|
||||
distributed.add_argument('--world-size', default=1, type=int,
|
||||
help='Number of processes for multiproc. Do not set manually.')
|
||||
distributed.add_argument('--dist-url', type=str, default='tcp://localhost:23456',
|
||||
help='Url used to set up distributed training')
|
||||
distributed.add_argument('--group-name', type=str, default='group_name',
|
||||
required=False, help='Distributed group name')
|
||||
distributed.add_argument('--dist-backend', default='nccl', type=str, choices={'nccl'},
|
||||
help='Distributed run backend')
|
||||
return parser
|
||||
|
||||
|
||||
def reduce_tensor(tensor, num_gpus):
|
||||
rt = tensor.clone()
|
||||
dist.all_reduce(rt, op=dist.ReduceOp.SUM)
|
||||
rt /= num_gpus
|
||||
return rt
|
||||
|
||||
|
||||
def init_distributed(args, world_size, rank, group_name):
|
||||
assert torch.cuda.is_available(), "Distributed mode requires CUDA."
|
||||
print("Initializing distributed training")
|
||||
|
||||
# Set cuda device so everything is done on the right GPU.
|
||||
torch.cuda.set_device(rank % torch.cuda.device_count())
|
||||
|
||||
# Initialize distributed communication
|
||||
dist.init_process_group(
|
||||
backend=args.dist_backend, init_method=args.dist_url,
|
||||
world_size=world_size, rank=rank, group_name=group_name)
|
||||
print("Done initializing distributed training")
|
||||
|
||||
|
||||
def last_checkpoint(output):
|
||||
|
||||
def corrupted(fpath):
|
||||
try:
|
||||
torch.load(fpath, map_location='cpu')
|
||||
return False
|
||||
except:
|
||||
print(f'WARNING: Cannot load {fpath}')
|
||||
return True
|
||||
|
||||
saved = sorted(
|
||||
glob.glob(f'{output}/FastPitch_checkpoint_*.pt'),
|
||||
key=lambda f: int(re.search('_(\d+).pt', f).group(1)))
|
||||
|
||||
if len(saved) >= 1 and not corrupted(saved[-1]):
|
||||
return saved[-1]
|
||||
elif len(saved) >= 2:
|
||||
return saved[-2]
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def save_checkpoint(local_rank, model, ema_model, optimizer, epoch, config,
|
||||
amp_run, filepath):
|
||||
if local_rank != 0:
|
||||
return
|
||||
print(f"Saving model and optimizer state at epoch {epoch} to {filepath}")
|
||||
ema_dict = None if ema_model is None else ema_model.state_dict()
|
||||
checkpoint = {'epoch': epoch,
|
||||
'config': config,
|
||||
'state_dict': model.state_dict(),
|
||||
'ema_state_dict': ema_dict,
|
||||
'optimizer': optimizer.state_dict()}
|
||||
if amp_run:
|
||||
checkpoint['amp'] = amp.state_dict()
|
||||
torch.save(checkpoint, filepath)
|
||||
|
||||
|
||||
def load_checkpoint(local_rank, model, ema_model, optimizer, epoch, config,
|
||||
amp_run, filepath, world_size):
|
||||
if local_rank == 0:
|
||||
print(f'Loading model and optimizer state from {filepath}')
|
||||
checkpoint = torch.load(filepath, map_location='cpu')
|
||||
epoch[0] = checkpoint['epoch'] + 1
|
||||
config = checkpoint['config']
|
||||
|
||||
sd = {k.replace('module.', ''): v
|
||||
for k, v in checkpoint['state_dict'].items()}
|
||||
getattr(model, 'module', model).load_state_dict(sd)
|
||||
optimizer.load_state_dict(checkpoint['optimizer'])
|
||||
|
||||
if amp_run:
|
||||
amp.load_state_dict(checkpoint['amp'])
|
||||
|
||||
if ema_model is not None:
|
||||
ema_model.load_state_dict(checkpoint['ema_state_dict'])
|
||||
|
||||
|
||||
def validate(model, criterion, valset, batch_size, world_size, collate_fn,
|
||||
distributed_run, rank, batch_to_gpu, use_gt_durations=False):
|
||||
"""Handles all the validation scoring and printing"""
|
||||
was_training = model.training
|
||||
model.eval()
|
||||
with torch.no_grad():
|
||||
val_sampler = DistributedSampler(valset) if distributed_run else None
|
||||
val_loader = DataLoader(valset, num_workers=8, shuffle=False,
|
||||
sampler=val_sampler,
|
||||
batch_size=batch_size, pin_memory=False,
|
||||
collate_fn=collate_fn)
|
||||
val_meta = defaultdict(float)
|
||||
val_num_frames = 0
|
||||
for i, batch in enumerate(val_loader):
|
||||
x, y, num_frames = batch_to_gpu(batch)
|
||||
y_pred = model(x, use_gt_durations=use_gt_durations)
|
||||
loss, meta = criterion(y_pred, y, is_training=False, meta_agg='sum')
|
||||
if distributed_run:
|
||||
for k,v in meta.items():
|
||||
val_meta[k] += reduce_tensor(v, 1)
|
||||
val_num_frames += reduce_tensor(num_frames.data, 1).item()
|
||||
else:
|
||||
for k,v in meta.items():
|
||||
val_meta[k] += v
|
||||
val_num_frames = num_frames.item()
|
||||
val_meta = {k: v / len(valset) for k,v in val_meta.items()}
|
||||
val_loss = val_meta['loss']
|
||||
|
||||
if was_training:
|
||||
model.train()
|
||||
return val_loss.item(), val_meta, val_num_frames
|
||||
|
||||
|
||||
def adjust_learning_rate(total_iter, opt, learning_rate, warmup_iters=None):
|
||||
if warmup_iters == 0:
|
||||
scale = 1.0
|
||||
elif total_iter > warmup_iters:
|
||||
scale = 1. / (total_iter ** 0.5)
|
||||
else:
|
||||
scale = total_iter / (warmup_iters ** 1.5)
|
||||
|
||||
for param_group in opt.param_groups:
|
||||
param_group['lr'] = learning_rate * scale
|
||||
|
||||
|
||||
def apply_ema_decay(model, ema_model, decay):
|
||||
if not decay:
|
||||
return
|
||||
st = model.state_dict()
|
||||
add_module = hasattr(model, 'module') and not hasattr(ema_model, 'module')
|
||||
for k,v in ema_model.state_dict().items():
|
||||
if add_module and not k.startswith('module.'):
|
||||
k = 'module.' + k
|
||||
v.copy_(decay * v + (1 - decay) * st[k])
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description='PyTorch FastPitch Training',
|
||||
allow_abbrev=False)
|
||||
parser = parse_args(parser)
|
||||
args, _ = parser.parse_known_args()
|
||||
|
||||
if 'LOCAL_RANK' in os.environ and 'WORLD_SIZE' in os.environ:
|
||||
local_rank = int(os.environ['LOCAL_RANK'])
|
||||
world_size = int(os.environ['WORLD_SIZE'])
|
||||
else:
|
||||
local_rank = args.rank
|
||||
world_size = args.world_size
|
||||
distributed_run = world_size > 1
|
||||
|
||||
torch.manual_seed(args.seed + local_rank)
|
||||
np.random.seed(args.seed + local_rank)
|
||||
|
||||
if local_rank == 0:
|
||||
if not os.path.exists(args.output):
|
||||
os.makedirs(args.output)
|
||||
init_dllogger(args.log_file)
|
||||
else:
|
||||
init_dllogger(dummy=True)
|
||||
|
||||
for k,v in vars(args).items():
|
||||
DLLogger.log(step="PARAMETER", data={k:v})
|
||||
|
||||
parser = models.parse_model_args('FastPitch', parser)
|
||||
args, unk_args = parser.parse_known_args()
|
||||
if len(unk_args) > 0:
|
||||
raise ValueError(f'Invalid options {unk_args}')
|
||||
|
||||
torch.backends.cudnn.enabled = args.cudnn_enabled
|
||||
torch.backends.cudnn.benchmark = args.cudnn_benchmark
|
||||
|
||||
if distributed_run:
|
||||
init_distributed(args, world_size, local_rank, args.group_name)
|
||||
|
||||
device = torch.device('cuda' if args.cuda else 'cpu')
|
||||
model_config = models.get_model_config('FastPitch', args)
|
||||
model = models.get_model('FastPitch', model_config, device)
|
||||
|
||||
# Store pitch mean/std as params to translate from Hz during inference
|
||||
fpath = common.utils.stats_filename(
|
||||
args.dataset_path, args.training_files, 'pitch_char')
|
||||
with open(args.pitch_mean_std_file, 'r') as f:
|
||||
stats = json.load(f)
|
||||
model.pitch_mean[0] = stats['mean']
|
||||
model.pitch_std[0] = stats['std']
|
||||
|
||||
kw = dict(lr=args.learning_rate, betas=(0.9, 0.98), eps=1e-9,
|
||||
weight_decay=args.weight_decay)
|
||||
if args.optimizer == 'adam':
|
||||
optimizer = FusedAdam(model.parameters(), **kw)
|
||||
elif args.optimizer == 'lamb':
|
||||
optimizer = FusedLAMB(model.parameters(), **kw)
|
||||
else:
|
||||
raise ValueError
|
||||
|
||||
if args.amp_run:
|
||||
model, optimizer = amp.initialize(model, optimizer, opt_level="O1")
|
||||
|
||||
if args.ema_decay > 0:
|
||||
ema_model = copy.deepcopy(model)
|
||||
else:
|
||||
ema_model = None
|
||||
|
||||
if distributed_run:
|
||||
model = DDP(model)
|
||||
|
||||
start_epoch = [1]
|
||||
|
||||
assert args.checkpoint_path is None or args.checkpoint_resume is False, (
|
||||
"Specify a single checkpoint source")
|
||||
if args.checkpoint_path is not None:
|
||||
ch_fpath = args.checkpoint_path
|
||||
elif args.checkpoint_resume:
|
||||
ch_fpath = last_checkpoint(args.output)
|
||||
else:
|
||||
ch_fpath = None
|
||||
|
||||
if ch_fpath is not None:
|
||||
load_checkpoint(local_rank, model, ema_model, optimizer, start_epoch,
|
||||
model_config, args.amp_run, ch_fpath, world_size)
|
||||
|
||||
start_epoch = start_epoch[0]
|
||||
|
||||
criterion = loss_functions.get_loss_function('FastPitch',
|
||||
dur_predictor_loss_scale=args.dur_predictor_loss_scale,
|
||||
pitch_predictor_loss_scale=args.pitch_predictor_loss_scale)
|
||||
|
||||
collate_fn = data_functions.get_collate_function('FastPitch')
|
||||
trainset = data_functions.get_data_loader('FastPitch', args.dataset_path,
|
||||
args.training_files, args)
|
||||
valset = data_functions.get_data_loader('FastPitch', args.dataset_path,
|
||||
args.validation_files, args)
|
||||
if distributed_run:
|
||||
train_sampler, shuffle = DistributedSampler(trainset), False
|
||||
else:
|
||||
train_sampler, shuffle = None, True
|
||||
|
||||
train_loader = DataLoader(trainset, num_workers=16, shuffle=shuffle,
|
||||
sampler=train_sampler, batch_size=args.batch_size,
|
||||
pin_memory=False, drop_last=True,
|
||||
collate_fn=collate_fn)
|
||||
|
||||
batch_to_gpu = data_functions.get_batch_to_gpu('FastPitch')
|
||||
|
||||
model.train()
|
||||
|
||||
train_tblogger = TBLogger(local_rank, args.output, 'train')
|
||||
val_tblogger = TBLogger(local_rank, args.output, 'val', dummies=True)
|
||||
if args.ema_decay > 0:
|
||||
val_ema_tblogger = TBLogger(local_rank, args.output, 'val_ema')
|
||||
|
||||
val_loss = 0.0
|
||||
total_iter = 0
|
||||
torch.cuda.synchronize()
|
||||
for epoch in range(start_epoch, args.epochs + 1):
|
||||
epoch_start_time = time.time()
|
||||
|
||||
epoch_loss = 0.0
|
||||
epoch_mel_loss = 0.0
|
||||
epoch_num_frames = 0
|
||||
epoch_frames_per_sec = 0.0
|
||||
|
||||
if distributed_run:
|
||||
train_loader.sampler.set_epoch(epoch)
|
||||
|
||||
accumulated_steps = 0
|
||||
iter_loss = 0
|
||||
iter_num_frames = 0
|
||||
iter_meta = {}
|
||||
|
||||
epoch_iter = 0
|
||||
num_iters = len(train_loader) // args.gradient_accumulation_steps
|
||||
for batch in train_loader:
|
||||
if accumulated_steps == 0:
|
||||
if epoch_iter == num_iters:
|
||||
break
|
||||
total_iter += 1
|
||||
epoch_iter += 1
|
||||
iter_start_time = time.time()
|
||||
start = time.perf_counter()
|
||||
|
||||
old_lr = optimizer.param_groups[0]['lr']
|
||||
adjust_learning_rate(total_iter, optimizer, args.learning_rate,
|
||||
args.warmup_steps)
|
||||
new_lr = optimizer.param_groups[0]['lr']
|
||||
|
||||
if new_lr != old_lr:
|
||||
dllog_lrate_change = f'{old_lr:.2E} -> {new_lr:.2E}'
|
||||
train_tblogger.log_value(total_iter, 'lrate', new_lr)
|
||||
else:
|
||||
dllog_lrate_change = None
|
||||
|
||||
model.zero_grad()
|
||||
|
||||
x, y, num_frames = batch_to_gpu(batch)
|
||||
y_pred = model(x, use_gt_durations=True)
|
||||
loss, meta = criterion(y_pred, y)
|
||||
|
||||
loss /= args.gradient_accumulation_steps
|
||||
meta = {k: v / args.gradient_accumulation_steps
|
||||
for k, v in meta.items()}
|
||||
|
||||
if args.amp_run:
|
||||
with amp.scale_loss(loss, optimizer) as scaled_loss:
|
||||
scaled_loss.backward()
|
||||
else:
|
||||
loss.backward()
|
||||
|
||||
if distributed_run:
|
||||
reduced_loss = reduce_tensor(loss.data, world_size).item()
|
||||
reduced_num_frames = reduce_tensor(num_frames.data, 1).item()
|
||||
meta = {k: reduce_tensor(v, world_size) for k,v in meta.items()}
|
||||
else:
|
||||
reduced_loss = loss.item()
|
||||
reduced_num_frames = num_frames.item()
|
||||
if np.isnan(reduced_loss):
|
||||
raise Exception("loss is NaN")
|
||||
|
||||
accumulated_steps += 1
|
||||
iter_loss += reduced_loss
|
||||
iter_num_frames += reduced_num_frames
|
||||
iter_meta = {k: iter_meta.get(k, 0) + meta.get(k, 0) for k in meta}
|
||||
|
||||
if accumulated_steps % args.gradient_accumulation_steps == 0:
|
||||
|
||||
train_tblogger.log_grads(total_iter, model)
|
||||
if args.amp_run:
|
||||
torch.nn.utils.clip_grad_norm_(
|
||||
amp.master_params(optimizer), args.grad_clip_thresh)
|
||||
else:
|
||||
torch.nn.utils.clip_grad_norm_(
|
||||
model.parameters(), args.grad_clip_thresh)
|
||||
|
||||
optimizer.step()
|
||||
apply_ema_decay(model, ema_model, args.ema_decay)
|
||||
|
||||
iter_stop_time = time.time()
|
||||
iter_time = iter_stop_time - iter_start_time
|
||||
frames_per_sec = iter_num_frames / iter_time
|
||||
epoch_frames_per_sec += frames_per_sec
|
||||
epoch_loss += iter_loss
|
||||
epoch_num_frames += iter_num_frames
|
||||
iter_mel_loss = iter_meta['mel_loss'].item()
|
||||
epoch_mel_loss += iter_mel_loss
|
||||
|
||||
DLLogger.log((epoch, epoch_iter, num_iters), OrderedDict([
|
||||
('train_loss', iter_loss), ('train_mel_loss', iter_mel_loss),
|
||||
('train_frames/s', frames_per_sec), ('took', iter_time),
|
||||
('lrate_change', dllog_lrate_change)
|
||||
]))
|
||||
train_tblogger.log_meta(total_iter, iter_meta)
|
||||
|
||||
accumulated_steps = 0
|
||||
iter_loss = 0
|
||||
iter_num_frames = 0
|
||||
iter_meta = {}
|
||||
|
||||
# Finished epoch
|
||||
epoch_stop_time = time.time()
|
||||
epoch_time = epoch_stop_time - epoch_start_time
|
||||
|
||||
DLLogger.log((epoch,), data=OrderedDict([
|
||||
('avg_train_loss', epoch_loss / epoch_iter),
|
||||
('avg_train_mel_loss', epoch_mel_loss / epoch_iter),
|
||||
('avg_train_frames/s', epoch_num_frames / epoch_time),
|
||||
('took', epoch_time)
|
||||
]))
|
||||
|
||||
tik = time.time()
|
||||
val_loss, meta, num_frames = validate(
|
||||
model, criterion, valset, args.batch_size, world_size, collate_fn,
|
||||
distributed_run, local_rank, batch_to_gpu, use_gt_durations=True)
|
||||
tok = time.time()
|
||||
|
||||
DLLogger.log((epoch,), data=OrderedDict([
|
||||
('val_loss', val_loss),
|
||||
('val_mel_loss', meta['mel_loss'].item()),
|
||||
('val_frames/s', num_frames / (tok - tik)),
|
||||
('took', tok - tik),
|
||||
]))
|
||||
val_tblogger.log_meta(total_iter, meta)
|
||||
|
||||
if args.ema_decay > 0:
|
||||
tik_e = time.time()
|
||||
val_loss_e, meta_e, num_frames_e = validate(
|
||||
ema_model, criterion, valset, args.batch_size, world_size,
|
||||
collate_fn, distributed_run, local_rank, batch_to_gpu,
|
||||
use_gt_durations=True)
|
||||
tok_e = time.time()
|
||||
|
||||
DLLogger.log((epoch,), data=OrderedDict([
|
||||
('val_ema_loss', val_loss_e),
|
||||
('val_ema_mel_loss', meta_e['mel_loss'].item()),
|
||||
('val_ema_frames/s', num_frames_e / (tok_e - tik_e)),
|
||||
('took', tok_e - tik_e),
|
||||
]))
|
||||
val_ema_tblogger.log_meta(total_iter, meta)
|
||||
|
||||
if (epoch > 0 and args.epochs_per_checkpoint > 0 and
|
||||
(epoch % args.epochs_per_checkpoint == 0) and local_rank == 0):
|
||||
|
||||
checkpoint_path = os.path.join(
|
||||
args.output, f"FastPitch_checkpoint_{epoch}.pt")
|
||||
save_checkpoint(local_rank, model, ema_model, optimizer, epoch,
|
||||
model_config, args.amp_run, checkpoint_path)
|
||||
if local_rank == 0:
|
||||
DLLogger.flush()
|
||||
|
||||
# Finished training
|
||||
DLLogger.log((), data=OrderedDict([
|
||||
('avg_train_loss', epoch_loss / epoch_iter),
|
||||
('avg_train_mel_loss', epoch_mel_loss / epoch_iter),
|
||||
('avg_train_frames/s', epoch_num_frames / epoch_time),
|
||||
]))
|
||||
DLLogger.log((), data=OrderedDict([
|
||||
('val_loss', val_loss),
|
||||
('val_mel_loss', meta['mel_loss'].item()),
|
||||
('val_frames/s', num_frames / (tok - tik)),
|
||||
]))
|
||||
if local_rank == 0:
|
||||
DLLogger.flush()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
65
PyTorch/SpeechSynthesis/FastPitch/waveglow/arg_parser.py
Normal file
65
PyTorch/SpeechSynthesis/FastPitch/waveglow/arg_parser.py
Normal file
|
@ -0,0 +1,65 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
import argparse
|
||||
|
||||
def parse_waveglow_args(parent, add_help=False):
|
||||
"""
|
||||
Parse commandline arguments.
|
||||
"""
|
||||
parser = argparse.ArgumentParser(parents=[parent], add_help=add_help, allow_abbrev=False)
|
||||
|
||||
# misc parameters
|
||||
parser.add_argument('--n-mel-channels', default=80, type=int,
|
||||
help='Number of bins in mel-spectrograms')
|
||||
|
||||
# glow parameters
|
||||
parser.add_argument('--flows', default=12, type=int,
|
||||
help='Number of steps of flow')
|
||||
parser.add_argument('--groups', default=8, type=int,
|
||||
help='Number of samples in a group processed by the steps of flow')
|
||||
parser.add_argument('--early-every', default=4, type=int,
|
||||
help='Determines how often (i.e., after how many coupling layers) \
|
||||
a number of channels (defined by --early-size parameter) are output\
|
||||
to the loss function')
|
||||
parser.add_argument('--early-size', default=2, type=int,
|
||||
help='Number of channels output to the loss function')
|
||||
parser.add_argument('--sigma', default=1.0, type=float,
|
||||
help='Standard deviation used for sampling from Gaussian')
|
||||
parser.add_argument('--segment-length', default=4000, type=int,
|
||||
help='Segment length (audio samples) processed per iteration')
|
||||
|
||||
# wavenet parameters
|
||||
wavenet = parser.add_argument_group('WaveNet parameters')
|
||||
wavenet.add_argument('--wn-kernel-size', default=3, type=int,
|
||||
help='Kernel size for dialted convolution in the affine coupling layer (WN)')
|
||||
wavenet.add_argument('--wn-channels', default=512, type=int,
|
||||
help='Number of channels in WN')
|
||||
wavenet.add_argument('--wn-layers', default=8, type=int,
|
||||
help='Number of layers in WN')
|
||||
|
||||
return parser
|
88
PyTorch/SpeechSynthesis/FastPitch/waveglow/data_function.py
Normal file
88
PyTorch/SpeechSynthesis/FastPitch/waveglow/data_function.py
Normal file
|
@ -0,0 +1,88 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************\
|
||||
|
||||
import torch
|
||||
import random
|
||||
import common.layers as layers
|
||||
from common.utils import load_wav_to_torch, load_filepaths_and_text, to_gpu
|
||||
|
||||
|
||||
class MelAudioLoader(torch.utils.data.Dataset):
|
||||
"""
|
||||
1) loads audio,text pairs
|
||||
2) computes mel-spectrograms from audio files.
|
||||
"""
|
||||
|
||||
def __init__(self, dataset_path, audiopaths_and_text, args):
|
||||
self.audiopaths_and_text = load_filepaths_and_text(dataset_path, audiopaths_and_text)
|
||||
self.max_wav_value = args.max_wav_value
|
||||
self.sampling_rate = args.sampling_rate
|
||||
self.stft = layers.TacotronSTFT(
|
||||
args.filter_length, args.hop_length, args.win_length,
|
||||
args.n_mel_channels, args.sampling_rate, args.mel_fmin,
|
||||
args.mel_fmax)
|
||||
self.segment_length = args.segment_length
|
||||
random.seed(1234)
|
||||
random.shuffle(self.audiopaths_and_text)
|
||||
|
||||
def get_mel_audio_pair(self, filename):
|
||||
audio, sampling_rate = load_wav_to_torch(filename)
|
||||
|
||||
if sampling_rate != self.stft.sampling_rate:
|
||||
raise ValueError("{} {} SR doesn't match target {} SR".format(
|
||||
sampling_rate, self.stft.sampling_rate))
|
||||
|
||||
# Take segment
|
||||
if audio.size(0) >= self.segment_length:
|
||||
max_audio_start = audio.size(0) - self.segment_length
|
||||
audio_start = random.randint(0, max_audio_start)
|
||||
audio = audio[audio_start:audio_start+self.segment_length]
|
||||
else:
|
||||
audio = torch.nn.functional.pad(
|
||||
audio, (0, self.segment_length - audio.size(0)), 'constant').data
|
||||
|
||||
audio = audio / self.max_wav_value
|
||||
audio_norm = audio.unsqueeze(0)
|
||||
audio_norm = torch.autograd.Variable(audio_norm, requires_grad=False)
|
||||
melspec = self.stft.mel_spectrogram(audio_norm)
|
||||
melspec = melspec.squeeze(0)
|
||||
|
||||
return (melspec, audio, len(audio))
|
||||
|
||||
def __getitem__(self, index):
|
||||
return self.get_mel_audio_pair(self.audiopaths_and_text[index][0])
|
||||
|
||||
def __len__(self):
|
||||
return len(self.audiopaths_and_text)
|
||||
|
||||
|
||||
def batch_to_gpu(batch):
|
||||
x, y, len_y = batch
|
||||
x = to_gpu(x).float()
|
||||
y = to_gpu(y).float()
|
||||
len_y = to_gpu(torch.sum(len_y))
|
||||
return ((x, y), y, len_y)
|
68
PyTorch/SpeechSynthesis/FastPitch/waveglow/denoiser.py
Normal file
68
PyTorch/SpeechSynthesis/FastPitch/waveglow/denoiser.py
Normal file
|
@ -0,0 +1,68 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
import sys
|
||||
sys.path.append('tacotron2')
|
||||
import torch
|
||||
from common.layers import STFT
|
||||
|
||||
|
||||
class Denoiser(torch.nn.Module):
|
||||
""" Removes model bias from audio produced with waveglow """
|
||||
|
||||
def __init__(self, waveglow, filter_length=1024, n_overlap=4,
|
||||
win_length=1024, mode='zeros'):
|
||||
super(Denoiser, self).__init__()
|
||||
device = next(waveglow.parameters()).device
|
||||
self.stft = STFT(filter_length=filter_length,
|
||||
hop_length=int(filter_length/n_overlap),
|
||||
win_length=win_length).to(device)
|
||||
if mode == 'zeros':
|
||||
mel_input = torch.zeros(
|
||||
(1, 80, 88),
|
||||
dtype=waveglow.upsample.weight.dtype,
|
||||
device=waveglow.upsample.weight.device)
|
||||
elif mode == 'normal':
|
||||
mel_input = torch.randn(
|
||||
(1, 80, 88),
|
||||
dtype=waveglow.upsample.weight.dtype,
|
||||
device=waveglow.upsample.weight.device)
|
||||
else:
|
||||
raise Exception("Mode {} if not supported".format(mode))
|
||||
|
||||
with torch.no_grad():
|
||||
bias_audio = waveglow.infer(mel_input, sigma=0.0).float()
|
||||
bias_spec, _ = self.stft.transform(bias_audio)
|
||||
|
||||
self.register_buffer('bias_spec', bias_spec[:, :, 0][:, :, None])
|
||||
|
||||
def forward(self, audio, strength=0.1):
|
||||
audio_spec, audio_angles = self.stft.transform(audio.float())
|
||||
audio_spec_denoised = audio_spec - self.bias_spec * strength
|
||||
audio_spec_denoised = torch.clamp(audio_spec_denoised, 0.0)
|
||||
audio_denoised = self.stft.inverse(audio_spec_denoised, audio_angles)
|
||||
return audio_denoised
|
49
PyTorch/SpeechSynthesis/FastPitch/waveglow/loss_function.py
Normal file
49
PyTorch/SpeechSynthesis/FastPitch/waveglow/loss_function.py
Normal file
|
@ -0,0 +1,49 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
import torch
|
||||
|
||||
class WaveGlowLoss(torch.nn.Module):
|
||||
def __init__(self, sigma=1.0):
|
||||
super(WaveGlowLoss, self).__init__()
|
||||
self.sigma = sigma
|
||||
|
||||
def forward(self, model_output, clean_audio):
|
||||
# clean_audio is unused;
|
||||
z, log_s_list, log_det_W_list = model_output
|
||||
for i, log_s in enumerate(log_s_list):
|
||||
if i == 0:
|
||||
log_s_total = torch.sum(log_s)
|
||||
log_det_W_total = log_det_W_list[i]
|
||||
else:
|
||||
log_s_total = log_s_total + torch.sum(log_s)
|
||||
log_det_W_total += log_det_W_list[i]
|
||||
|
||||
loss = torch.sum(
|
||||
z * z) / (2 * self.sigma * self.sigma) - log_s_total - log_det_W_total # noqa: E501
|
||||
meta = {}
|
||||
return loss / (z.size(0) * z.size(1) * z.size(2)), meta
|
285
PyTorch/SpeechSynthesis/FastPitch/waveglow/model.py
Normal file
285
PyTorch/SpeechSynthesis/FastPitch/waveglow/model.py
Normal file
|
@ -0,0 +1,285 @@
|
|||
# *****************************************************************************
|
||||
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the NVIDIA CORPORATION nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# *****************************************************************************
|
||||
import torch
|
||||
from torch.autograd import Variable
|
||||
import torch.nn.functional as F
|
||||
|
||||
|
||||
@torch.jit.script
|
||||
def fused_add_tanh_sigmoid_multiply(input_a, input_b, n_channels):
|
||||
n_channels_int = n_channels[0]
|
||||
in_act = input_a + input_b
|
||||
t_act = torch.tanh(in_act[:, :n_channels_int, :])
|
||||
s_act = torch.sigmoid(in_act[:, n_channels_int:, :])
|
||||
acts = t_act * s_act
|
||||
return acts
|
||||
|
||||
|
||||
class Invertible1x1Conv(torch.nn.Module):
|
||||
"""
|
||||
The layer outputs both the convolution, and the log determinant
|
||||
of its weight matrix. If reverse=True it does convolution with
|
||||
inverse
|
||||
"""
|
||||
def __init__(self, c):
|
||||
super(Invertible1x1Conv, self).__init__()
|
||||
self.conv = torch.nn.Conv1d(c, c, kernel_size=1, stride=1, padding=0,
|
||||
bias=False)
|
||||
|
||||
# Sample a random orthonormal matrix to initialize weights
|
||||
W = torch.qr(torch.FloatTensor(c, c).normal_())[0]
|
||||
|
||||
# Ensure determinant is 1.0 not -1.0
|
||||
if torch.det(W) < 0:
|
||||
W[:, 0] = -1 * W[:, 0]
|
||||
W = W.view(c, c, 1)
|
||||
self.conv.weight.data = W
|
||||
|
||||
def forward(self, z, reverse=False):
|
||||
# shape
|
||||
batch_size, group_size, n_of_groups = z.size()
|
||||
|
||||
W = self.conv.weight.squeeze()
|
||||
|
||||
if reverse:
|
||||
if not hasattr(self, 'W_inverse'):
|
||||
# Reverse computation
|
||||
W_inverse = W.float().inverse()
|
||||
W_inverse = Variable(W_inverse[..., None])
|
||||
if z.type() == 'torch.cuda.HalfTensor' or z.type() == 'torch.HalfTensor':
|
||||
W_inverse = W_inverse.half()
|
||||
self.W_inverse = W_inverse
|
||||
z = F.conv1d(z, self.W_inverse, bias=None, stride=1, padding=0)
|
||||
return z
|
||||
else:
|
||||
# Forward computation
|
||||
log_det_W = batch_size * n_of_groups * torch.logdet(W.unsqueeze(0).float()).squeeze()
|
||||
z = self.conv(z)
|
||||
return z, log_det_W
|
||||
|
||||
|
||||
class WN(torch.nn.Module):
|
||||
"""
|
||||
This is the WaveNet like layer for the affine coupling. The primary difference
|
||||
from WaveNet is the convolutions need not be causal. There is also no dilation
|
||||
size reset. The dilation only doubles on each layer
|
||||
"""
|
||||
def __init__(self, n_in_channels, n_mel_channels, n_layers, n_channels,
|
||||
kernel_size):
|
||||
super(WN, self).__init__()
|
||||
assert(kernel_size % 2 == 1)
|
||||
assert(n_channels % 2 == 0)
|
||||
self.n_layers = n_layers
|
||||
self.n_channels = n_channels
|
||||
self.in_layers = torch.nn.ModuleList()
|
||||
self.res_skip_layers = torch.nn.ModuleList()
|
||||
|
||||
start = torch.nn.Conv1d(n_in_channels, n_channels, 1)
|
||||
start = torch.nn.utils.weight_norm(start, name='weight')
|
||||
self.start = start
|
||||
|
||||
# Initializing last layer to 0 makes the affine coupling layers
|
||||
# do nothing at first. This helps with training stability
|
||||
end = torch.nn.Conv1d(n_channels, 2*n_in_channels, 1)
|
||||
end.weight.data.zero_()
|
||||
end.bias.data.zero_()
|
||||
self.end = end
|
||||
|
||||
cond_layer = torch.nn.Conv1d(n_mel_channels, 2*n_channels*n_layers, 1)
|
||||
self.cond_layer = torch.nn.utils.weight_norm(cond_layer, name='weight')
|
||||
|
||||
for i in range(n_layers):
|
||||
dilation = 2 ** i
|
||||
padding = int((kernel_size*dilation - dilation)/2)
|
||||
in_layer = torch.nn.Conv1d(n_channels, 2*n_channels, kernel_size,
|
||||
dilation=dilation, padding=padding)
|
||||
in_layer = torch.nn.utils.weight_norm(in_layer, name='weight')
|
||||
self.in_layers.append(in_layer)
|
||||
|
||||
|
||||
# last one is not necessary
|
||||
if i < n_layers - 1:
|
||||
res_skip_channels = 2*n_channels
|
||||
else:
|
||||
res_skip_channels = n_channels
|
||||
res_skip_layer = torch.nn.Conv1d(n_channels, res_skip_channels, 1)
|
||||
res_skip_layer = torch.nn.utils.weight_norm(res_skip_layer, name='weight')
|
||||
self.res_skip_layers.append(res_skip_layer)
|
||||
|
||||
def forward(self, forward_input):
|
||||
audio, spect = forward_input
|
||||
audio = self.start(audio)
|
||||
output = torch.zeros_like(audio)
|
||||
n_channels_tensor = torch.IntTensor([self.n_channels])
|
||||
|
||||
spect = self.cond_layer(spect)
|
||||
spect_list = torch.chunk(spect, self.n_layers, 1)
|
||||
|
||||
for i in range(self.n_layers):
|
||||
spect_offset = i*2*self.n_channels
|
||||
acts = fused_add_tanh_sigmoid_multiply(
|
||||
self.in_layers[i](audio), spect_list[i], n_channels_tensor)
|
||||
|
||||
res_skip_acts = self.res_skip_layers[i](acts)
|
||||
if i < self.n_layers - 1:
|
||||
audio = audio + res_skip_acts[:,:self.n_channels,:]
|
||||
output = output + res_skip_acts[:,self.n_channels:,:]
|
||||
else:
|
||||
output = output + res_skip_acts
|
||||
|
||||
return self.end(output)
|
||||
|
||||
|
||||
class WaveGlow(torch.nn.Module):
|
||||
def __init__(self, n_mel_channels, n_flows, n_group, n_early_every,
|
||||
n_early_size, WN_config):
|
||||
super(WaveGlow, self).__init__()
|
||||
|
||||
self.upsample = torch.nn.ConvTranspose1d(n_mel_channels,
|
||||
n_mel_channels,
|
||||
1024, stride=256)
|
||||
assert(n_group % 2 == 0)
|
||||
self.n_flows = n_flows
|
||||
self.n_group = n_group
|
||||
self.n_early_every = n_early_every
|
||||
self.n_early_size = n_early_size
|
||||
self.WN = torch.nn.ModuleList()
|
||||
self.convinv = torch.nn.ModuleList()
|
||||
|
||||
n_half = int(n_group/2)
|
||||
|
||||
# Set up layers with the right sizes based on how many dimensions
|
||||
# have been output already
|
||||
n_remaining_channels = n_group
|
||||
for k in range(n_flows):
|
||||
if k % self.n_early_every == 0 and k > 0:
|
||||
n_half = n_half - int(self.n_early_size/2)
|
||||
n_remaining_channels = n_remaining_channels - self.n_early_size
|
||||
self.convinv.append(Invertible1x1Conv(n_remaining_channels))
|
||||
self.WN.append(WN(n_half, n_mel_channels*n_group, **WN_config))
|
||||
self.n_remaining_channels = n_remaining_channels # Useful during inference
|
||||
|
||||
def forward(self, forward_input):
|
||||
"""
|
||||
forward_input[0] = mel_spectrogram: batch x n_mel_channels x frames
|
||||
forward_input[1] = audio: batch x time
|
||||
"""
|
||||
spect, audio = forward_input
|
||||
|
||||
# Upsample spectrogram to size of audio
|
||||
spect = self.upsample(spect)
|
||||
assert(spect.size(2) >= audio.size(1))
|
||||
if spect.size(2) > audio.size(1):
|
||||
spect = spect[:, :, :audio.size(1)]
|
||||
|
||||
spect = spect.unfold(2, self.n_group, self.n_group).permute(0, 2, 1, 3)
|
||||
spect = spect.contiguous().view(spect.size(0), spect.size(1), -1)
|
||||
spect = spect.permute(0, 2, 1)
|
||||
|
||||
audio = audio.unfold(1, self.n_group, self.n_group).permute(0, 2, 1)
|
||||
output_audio = []
|
||||
log_s_list = []
|
||||
log_det_W_list = []
|
||||
|
||||
for k in range(self.n_flows):
|
||||
if k % self.n_early_every == 0 and k > 0:
|
||||
output_audio.append(audio[:,:self.n_early_size,:])
|
||||
audio = audio[:,self.n_early_size:,:]
|
||||
|
||||
audio, log_det_W = self.convinv[k](audio)
|
||||
log_det_W_list.append(log_det_W)
|
||||
|
||||
n_half = int(audio.size(1)/2)
|
||||
audio_0 = audio[:,:n_half,:]
|
||||
audio_1 = audio[:,n_half:,:]
|
||||
|
||||
output = self.WN[k]((audio_0, spect))
|
||||
log_s = output[:, n_half:, :]
|
||||
b = output[:, :n_half, :]
|
||||
audio_1 = torch.exp(log_s)*audio_1 + b
|
||||
log_s_list.append(log_s)
|
||||
|
||||
audio = torch.cat([audio_0, audio_1], 1)
|
||||
|
||||
output_audio.append(audio)
|
||||
return torch.cat(output_audio, 1), log_s_list, log_det_W_list
|
||||
|
||||
def infer(self, spect, sigma=1.0):
|
||||
spect = self.upsample(spect)
|
||||
# trim conv artifacts. maybe pad spec to kernel multiple
|
||||
time_cutoff = self.upsample.kernel_size[0] - self.upsample.stride[0]
|
||||
spect = spect[:, :, :-time_cutoff]
|
||||
|
||||
spect = spect.unfold(2, self.n_group, self.n_group).permute(0, 2, 1, 3)
|
||||
spect = spect.contiguous().view(spect.size(0), spect.size(1), -1)
|
||||
spect = spect.permute(0, 2, 1)
|
||||
|
||||
audio = torch.randn(spect.size(0),
|
||||
self.n_remaining_channels,
|
||||
spect.size(2), device=spect.device, dtype=spect.dtype)
|
||||
|
||||
audio = torch.autograd.Variable(sigma*audio)
|
||||
|
||||
for k in reversed(range(self.n_flows)):
|
||||
n_half = int(audio.size(1)/2)
|
||||
audio_0 = audio[:,:n_half,:]
|
||||
audio_1 = audio[:,n_half:,:]
|
||||
|
||||
output = self.WN[k]((audio_0, spect))
|
||||
|
||||
s = output[:, n_half:, :]
|
||||
b = output[:, :n_half, :]
|
||||
audio_1 = (audio_1 - b)/torch.exp(s)
|
||||
audio = torch.cat([audio_0, audio_1], 1)
|
||||
|
||||
audio = self.convinv[k](audio, reverse=True)
|
||||
|
||||
if k % self.n_early_every == 0 and k > 0:
|
||||
z = torch.randn(spect.size(0), self.n_early_size, spect.size(
|
||||
2), device=spect.device, dtype=spect.dtype)
|
||||
audio = torch.cat((sigma*z, audio), 1)
|
||||
|
||||
audio = audio.permute(0, 2, 1).contiguous().view(audio.size(0), -1).data
|
||||
return audio
|
||||
|
||||
@staticmethod
|
||||
def remove_weightnorm(model):
|
||||
waveglow = model
|
||||
for WN in waveglow.WN:
|
||||
WN.start = torch.nn.utils.remove_weight_norm(WN.start)
|
||||
WN.in_layers = remove(WN.in_layers)
|
||||
WN.cond_layer = torch.nn.utils.remove_weight_norm(WN.cond_layer)
|
||||
WN.res_skip_layers = remove(WN.res_skip_layers)
|
||||
return waveglow
|
||||
|
||||
|
||||
def remove(conv_list):
|
||||
new_conv_list = torch.nn.ModuleList()
|
||||
for old_conv in conv_list:
|
||||
old_conv = torch.nn.utils.remove_weight_norm(old_conv)
|
||||
new_conv_list.append(old_conv)
|
||||
return new_conv_list
|
|
@ -40,6 +40,7 @@ The examples are organized first by framework, such as TensorFlow, PyTorch, etc.
|
|||
|
||||
### Text to Speech
|
||||
- __Tacotron2 & WaveGlow__ [[PyTorch](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/SpeechSynthesis/Tacotron2)]
|
||||
- __FastPitch (modified FastSpeech)__ [[PyTorch](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/SpeechSynthesis/FastPitch)]
|
||||
|
||||
### Speech Recognition
|
||||
- __Jasper__ [[PyTorch](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/SpeechRecognition/Jasper)]
|
||||
|
@ -75,6 +76,7 @@ The examples are organized first by framework, such as TensorFlow, PyTorch, etc.
|
|||
| [Mask R-CNN](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/Segmentation/MaskRCNN) |PyTorch | N/A | Yes | Yes | - | - | - | - | - |
|
||||
| [Jasper](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/SpeechRecognition/Jasper) |PyTorch | N/A | Yes | Yes | - | Yes | Yes | [Yes](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/SpeechRecognition/Jasper/trtis) | - |
|
||||
| [Tacotron 2 And WaveGlow v1.10](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/SpeechSynthesis/Tacotron2) | PyTorch | N/A | Yes | Yes | - | Yes | Yes | [Yes](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/SpeechSynthesis/Tacotron2/notebooks/trtis) | - |
|
||||
| [FastPitch](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/SpeechSynthesis/FastPitch) | PyTorch | N/A | Yes | Yes | - | - | - | - | - |
|
||||
| [GNMT v2](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/Translation/GNMT) |PyTorch | N/A | Yes | Yes | - | - | - | - | - |
|
||||
| [Transformer](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/Translation/Transformer) |PyTorch | N/A | Yes | Yes | - | - | - | - | - |
|
||||
| [ResNet-50 v1.5](https://github.com/NVIDIA/DeepLearningExamples/tree/master/TensorFlow/Classification/RN50v1.5) |TensorFlow | Yes | Yes | Yes | - | - | - | - | - |
|
||||
|
|
Loading…
Reference in a new issue