def __init__(self, p, max_shift, bins_per_semitone,
target_type='chords_maj_min'):
"""
Augmenter that shifts by semitones a spectrum with logarithmically
spaced frequency bins.
:param p: percentage of data to be shifted
:param max_shift: maximum number of semitones to shift
:param bins_per_semitone: number of spectrogram bins per semitone
:param target_type: specifies target type
"""
self.p = p
self.max_shift = max_shift
self.bins_per_semitone = bins_per_semitone
if target_type == 'chords_maj_min':
self.adapt_targets = self._adapt_targets_chords_maj_min
elif target_type == 'chroma':
self.adapt_targets = self._adapt_targets_chroma
评论列表
文章目录