Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do we want to teach Pytorch? #211

Open
bpopeters opened this issue Jul 16, 2024 · 0 comments
Open

How do we want to teach Pytorch? #211

bpopeters opened this issue Jul 16, 2024 · 0 comments

Comments

@bpopeters
Copy link
Contributor

When people actually write models in pytorch, they typically follow this structure: namely, you subclass nn.Module and define __init__ and forward. This is the structure used by the transformer code, but not by any of the pytorch code used for other models. This makes things confusing at both ends:

  • PytorchRNN is not how anyone would choose to write the model, so students will be confused if they don't know pytorch and misled if they do not
  • The students are confused by the way the transformer works (for example, many had never seen an nn.Linear module before and were trying to treat it like it was a weight matrix.

Things should clearly not be this way: we're teaching pytorch badly for the sole purpose of making the pytorch code look as much like numpy as possible. Why are we doing that? Why are we even having them implement these models in numpy? I think the original reason is that students were more familiar with numpy, but I doubt that's a good enough reason to keep two parallel implementations in different frameworks.

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

No branches or pull requests

1 participant