graykode / graykode/nlp-tutorial
Why is src_len+1 in Transformer demo?
Abierto
- Lenguaje dominante
- Jupyter Notebook
- Estrellas
- 14.9k
- Forks
- 3.9k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
self.pos_emb = nn.Embedding.from_pretrained(get_sinusoid_encoding_table(src_len+1, d_model),freeze=True)
The position encoding table should be (max_len, d_model), why add 1?
Guía de contribución
Línea de trabajo
Locate the Transformer demo containing the nn.Embedding.from_pretrained line and inspect get_sinusoid_encoding_table(src_len+1, d_model). Check how source positions are indexed and whether the extra position is required. Done means documenting a clear explanation of why src_len+1 is used, or confirming that the call should use src_len.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- pytorch
- Área
- documentation, machine-learning
- Tipo de issue
- Documentación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100