def to_human_readable(self, data, label_batch_entries=True, indices=None,
                        sep="\n"):
    """Returns a human-readable version of a one-hot encoding of words.

    Args:
      data: (numpy.ndarray S x B x OH). One-hot encoding of words. S is
          sequence length, B is batch size, OH is one hot dimensionality.
      label_batch_entries: (bool). Whether to add numerical label before each
          batch element in the output string.
      indices: (list(int) or None). Used to select a subset of minibatch indices
          to print. None will print the whole minibatch.
      sep: (str) separator which separates the output for each batch. Defaults
          to the newline character.

    Returns:
      String composed from the data.
    """
    batch_size = data.shape[1]
    result = []
    indices = indices or six.moves.range(batch_size)
    for b in indices:
      index_seq = np.argmax(data[:, b], axis=1)
      prefix = "b_{}: ".format(b) if label_batch_entries else ""
      result.append(prefix + self._data_source.decode_to_string(index_seq))
    return sep.join(result)
def to_human_readable ( self , data , label_batch_entries = True , indices = None , sep = "\n" ) : batch_size = data . shape [ 1 ] result = [ ] indices = indices or six . moves . range ( batch_size ) for b in indices : index_seq = np . argmax ( data [ : , b ] , axis = 1 ) prefix = "b_{}: " . format ( b ) if label_batch_entries else "" result . append ( prefix + self . _data_source . decode_to_string ( index_seq ) ) return sep . join ( result )
Returns a human-readable version of a one-hot encoding of words.

    Args:
      data: (numpy.ndarray S x B x OH). One-hot encoding of words. S is
          sequence length, B is batch size, OH is one hot dimensionality.
      label_batch_entries: (bool). Whether to add numerical label before each
          batch element in the output string.
      indices: (list(int) or None). Used to select a subset of minibatch indices
          to print. None will print the whole minibatch.
      sep: (str) separator which separates the output for each batch. Defaults
          to the newline character.

    Returns:
      String composed from the data.