Skip to content

Conversation

@vascosmota
Copy link
Contributor

On Algorithms 9 and 10, the embeddings matrix $\mathbf{W}^e \in \mathbb{R}^{E \times I}$ was shape $(E, I)$. The initialization of the RNN on lxmls/deep_learning/rnn.py initializes a $\mathbf{W}^e$ with shape $(I, E)$ (input_size, embedding_size) instead.

This change makes $\mathbf{W}^e$ have shape $(E, I)$ and also updates the NumpyRNN.log_forward method to account for the new shape.

Also on this PR is the rename of the argument input (a python builtin function) to `model_input* across multiple functions. Maybe we want to move this to a different PR.

Remove usage of reserved keyword "input".
@vascosmota vascosmota changed the title Change embeddings matrix shape to (E,I) on RNN fix: Change embeddings matrix shape to (E,I) on RNN Jul 7, 2025
@ramon-astudillo
Copy link
Member

I think the overloading of "input" is fine in this context. I'd rather keep the naming consistent.

can you move this PR to master?

(sorry for the late response)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants