Skip to content

Conversation

xinghai-sun
Copy link
Contributor

@xinghai-sun xinghai-sun commented Jun 21, 2017

resolve #113

  1. Improve audio featurizer (resample, db_normalize, and random shift), as suggested in the speech_dl codes.
  2. Add shift augmentor.
  3. Update default arguments to be the current best seggestion.
  4. Add checkpoints with pass id.

Training experiment is in progress, and its results will be pasted here ASAP.

1. Improve audio featurizer.
2. Add shift augmentor.
3. Update default argument to be the current best seggestion.
4. Add checkpoints with pass id.
samples, sample_rate = soundfile.read(file, dtype='float32')
return cls(samples, sample_rate)

@classmethod
Copy link
Contributor Author

@xinghai-sun xinghai-sun Jun 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reviewers:
No different for slice_from_file and make_silence. Only re-order them.

Copy link
Contributor

@pkuyym pkuyym left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost LGTM.

:type shift_ms: float
:raises ValueError: If shift_ms is longer than audio duration.
"""
if shift_ms / 1000.0 > self.duration:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be abs(shift_ms) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

extracting spectrogram features.
:type target_sample_rate: float
:param use_dB_normalization: Whether to normalize the audio to a certain
decibels before extracting the features.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to change decibels to dB for consistency

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For comments, full name decibels is used for clarity, while in arguments a short name of dB is used instead.
I think it makes sense?

if audio_segment.sample_rate != self._target_sample_rate:
raise ValueError("Audio sample rate is not supported. "
"Turn allow_downsampling or allow up_sampling on.")
# decibel normalization
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dB better ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For comments, full name decibels is used for clarity, while in arguments a short name of dB is used instead.
I think it makes sense?

:param use_dB_normalization: Whether to normalize the audio to a certain
decibels before extracting the features.
:type use_dB_normalization: bool
:param target_dB: Target audio decibels for normalization.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dB better?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For comments, full name decibels is used for clarity, while in arguments a short name of dB is used instead.
I think it makes sense?

Copy link
Contributor

@pkuyym pkuyym left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. LGTM.

@xinghai-sun
Copy link
Contributor Author

The experimental results for comparing old and new featurizer are as follows. We have a better convergence with the new featurizer.

compare_old_new_data

@xinghai-sun xinghai-sun merged commit 68caa8c into PaddlePaddle:develop Jun 26, 2017
kuke added a commit that referenced this pull request Jun 26, 2017
Patchset for adding missing shift_perturb.py in PR #114.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve audio featurizer and add shift augmentor for DS2.

2 participants