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

The description and the behavior don't match #142

Open
yongchanghao opened this issue Oct 26, 2023 · 2 comments
Open

The description and the behavior don't match #142

yongchanghao opened this issue Oct 26, 2023 · 2 comments

Comments

@yongchanghao
Copy link

In the following code, the comment says weight A is init as usual (kaiming init as in other places in the code) and B as zeros. However, the behavior is quite the opposite:

LoRA/loralib/layers.py

Lines 58 to 60 in 3f5c193

# initialize A the same way as the default for nn.Linear and B to zero
nn.init.zeros_(self.lora_A)
nn.init.normal_(self.lora_B)

Is this intended? Thanks.

@edwardjhu
Copy link
Collaborator

I fixed the comment. Thanks!

@yongchanghao
Copy link
Author

Thank you. May I know the reason why the matrix A is set to 0 here, unlike other parts (and the paper) where B is 0?

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

2 participants