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

Allow any model architecture #3

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open

Allow any model architecture #3

wants to merge 22 commits into from

Conversation

ClashLuke
Copy link
Collaborator

No description provided.

@ClashLuke ClashLuke marked this pull request as ready for review January 15, 2023 21:15
@ClashLuke ClashLuke changed the title WIP: Allow any model architecture Allow any model architecture Jan 15, 2023
@ClashLuke
Copy link
Collaborator Author

ClashLuke commented Jan 15, 2023

Works well. example notebook

@ClashLuke ClashLuke requested a review from dvruette January 16, 2023 12:25
Copy link
Owner

@dvruette dvruette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Ideally we would update at least the test/autoencoder.py example (and the README) for future reference.

I've left some comments where I didn't quite understand.

Another thing I've noticed yesterday is that torch.autograd.grad doesn't work with integer tensors as inputs, which happens e.g. when using nn.Embedding. Not sure if this is easily resolvable, so we don't need to address it now. But something to keep in mind for the future.

locoprop/layer.py Outdated Show resolved Hide resolved
locoprop/layer.py Show resolved Hide resolved
locoprop/layer.py Outdated Show resolved Hide resolved
@dvruette
Copy link
Owner

While training seems to work with Lightning, the standard training loop breaks for some reason: https://colab.research.google.com/drive/1hNLavl5jYgf7-DxfmnTucyCAcMHS4y4c?usp=sharing

Don't really know what's going on, the only difference is the training loop AFAICT.

@ClashLuke
Copy link
Collaborator Author

We get roughly the same convergence with an outer learning rate of 0.01. Look at this copy of your notebook.
Does the lightning trainer do some gradient scaling internally?

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.

2 participants