(self, list_IDs_temp, indexes)
return X, keras.utils.to_categorical(y, num_classes=self.n_classes)
Generates data containing batch_size samples
Generates data containing batch_size samples
Generates data containing batch_size samples
def __data_generation(self, list_IDs_temp, indexes):
        'Generates data containing batch_size samples' # X : (n_samples, *dim, n_channels)
        # Initialization
        X = np.empty((self.batch_size,) + self.dim)
        y = np.empty((self.batch_size), dtype=int)

        # Generate data
        for i, ID in enumerate(list_IDs_temp):
            # Store sample
            X[i, :, :, 0] = ut.load_data(ID, win_length=self.win_length, sr=self.sr, hop_length=self.hop_length,
                                         n_fft=self.nfft, spec_len=self.spec_len)
            # Store class
            y[i] = self.labels[indexes[i]]

        return X, keras.utils.to_categorical(y, num_classes=self.n_classes)
def __data_generation ( self , list_IDs_temp , indexes ) : # X : (n_samples, *dim, n_channels) # Initialization X = np . empty ( ( self . batch_size , ) + self . dim ) y = np . empty ( ( self . batch_size ) , dtype = int ) # Generate data for i , ID in enumerate ( list_IDs_temp ) : # Store sample X [ i , : , : , 0 ] = ut . load_data ( ID , win_length = self . win_length , sr = self . sr , hop_length = self . hop_length , n_fft = self . nfft , spec_len = self . spec_len ) # Store class y [ i ] = self . labels [ indexes [ i ] ] return X , keras . utils . to_categorical ( y , num_classes = self . n_classes )