lt-tensor 0.0.1a17__py3-none-any.whl → 0.0.1a19__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lt_tensor/config_templates.py +40 -36
- lt_tensor/model_zoo/audio_models/__init__.py +1 -0
- lt_tensor/model_zoo/audio_models/diffwave/__init__.py +29 -20
- lt_tensor/model_zoo/audio_models/hifigan/__init__.py +64 -19
- lt_tensor/model_zoo/audio_models/istft/__init__.py +75 -23
- {lt_tensor-0.0.1a17.dist-info → lt_tensor-0.0.1a19.dist-info}/METADATA +1 -1
- {lt_tensor-0.0.1a17.dist-info → lt_tensor-0.0.1a19.dist-info}/RECORD +10 -10
- {lt_tensor-0.0.1a17.dist-info → lt_tensor-0.0.1a19.dist-info}/WHEEL +0 -0
- {lt_tensor-0.0.1a17.dist-info → lt_tensor-0.0.1a19.dist-info}/licenses/LICENSE +0 -0
- {lt_tensor-0.0.1a17.dist-info → lt_tensor-0.0.1a19.dist-info}/top_level.txt +0 -0
lt_tensor/config_templates.py
CHANGED
@@ -7,75 +7,79 @@ from lt_tensor.misc_utils import updateDict
|
|
7
7
|
|
8
8
|
class ModelConfig(ABC, OrderedDict):
|
9
9
|
_default_settings: Dict[str, Any] = {}
|
10
|
-
_forbidden_list: List[str] = [
|
10
|
+
_forbidden_list: List[str] = [
|
11
|
+
"_default_settings",
|
12
|
+
"_forbidden_list",
|
13
|
+
"path_name",
|
14
|
+
]
|
15
|
+
path: Optional[str] = None
|
11
16
|
|
12
17
|
def __init__(
|
13
18
|
self,
|
14
|
-
|
15
|
-
|
19
|
+
path: Optional[Union[str, PathLike]] = None,
|
20
|
+
**settings,
|
16
21
|
):
|
17
|
-
|
18
|
-
self.
|
19
|
-
|
20
|
-
if not str(path_name).endswith(".json"):
|
21
|
-
self.path_name = str(Path(path_name, "config.json")).replace("\\", "/")
|
22
|
-
else:
|
23
|
-
self.path_name = str(path_name).replace("\\", "/")
|
22
|
+
self._setup_path_name(path)
|
23
|
+
if self.path is not None:
|
24
|
+
self._default_settings = load_json(self.path, default=settings)
|
24
25
|
else:
|
25
|
-
self.
|
26
|
-
|
26
|
+
self._default_settings = settings
|
27
|
+
|
28
|
+
self.set_state_dict(self._default_settings)
|
27
29
|
|
28
30
|
def _setup_path_name(self, path_name: Union[str, PathLike]):
|
29
31
|
if is_file(path_name):
|
30
32
|
self.from_path(path_name)
|
31
|
-
self.
|
33
|
+
self.path = str(path_name).replace("\\", "/")
|
32
34
|
elif is_str(path_name):
|
33
|
-
self.
|
34
|
-
if not self.
|
35
|
-
self.
|
35
|
+
self.path = str(path_name).replace("\\", "/")
|
36
|
+
if not self.path.endswith((".json")):
|
37
|
+
self.path += ".json"
|
36
38
|
|
37
39
|
def reset_settings(self):
|
38
|
-
|
39
|
-
for s_name, setting in self._default_settings.items():
|
40
|
-
if s_name in self._forbidden_list or s_name not in dk_keys:
|
41
|
-
continue
|
42
|
-
updateDict(self, {s_name: setting})
|
40
|
+
raise NotImplementedError("Not implemented")
|
43
41
|
|
44
42
|
def save_config(
|
45
43
|
self,
|
46
|
-
|
44
|
+
path: Optional[Union[PathLike, str]] = None,
|
47
45
|
):
|
48
|
-
if not is_pathlike(
|
46
|
+
if not is_pathlike(path, True):
|
49
47
|
assert (
|
50
|
-
|
51
|
-
), f"path_name should be a non-empty string or pathlike object! received instead: {
|
52
|
-
|
48
|
+
path is None
|
49
|
+
), f"path_name should be a non-empty string or pathlike object! received instead: {path}."
|
50
|
+
path = self.path
|
53
51
|
else:
|
54
|
-
self._setup_path_name(
|
52
|
+
self._setup_path_name(path)
|
55
53
|
|
56
|
-
base = self.
|
57
|
-
save_json(self.
|
54
|
+
base = self.state_dict()
|
55
|
+
save_json(self.path, base, indent=2)
|
58
56
|
|
59
57
|
def set_value(self, var_name: str, value: str) -> None:
|
60
|
-
assert var_name in self.__dict__, "Value not registered!"
|
61
58
|
assert var_name not in self._forbidden_list, "Not allowed!"
|
62
59
|
updateDict(self, {var_name: value})
|
60
|
+
self.update({var_name: value})
|
63
61
|
|
64
62
|
def get_value(self, var_name: str) -> Any:
|
65
63
|
return self.__dict__.get(var_name)
|
66
64
|
|
67
|
-
def
|
68
|
-
|
65
|
+
def set_state_dict(self, new_state: dict[str, str]):
|
66
|
+
new_state = {
|
67
|
+
k: y for k, y in new_state.items() if k not in self._forbidden_list
|
68
|
+
}
|
69
|
+
updateDict(self, new_state)
|
70
|
+
self.update(**new_state)
|
69
71
|
|
70
|
-
def
|
72
|
+
def state_dict(self):
|
71
73
|
return {k: y for k, y in self.__dict__.items() if k not in self._forbidden_list}
|
72
74
|
|
73
75
|
@classmethod
|
74
76
|
def from_dict(
|
75
|
-
cls,
|
77
|
+
cls,
|
78
|
+
dictionary: Dict[str, Any],
|
79
|
+
path: Optional[Union[str, PathLike]] = None,
|
76
80
|
) -> "ModelConfig":
|
77
81
|
assert is_dict(dictionary)
|
78
|
-
return ModelConfig(
|
82
|
+
return ModelConfig(path, **dictionary)
|
79
83
|
|
80
84
|
@classmethod
|
81
85
|
def from_path(cls, path_name: PathLike) -> "ModelConfig":
|
@@ -102,4 +106,4 @@ class ModelConfig(ABC, OrderedDict):
|
|
102
106
|
)
|
103
107
|
assert files, "No config file found in the provided directory!"
|
104
108
|
settings.update(load_json(files[-1], {}, errors="ignore"))
|
105
|
-
return ModelConfig(
|
109
|
+
return ModelConfig(path_name, **settings)
|
@@ -1,29 +1,19 @@
|
|
1
|
-
__all__ = ["DiffWave", "
|
1
|
+
__all__ = ["DiffWave", "DiffWaveConfig", "SpectrogramUpsample", "DiffusionEmbedding"]
|
2
2
|
|
3
3
|
import numpy as np
|
4
|
-
import
|
5
|
-
|
6
|
-
import torch.nn.functional as F
|
4
|
+
from lt_tensor.torch_commons import *
|
5
|
+
from torch.nn import functional as F
|
7
6
|
from lt_tensor.config_templates import ModelConfig
|
8
7
|
from lt_tensor.torch_commons import *
|
9
8
|
from lt_tensor.model_base import Model
|
10
9
|
from math import sqrt
|
11
10
|
from lt_utils.common import *
|
12
11
|
|
13
|
-
F.t
|
14
|
-
|
15
12
|
|
16
13
|
class DiffWaveConfig(ModelConfig):
|
17
|
-
#
|
18
|
-
batch_size = 16
|
19
|
-
learning_rate = 2e-4
|
20
|
-
max_grad_norm = None
|
21
|
-
# Data params
|
22
|
-
sample_rate = 24000
|
14
|
+
# Model params
|
23
15
|
n_mels = 80
|
24
|
-
n_fft = 1024
|
25
16
|
hop_samples = 256
|
26
|
-
# Model params
|
27
17
|
residual_layers = 30
|
28
18
|
residual_channels = 64
|
29
19
|
dilation_cycle_length = 10
|
@@ -37,11 +27,30 @@ class DiffWaveConfig(ModelConfig):
|
|
37
27
|
|
38
28
|
def __init__(
|
39
29
|
self,
|
40
|
-
|
41
|
-
|
30
|
+
n_mels = 80,
|
31
|
+
hop_samples = 256,
|
32
|
+
residual_layers = 30,
|
33
|
+
residual_channels = 64,
|
34
|
+
dilation_cycle_length = 10,
|
35
|
+
unconditional = False,
|
36
|
+
noise_schedule: list[int] = np.linspace(1e-4, 0.05, 50).tolist(),
|
37
|
+
interpolate_cond = False,
|
38
|
+
interpolation_mode: Literal[
|
39
|
+
"nearest", "linear", "bilinear", "bicubic", "trilinear", "area", "nearest-exact"
|
40
|
+
] = "nearest",
|
42
41
|
):
|
43
|
-
|
44
|
-
|
42
|
+
settings = {
|
43
|
+
"n_mels": n_mels,
|
44
|
+
"hop_samples": hop_samples,
|
45
|
+
"residual_layers": residual_layers,
|
46
|
+
"dilation_cycle_length": dilation_cycle_length,
|
47
|
+
"residual_channels": residual_channels,
|
48
|
+
"unconditional": unconditional,
|
49
|
+
"noise_schedule": noise_schedule,
|
50
|
+
"interpolate": interpolate_cond,
|
51
|
+
"interpolation_mode": interpolation_mode,
|
52
|
+
}
|
53
|
+
super().__init__(**settings)
|
45
54
|
|
46
55
|
|
47
56
|
def Conv1d(*args, **kwargs):
|
@@ -86,7 +95,7 @@ class DiffusionEmbedding(Model):
|
|
86
95
|
return table
|
87
96
|
|
88
97
|
|
89
|
-
class
|
98
|
+
class SpectrogramUpsample(Model):
|
90
99
|
def __init__(self):
|
91
100
|
super().__init__()
|
92
101
|
self.conv1 = nn.ConvTranspose2d(1, 1, [3, 32], stride=[1, 16], padding=[1, 8])
|
@@ -162,7 +171,7 @@ class DiffWave(Model):
|
|
162
171
|
if self.params.unconditional: # use unconditional model
|
163
172
|
self.spectrogram_upsample = None
|
164
173
|
else:
|
165
|
-
self.spectrogram_upsample =
|
174
|
+
self.spectrogram_upsample = SpectrogramUpsample()
|
166
175
|
|
167
176
|
self.residual_layers = nn.ModuleList(
|
168
177
|
[
|
@@ -1,18 +1,63 @@
|
|
1
|
-
__all__ = ["HifiganGenerator"]
|
1
|
+
__all__ = ["HifiganGenerator", "HifiganConfig"]
|
2
2
|
from lt_utils.common import *
|
3
3
|
from lt_tensor.torch_commons import *
|
4
4
|
from lt_tensor.model_zoo.residual import ConvNets
|
5
5
|
from torch.nn import functional as F
|
6
6
|
|
7
|
-
import torch
|
8
|
-
import torch.nn.functional as F
|
9
|
-
import torch.nn as nn
|
10
|
-
|
11
7
|
|
12
8
|
def get_padding(kernel_size, dilation=1):
|
13
9
|
return int((kernel_size * dilation - dilation) / 2)
|
14
10
|
|
15
11
|
|
12
|
+
from lt_tensor.config_templates import ModelConfig
|
13
|
+
|
14
|
+
|
15
|
+
class HifiganConfig(ModelConfig):
|
16
|
+
# Training params
|
17
|
+
in_channels: int = 80
|
18
|
+
upsample_rates: List[Union[int, List[int]]] = [8, 8]
|
19
|
+
upsample_kernel_sizes: List[Union[int, List[int]]] = [16, 16]
|
20
|
+
upsample_initial_channel: int = 512
|
21
|
+
resblock_kernel_sizes: List[Union[int, List[int]]] = [3, 7, 11]
|
22
|
+
resblock_dilation_sizes: List[Union[int, List[int]]] = [
|
23
|
+
[1, 3, 5],
|
24
|
+
[1, 3, 5],
|
25
|
+
[1, 3, 5],
|
26
|
+
]
|
27
|
+
|
28
|
+
activation: nn.Module = nn.LeakyReLU(0.1)
|
29
|
+
resblock: int = 0
|
30
|
+
|
31
|
+
def __init__(
|
32
|
+
self,
|
33
|
+
in_channels: int = 80,
|
34
|
+
upsample_rates: List[Union[int, List[int]]] = [8, 8],
|
35
|
+
upsample_kernel_sizes: List[Union[int, List[int]]] = [16, 16],
|
36
|
+
upsample_initial_channel: int = 512,
|
37
|
+
resblock_kernel_sizes: List[Union[int, List[int]]] = [3, 7, 11],
|
38
|
+
resblock_dilation_sizes: List[Union[int, List[int]]] = [
|
39
|
+
[1, 3, 5],
|
40
|
+
[1, 3, 5],
|
41
|
+
[1, 3, 5],
|
42
|
+
],
|
43
|
+
activation: nn.Module = nn.LeakyReLU(0.1),
|
44
|
+
resblock: int = 0,
|
45
|
+
*args,
|
46
|
+
**kwargs,
|
47
|
+
):
|
48
|
+
settings = {
|
49
|
+
"in_channels": in_channels,
|
50
|
+
"upsample_rates": upsample_rates,
|
51
|
+
"upsample_kernel_sizes": upsample_kernel_sizes,
|
52
|
+
"upsample_initial_channel": upsample_initial_channel,
|
53
|
+
"resblock_kernel_sizes": resblock_kernel_sizes,
|
54
|
+
"resblock_dilation_sizes": resblock_dilation_sizes,
|
55
|
+
"activation": activation,
|
56
|
+
"resblock": resblock,
|
57
|
+
}
|
58
|
+
super().__init__(**settings)
|
59
|
+
|
60
|
+
|
16
61
|
class ResBlock1(ConvNets):
|
17
62
|
def __init__(self, channels, kernel_size=3, dilation=(1, 3, 5)):
|
18
63
|
super().__init__()
|
@@ -142,23 +187,23 @@ class ResBlock2(ConvNets):
|
|
142
187
|
|
143
188
|
|
144
189
|
class HifiganGenerator(ConvNets):
|
145
|
-
def __init__(self,
|
190
|
+
def __init__(self, cfg: HifiganConfig = HifiganConfig()):
|
146
191
|
super().__init__()
|
147
|
-
self.
|
148
|
-
self.num_kernels = len(
|
149
|
-
self.num_upsamples = len(
|
192
|
+
self.cfg = cfg
|
193
|
+
self.num_kernels = len(cfg.resblock_kernel_sizes)
|
194
|
+
self.num_upsamples = len(cfg.upsample_rates)
|
150
195
|
self.conv_pre = weight_norm(
|
151
|
-
nn.Conv1d(
|
196
|
+
nn.Conv1d(cfg.in_channels, cfg.upsample_initial_channel, 7, 1, padding=3)
|
152
197
|
)
|
153
|
-
resblock = ResBlock1 if
|
154
|
-
self.activation =
|
198
|
+
resblock = ResBlock1 if cfg.resblock == 0 else ResBlock2
|
199
|
+
self.activation = cfg.activation
|
155
200
|
self.ups = nn.ModuleList()
|
156
|
-
for i, (u, k) in enumerate(zip(
|
201
|
+
for i, (u, k) in enumerate(zip(cfg.upsample_rates, cfg.upsample_kernel_sizes)):
|
157
202
|
self.ups.append(
|
158
203
|
weight_norm(
|
159
204
|
nn.ConvTranspose1d(
|
160
|
-
|
161
|
-
|
205
|
+
cfg.upsample_initial_channel // (2**i),
|
206
|
+
cfg.upsample_initial_channel // (2 ** (i + 1)),
|
162
207
|
k,
|
163
208
|
u,
|
164
209
|
padding=(k - u) // 2,
|
@@ -168,17 +213,17 @@ class HifiganGenerator(ConvNets):
|
|
168
213
|
|
169
214
|
self.resblocks = nn.ModuleList()
|
170
215
|
for i in range(len(self.ups)):
|
171
|
-
ch =
|
216
|
+
ch = cfg.upsample_initial_channel // (2 ** (i + 1))
|
172
217
|
for j, (k, d) in enumerate(
|
173
|
-
zip(
|
218
|
+
zip(cfg.resblock_kernel_sizes, cfg.resblock_dilation_sizes)
|
174
219
|
):
|
175
|
-
self.resblocks.append(resblock(
|
220
|
+
self.resblocks.append(resblock(ch, k, d))
|
176
221
|
|
177
222
|
self.conv_post = weight_norm(nn.Conv1d(ch, 1, 7, 1, padding=3))
|
178
223
|
self.ups.apply(self.init_weights)
|
179
224
|
self.conv_post.apply(self.init_weights)
|
180
225
|
|
181
|
-
def forward(self, x):
|
226
|
+
def forward(self, x: Tensor):
|
182
227
|
x = self.conv_pre(x)
|
183
228
|
for i in range(self.num_upsamples):
|
184
229
|
x = self.ups[i](self.activation(x))
|
@@ -1,8 +1,61 @@
|
|
1
|
-
__all__ = ["
|
1
|
+
__all__ = ["iSTFTNetGenerator", "iSTFTNetConfig"]
|
2
2
|
from lt_utils.common import *
|
3
3
|
from lt_tensor.torch_commons import *
|
4
4
|
from lt_tensor.model_zoo.residual import ConvNets
|
5
5
|
from torch.nn import functional as F
|
6
|
+
from lt_tensor.config_templates import ModelConfig
|
7
|
+
|
8
|
+
|
9
|
+
class iSTFTNetConfig(ModelConfig):
|
10
|
+
# Training params
|
11
|
+
in_channels: int = 80
|
12
|
+
upsample_rates: List[Union[int, List[int]]] = [8, 8]
|
13
|
+
upsample_kernel_sizes: List[Union[int, List[int]]] = [16, 16]
|
14
|
+
upsample_initial_channel: int = 512
|
15
|
+
resblock_kernel_sizes: List[Union[int, List[int]]] = [3, 7, 11]
|
16
|
+
resblock_dilation_sizes: List[Union[int, List[int]]] = [
|
17
|
+
[1, 3, 5],
|
18
|
+
[1, 3, 5],
|
19
|
+
[1, 3, 5],
|
20
|
+
]
|
21
|
+
|
22
|
+
activation: nn.Module = nn.LeakyReLU(0.1)
|
23
|
+
resblock: int = 0
|
24
|
+
gen_istft_n_fft: int = 16
|
25
|
+
sampling_rate: Number = 24000
|
26
|
+
|
27
|
+
def __init__(
|
28
|
+
self,
|
29
|
+
in_channels: int = 80,
|
30
|
+
upsample_rates: List[Union[int, List[int]]] = [8, 8],
|
31
|
+
upsample_kernel_sizes: List[Union[int, List[int]]] = [16, 16],
|
32
|
+
upsample_initial_channel: int = 512,
|
33
|
+
resblock_kernel_sizes: List[Union[int, List[int]]] = [3, 7, 11],
|
34
|
+
resblock_dilation_sizes: List[Union[int, List[int]]] = [
|
35
|
+
[1, 3, 5],
|
36
|
+
[1, 3, 5],
|
37
|
+
[1, 3, 5],
|
38
|
+
],
|
39
|
+
activation: nn.Module = nn.LeakyReLU(0.1),
|
40
|
+
resblock: int = 0,
|
41
|
+
gen_istft_n_fft: int = 16,
|
42
|
+
sampling_rate: Number = 24000,
|
43
|
+
*args,
|
44
|
+
**kwargs,
|
45
|
+
):
|
46
|
+
settings = {
|
47
|
+
"in_channels": in_channels,
|
48
|
+
"upsample_rates": upsample_rates,
|
49
|
+
"upsample_kernel_sizes": upsample_kernel_sizes,
|
50
|
+
"upsample_initial_channel": upsample_initial_channel,
|
51
|
+
"resblock_kernel_sizes": resblock_kernel_sizes,
|
52
|
+
"resblock_dilation_sizes": resblock_dilation_sizes,
|
53
|
+
"activation": activation,
|
54
|
+
"resblock": resblock,
|
55
|
+
"gen_istft_n_fft": gen_istft_n_fft,
|
56
|
+
"sampling_rate": sampling_rate,
|
57
|
+
}
|
58
|
+
super().__init__(**settings)
|
6
59
|
|
7
60
|
|
8
61
|
def get_padding(ks, d):
|
@@ -10,9 +63,8 @@ def get_padding(ks, d):
|
|
10
63
|
|
11
64
|
|
12
65
|
class ResBlock1(ConvNets):
|
13
|
-
def __init__(self,
|
66
|
+
def __init__(self, channels, kernel_size=3, dilation=(1, 3, 5)):
|
14
67
|
super().__init__()
|
15
|
-
self.h = h
|
16
68
|
self.convs1 = nn.ModuleList(
|
17
69
|
[
|
18
70
|
weight_norm(
|
@@ -95,10 +147,10 @@ class ResBlock1(ConvNets):
|
|
95
147
|
x = xt + x
|
96
148
|
return x
|
97
149
|
|
150
|
+
|
98
151
|
class ResBlock2(ConvNets):
|
99
|
-
def __init__(self,
|
152
|
+
def __init__(self, channels, kernel_size=3, dilation=(1, 3)):
|
100
153
|
super().__init__()
|
101
|
-
self.h = h
|
102
154
|
self.convs = nn.ModuleList(
|
103
155
|
[
|
104
156
|
weight_norm(
|
@@ -134,25 +186,25 @@ class ResBlock2(ConvNets):
|
|
134
186
|
return x
|
135
187
|
|
136
188
|
|
137
|
-
class
|
138
|
-
def __init__(self,
|
189
|
+
class iSTFTNetGenerator(ConvNets):
|
190
|
+
def __init__(self, cfg: iSTFTNetConfig = iSTFTNetConfig()):
|
139
191
|
super().__init__()
|
140
|
-
self.
|
141
|
-
self.num_kernels = len(
|
142
|
-
self.num_upsamples = len(
|
192
|
+
self.cfg = cfg
|
193
|
+
self.num_kernels = len(cfg.resblock_kernel_sizes)
|
194
|
+
self.num_upsamples = len(cfg.upsample_rates)
|
143
195
|
self.conv_pre = weight_norm(
|
144
|
-
nn.Conv1d(
|
196
|
+
nn.Conv1d(cfg.in_channels, cfg.upsample_initial_channel, 7, 1, padding=3)
|
145
197
|
)
|
146
|
-
resblock = ResBlock1 if
|
198
|
+
resblock = ResBlock1 if cfg.resblock == 0 else ResBlock2
|
147
199
|
|
148
200
|
self.ups = nn.ModuleList()
|
149
|
-
for i, (u, k) in enumerate(zip(
|
150
|
-
if
|
201
|
+
for i, (u, k) in enumerate(zip(cfg.upsample_rates, cfg.upsample_kernel_sizes)):
|
202
|
+
if cfg.sampling_rate % 16000:
|
151
203
|
self.ups.append(
|
152
204
|
weight_norm(
|
153
205
|
nn.ConvTranspose1d(
|
154
|
-
|
155
|
-
|
206
|
+
cfg.upsample_initial_channel // (2**i),
|
207
|
+
cfg.upsample_initial_channel // (2 ** (i + 1)),
|
156
208
|
k,
|
157
209
|
u,
|
158
210
|
padding=(k - u) // 2,
|
@@ -163,8 +215,8 @@ class iSTFTGenerator(ConvNets):
|
|
163
215
|
self.ups.append(
|
164
216
|
weight_norm(
|
165
217
|
nn.ConvTranspose1d(
|
166
|
-
|
167
|
-
|
218
|
+
cfg.upsample_initial_channel // (2**i),
|
219
|
+
cfg.upsample_initial_channel // (2 ** (i + 1)),
|
168
220
|
k,
|
169
221
|
u,
|
170
222
|
padding=(u // 2 + u % 2),
|
@@ -175,19 +227,19 @@ class iSTFTGenerator(ConvNets):
|
|
175
227
|
|
176
228
|
self.resblocks = nn.ModuleList()
|
177
229
|
for i in range(len(self.ups)):
|
178
|
-
ch =
|
230
|
+
ch = cfg.upsample_initial_channel // (2 ** (i + 1))
|
179
231
|
for j, (k, d) in enumerate(
|
180
|
-
zip(
|
232
|
+
zip(cfg.resblock_kernel_sizes, cfg.resblock_dilation_sizes)
|
181
233
|
):
|
182
|
-
self.resblocks.append(resblock(
|
234
|
+
self.resblocks.append(resblock(ch, k, d))
|
183
235
|
|
184
|
-
self.post_n_fft =
|
236
|
+
self.post_n_fft = cfg.gen_istft_n_fft
|
185
237
|
self.conv_post = weight_norm(
|
186
238
|
nn.Conv1d(ch, self.post_n_fft + 2, 7, 1, padding=3)
|
187
239
|
)
|
188
240
|
self.ups.apply(self.init_weights)
|
189
241
|
self.conv_post.apply(self.init_weights)
|
190
|
-
self.activation =
|
242
|
+
self.activation = cfg.activation
|
191
243
|
self.reflection_pad = torch.nn.ReflectionPad1d((1, 0))
|
192
244
|
|
193
245
|
def forward(self, x):
|
@@ -1,5 +1,5 @@
|
|
1
1
|
lt_tensor/__init__.py,sha256=XxNCGcVL-haJyMpifr-GRaamo32R6jmqe3iOuS4ecfs,469
|
2
|
-
lt_tensor/config_templates.py,sha256=
|
2
|
+
lt_tensor/config_templates.py,sha256=9hLt7OLq3z1y8FKNoGY_sIJHHnVoXsLcuI4x2zoE0Q4,3634
|
3
3
|
lt_tensor/losses.py,sha256=zvkCOnE5XpF3v6ymivRIdqPTsMM5zc94ZMom7YDi3zM,4946
|
4
4
|
lt_tensor/lr_schedulers.py,sha256=LSZzqrOOLzSthD8k-W4cYPJt0vCjmHkiJkLr5e3yRTE,3659
|
5
5
|
lt_tensor/math_ops.py,sha256=TkD4WQG42KsQ9Fg7FXOjf8f-ixtW0apf2XjaooecVx4,2257
|
@@ -18,14 +18,14 @@ lt_tensor/model_zoo/fusion.py,sha256=usC1bcjQRNivDc8xzkIS5T1glm78OLcs2V_tPqfp-eI
|
|
18
18
|
lt_tensor/model_zoo/pos_encoder.py,sha256=3d1EYLinCU9UAy-WuEWeYMGhMqaGknCiQ5qEmhw_UYM,4487
|
19
19
|
lt_tensor/model_zoo/residual.py,sha256=i5V4ju7DB3WesKBVm6KH_LyPoKGDUOyo2Usfs-PyP58,9394
|
20
20
|
lt_tensor/model_zoo/transformer.py,sha256=HUFoFFh7EQJErxdd9XIxhssdjvNVx2tNGDJOTUfwG2A,4301
|
21
|
-
lt_tensor/model_zoo/audio_models/__init__.py,sha256=
|
22
|
-
lt_tensor/model_zoo/audio_models/diffwave/__init__.py,sha256=
|
23
|
-
lt_tensor/model_zoo/audio_models/hifigan/__init__.py,sha256=
|
24
|
-
lt_tensor/model_zoo/audio_models/istft/__init__.py,sha256=
|
21
|
+
lt_tensor/model_zoo/audio_models/__init__.py,sha256=MoG9YjxLyvscq_6njK1ljGBletK9iedBXt66bplzW-s,83
|
22
|
+
lt_tensor/model_zoo/audio_models/diffwave/__init__.py,sha256=vSrQJ0NXYvTbjOyjLjiMNy95Ib7VO1BJ5UqhoQ7dzYo,8032
|
23
|
+
lt_tensor/model_zoo/audio_models/hifigan/__init__.py,sha256=JNebaYO3nsyyqpYCCOyL13zY2uxLY3NOCeNynF6-96k,13940
|
24
|
+
lt_tensor/model_zoo/audio_models/istft/__init__.py,sha256=JdFChpPhURaI2qb9mDV6vzDcZN757FBGGtgzN3vxtJ0,14821
|
25
25
|
lt_tensor/processors/__init__.py,sha256=4b9MxAJolXiJfSm20ZEspQTDm1tgLazwlPWA_jB1yLM,63
|
26
26
|
lt_tensor/processors/audio.py,sha256=SMqNSl4Den-x1awTCQ8-TcR-0jPiv5lDaUpU93SRRaw,14749
|
27
|
-
lt_tensor-0.0.
|
28
|
-
lt_tensor-0.0.
|
29
|
-
lt_tensor-0.0.
|
30
|
-
lt_tensor-0.0.
|
31
|
-
lt_tensor-0.0.
|
27
|
+
lt_tensor-0.0.1a19.dist-info/licenses/LICENSE,sha256=HUnu_iSPpnDfZS_PINhO3AoVizJD1A2vee8WX7D7uXo,11358
|
28
|
+
lt_tensor-0.0.1a19.dist-info/METADATA,sha256=lkXND2y0Ue6-y_1LDUcpbPWEJ9jnUG71zJMfcSwKdJs,1033
|
29
|
+
lt_tensor-0.0.1a19.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
30
|
+
lt_tensor-0.0.1a19.dist-info/top_level.txt,sha256=35FuhFeXnUyvHWdbVHGPh0hS8euofafnJ_GJAVSF4Kk,10
|
31
|
+
lt_tensor-0.0.1a19.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|