Skip to content

🚀 FastSpeech2 + Linformer: Smaller, Faster and Stronger.#66

Merged
dathudeptrai merged 2 commits intomasterfrom
fastspeech2-linformer
Jul 8, 2020
Merged

🚀 FastSpeech2 + Linformer: Smaller, Faster and Stronger.#66
dathudeptrai merged 2 commits intomasterfrom
fastspeech2-linformer

Conversation

@dathudeptrai
Copy link
Copy Markdown
Collaborator

@dathudeptrai dathudeptrai commented Jun 28, 2020

This PR is an combination of FastSpeech2 and recent paper Linformer: Self-Attention with Linear Complexity. Linformer paper state that:

self-attention mechanism can be approximated by a low-rank matrix.

That mean attention_head_size don't need equal to hidden_size // n_head. Here i set attention_head_size = 8 rather than 384/2 = 192 as v1. The model is smaller and faster 25% while the quality and performance is the same, even better. Especially, when sequence length is large we can gain more :)). Paper also state that

the performance of Linformer model is mainly determined by the projected dimension k instead of the ratio n/k.

k here == attention_head_size * n_head and n is sequence length

I will let you try and see.

@dathudeptrai dathudeptrai self-assigned this Jun 28, 2020
@dathudeptrai dathudeptrai added enhancement 🚀 New feature or request FastSpeech FastSpeech related problems. Feature Request 🤗 Feature support labels Jun 28, 2020
@dathudeptrai dathudeptrai merged commit 21a8f36 into master Jul 8, 2020
@dathudeptrai dathudeptrai deleted the fastspeech2-linformer branch July 8, 2020 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement 🚀 New feature or request FastSpeech FastSpeech related problems. Feature Request 🤗 Feature support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant