microsoft/LoRA

The description and the behavior don't match

yongchanghao opened this issue · 2 comments

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.

I fixed the comment. Thanks!

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?