(self, ids, strip_extraneous=False)
return ns
Transform a sequence of event indices into a performance NoteSequence.

    Args:
      ids: List of performance event indices.
      strip_extraneous: Whether to strip EOS and padding from the end of `ids`.

    Returns:
      A NoteSequence.
Transform a sequence of event indices into a performance NoteSequence.
Transform a sequence of event indices into a performance NoteSequence .
def decode_to_note_sequence(self, ids, strip_extraneous=False):
    """Transform a sequence of event indices into a performance NoteSequence.

    Args:
      ids: List of performance event indices.
      strip_extraneous: Whether to strip EOS and padding from the end of `ids`.

    Returns:
      A NoteSequence.
    """
    if strip_extraneous:
      ids = text_encoder.strip_ids(ids, list(range(self.num_reserved_ids)))

    # Decode indices corresponding to event n-grams back into the n-grams.
    event_ids = []
    for i in ids:
      if i >= self.unigram_vocab_size:
        event_ids += self._ngrams[i - self.unigram_vocab_size]
      else:
        event_ids.append(i)

    performance = note_seq.Performance(
        quantized_sequence=None,
        steps_per_second=self._steps_per_second,
        num_velocity_bins=self._num_velocity_bins)
    for i in event_ids:
      performance.append(self._encoding.decode_event(i - self.num_reserved_ids))

    ns = performance.to_sequence()

    return ns
def decode_to_note_sequence ( self , ids , strip_extraneous = False ) : if strip_extraneous : ids = text_encoder . strip_ids ( ids , list ( range ( self . num_reserved_ids ) ) ) # Decode indices corresponding to event n-grams back into the n-grams. event_ids = [ ] for i in ids : if i >= self . unigram_vocab_size : event_ids += self . _ngrams [ i - self . unigram_vocab_size ] else : event_ids . append ( i ) performance = note_seq . Performance ( quantized_sequence = None , steps_per_second = self . _steps_per_second , num_velocity_bins = self . _num_velocity_bins ) for i in event_ids : performance . append ( self . _encoding . decode_event ( i - self . num_reserved_ids ) ) ns = performance . to_sequence ( ) return ns