(self, indices)
return x_batch, self.pad_batch(x_batch, self.max_seq_length), seq_len
Given a list of indices, return the potentially augmented batch.
Given a list of indices, return the potentially augmented batch.
Given a list of indices return the potentially augmented batch .
def _get_batch_from_indices(self, indices):
    """Given a list of indices, return the potentially augmented batch."""
    x_batch = []
    seq_len = []
    for idx in range(len(indices)):
      i = indices[idx]
      data = self.random_scale(self.strokes[i])
      data_copy = np.copy(data)
      if self.augment_stroke_prob > 0:
        data_copy = augment_strokes(data_copy, self.augment_stroke_prob)
      x_batch.append(data_copy)
      length = len(data_copy)
      seq_len.append(length)
    seq_len = np.array(seq_len, dtype=int)
    # We return three things: stroke-3 format, stroke-5 format, list of seq_len.
    return x_batch, self.pad_batch(x_batch, self.max_seq_length), seq_len
def _get_batch_from_indices ( self , indices ) : x_batch = [ ] seq_len = [ ] for idx in range ( len ( indices ) ) : i = indices [ idx ] data = self . random_scale ( self . strokes [ i ] ) data_copy = np . copy ( data ) if self . augment_stroke_prob > 0 : data_copy = augment_strokes ( data_copy , self . augment_stroke_prob ) x_batch . append ( data_copy ) length = len ( data_copy ) seq_len . append ( length ) seq_len = np . array ( seq_len , dtype = int ) # We return three things: stroke-3 format, stroke-5 format, list of seq_len. return x_batch , self . pad_batch ( x_batch , self . max_seq_length ) , seq_len