mirror of https://github.com/MycroftAI/mimic2.git
Make power a hyperparameter
parent
6a793ba8c4
commit
0894cd9bf2
|
@ -31,7 +31,8 @@ hparams = tf.contrib.training.HParams(
|
|||
|
||||
# Eval:
|
||||
max_iters=200,
|
||||
griffin_lim_iters=60
|
||||
griffin_lim_iters=60,
|
||||
power=1.5, # Power to raise magnitudes to prior to Griffin-Lim
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ def spectrogram(y):
|
|||
|
||||
def inv_spectrogram(spectrogram):
|
||||
S = _db_to_amp(_denormalize(spectrogram) + hparams.ref_level_db) # Convert back to linear
|
||||
return _inv_preemphasis(_griffin_lim(S ** 1.5)) # Reconstruct phase
|
||||
return _inv_preemphasis(_griffin_lim(S ** hparams.power)) # Reconstruct phase
|
||||
|
||||
|
||||
def melspectrogram(y):
|
||||
|
@ -34,7 +34,7 @@ def melspectrogram(y):
|
|||
|
||||
def inv_melspectrogram(melspectrogram):
|
||||
S = _mel_to_linear(_db_to_amp(_denormalize(melspectrogram))) # Convert back to linear
|
||||
return _inv_preemphasis(_griffin_lim(S ** 1.5)) # Reconstruct phase
|
||||
return _inv_preemphasis(_griffin_lim(S ** hparams.power)) # Reconstruct phase
|
||||
|
||||
|
||||
# Based on https://github.com/librosa/librosa/issues/434
|
||||
|
|
Loading…
Reference in New Issue