def get_classification(self, idx):
"""Docs"""
img_rows = self.params.get('img_rows', self.Sxx.shape[0])
img_cols = self.params.get('img_cols', 1)
if self.Sxx is None or self.active_song.classification is None:
raise TypeError('No active song from which to get data')
if np.amax(idx) > self.Sxx.shape[1]:
raise IndexError('Data index of sample out of bounds, only {0} '
'samples in the dataset'.format(self.Sxx.shape[1] - img_cols))
if np.amin(idx) < 0:
raise IndexError('Data index of sample out of bounds, '
'negative index requested')
# index out the data
classification = self.active_song.classification[idx]
return classification
评论列表
文章目录