MCPcopy Create free account
hub / github.com/FunAudioLLM/FunMusic / __init__

Method __init__

inspiremusic/hifigan/generator.py:189–202  ·  view source on GitHub ↗
(self, sampling_rate, upsample_scale, harmonic_num=0, sine_amp=0.1,
                 add_noise_std=0.003, voiced_threshod=0)

Source from the content-addressed store, hash-verified

187 """
188
189 def __init__(self, sampling_rate, upsample_scale, harmonic_num=0, sine_amp=0.1,
190 add_noise_std=0.003, voiced_threshod=0):
191 super(SourceModuleHnNSF, self).__init__()
192
193 self.sine_amp = sine_amp
194 self.noise_std = add_noise_std
195
196 # to produce sine waveforms
197 self.l_sin_gen = SineGen(sampling_rate, harmonic_num,
198 sine_amp, add_noise_std, voiced_threshod)
199
200 # to merge source harmonics into a single excitation
201 self.l_linear = torch.nn.Linear(harmonic_num + 1, 1)
202 self.l_tanh = torch.nn.Tanh()
203
204 def forward(self, x):
205 """

Callers

nothing calls this directly

Calls 2

SineGenClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected