Skip to content

Commit

Permalink
Update layers.py
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardjhu authored Oct 29, 2023
1 parent 3f5c193 commit a0a92e0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion loralib/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ def __init__(
def reset_parameters(self):
nn.Linear.reset_parameters(self)
if hasattr(self, 'lora_A'):
# initialize A the same way as the default for nn.Linear and B to zero
# initialize B the same way as the default for nn.Linear and A to zero
# this is different than what is described in the paper but should not affect performance
nn.init.kaiming_uniform_(self.lora_A, a=math.sqrt(5))
nn.init.zeros_(self.lora_B)

Expand Down

0 comments on commit a0a92e0

Please sign in to comment.