train.py
def _generate_batch(self, batch_idx):
        """Generate a batch and increment the sliding batch window within the data."""
        features = self.train_data[0]
        labels = self.train_data[1]

        start_idx = batch_idx * self.batch_size
        end_idx = start_idx + self.batch_size - 1

        # Error handling for if sliding window goes beyond data list length
        if end_idx > self._ex_per_epoch:
            end_idx = self._ex_per_epoch

        if self.n_features > 1:
            x_batch = features[:, start_idx:end_idx]
        else:
            x_batch = features[start_idx:end_idx]

        y_batch = labels[start_idx:end_idx]
        self.logger.debug('batch_idx: %d', batch_idx)
        self.logger.debug('Got training examples %d to %d', start_idx, end_idx)

        return x_batch, y_batch
Generate a batch and increment the sliding batch window within the data.
Generate a batch and increment the sliding batch window within the data.
Generate a batch and increment the sliding batch window within the data .
def _generate_batch(self, batch_idx):
        features = self.train_data[0]
        labels = self.train_data[1]
        start_idx = batch_idx * self.batch_size
        end_idx = start_idx + self.batch_size - 1
        if end_idx > self._ex_per_epoch:
            end_idx = self._ex_per_epoch
        if self.n_features > 1:
            x_batch = features[:, start_idx:end_idx]
        else:
            x_batch = features[start_idx:end_idx]
        y_batch = labels[start_idx:end_idx]
        self.logger.debug('batch_idx: %d', batch_idx)
        self.logger.debug('Got training examples %d to %d', start_idx, end_idx)
        return x_batch, y_batch
def _generate_batch ( self , batch_idx ) : features = self . train_data [ 0 ] labels = self . train_data [ 1 ] start_idx = batch_idx * self . batch_size end_idx = start_idx + self . batch_size - 1 if end_idx > self . _ex_per_epoch : end_idx = self . _ex_per_epoch if self . n_features > 1 : x_batch = features [ : , start_idx : end_idx ] else : x_batch = features [ start_idx : end_idx ] y_batch = labels [ start_idx : end_idx ] self . logger . debug ( 'batch_idx: %d' , batch_idx ) self . logger . debug ( 'Got training examples %d to %d' , start_idx , end_idx ) return x_batch , y_batch
Generate a batch and increment the sliding batch window within the data.
Generate a batch and increment the sliding batch window within the data .
"""Generate a batch and increment the sliding batch window within the data.""" # Error handling for if sliding window goes beyond data list length
self
batch_idx