Create configuration_wavcoch.py
Browse files- configuration_wavcoch.py +37 -0
configuration_wavcoch.py
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import PretrainedConfig
|
| 2 |
+
|
| 3 |
+
class WavCochConfig(PretrainedConfig):
|
| 4 |
+
model_type = "WavCoch.WavCoch"
|
| 5 |
+
|
| 6 |
+
def __init__(
|
| 7 |
+
self,
|
| 8 |
+
window_size=1001,
|
| 9 |
+
hop_length=80,
|
| 10 |
+
encoder_layers=8,
|
| 11 |
+
encoder_dim=512,
|
| 12 |
+
encoder_kernel_size=3,
|
| 13 |
+
decoder_layers=8,
|
| 14 |
+
decoder_dim=512,
|
| 15 |
+
decoder_kernel_size=9,
|
| 16 |
+
entropy_loss_weight=0.001,
|
| 17 |
+
commit_loss_weight=0.001,
|
| 18 |
+
diversity_gamma=1.0,
|
| 19 |
+
codebook_size=8192,
|
| 20 |
+
vocab_size=8192,
|
| 21 |
+
**kwargs
|
| 22 |
+
):
|
| 23 |
+
self.window_size = window_size
|
| 24 |
+
self.hop_length = hop_length
|
| 25 |
+
self.encoder_layers = encoder_layers
|
| 26 |
+
self.encoder_dim = encoder_dim
|
| 27 |
+
self.encoder_kernel_size = encoder_kernel_size
|
| 28 |
+
self.decoder_layers = decoder_layers
|
| 29 |
+
self.decoder_dim = decoder_dim
|
| 30 |
+
self.decoder_kernel_size = decoder_kernel_size
|
| 31 |
+
self.entropy_loss_weight = entropy_loss_weight
|
| 32 |
+
self.commit_loss_weight = commit_loss_weight
|
| 33 |
+
self.diversity_gamma = diversity_gamma
|
| 34 |
+
self.codebook_size = codebook_size
|
| 35 |
+
self.vocab_size = vocab_size
|
| 36 |
+
|
| 37 |
+
super().__init__(**kwargs)
|