Why does lingvo use a binary mask instead of sequence lengths for representing invalid regions of sequences?

Abierto
#227 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
25/100
Tipo de issue
Documentación
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python, tensorflow

Línea de trabajo

Start by reading the Lingvo RNN batching code mentioned in the issue and compare its padding mask representation with TensorFlow's tf.nn.ctc_loss length input. Trace how the mask is formed and whether it can provide sequence lengths; the issue asks for the motivation and a recommendation for converting representations. Done means explaining the design choice and a sound conversion approach.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

I've noticed that the rnn code in lingvo (in particular for ASR tasks) uses bitmasks for representing the validity of data in a sequence when you do batching.

To be explicit, if you have, data, a tensor of (max_sequence_length, batch_size, feature_size), then padding is a tensor of (max_sequence_length, batch_size). The vector at data[i][j] is valid only if padding[i][j] == 1

Meanwhile, in the rest of deep learning land, I've always seen the validity of different-length-sequences in a minibatch described via a "length" tensor, of shape (batch_size, ). This obviously uses a lot less memory.

What is the motivation behind this? If I had to guess, it is for making TPUs happy, but I don't know enough about TPU microarchitecture to know. I would like to create a ctc model on top of lingvo, but the ctc loss function https://www.tensorflow.org/api_docs/python/tf/nn/ctc_loss requires a length tensor, rather than a bitmask tensor. Do you have any recommendations for how to convert the bitmask padding representation to a length padding representation?

Lenguaje dominante
Python
Estrellas
2.9k
Forks
452
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de tensorflow/lingvo

Todos los issues de tensorflow/lingvo

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.