Skip to content

Commit

Permalink
change scaling factor from ratio to multiplicative parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
caroteu committed Nov 1, 2024
1 parent 9eb4d0c commit 98e9fcf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions micro_sam/models/peft_sam.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def reset_parameters(self):

def forward(self, x):
qkv = self.qkv_proj(x) # B, N, N, 3 * org_C
new_q = self.alpha / self.rank * self.w_b_linear_q(self.w_a_linear_q(x))
new_v = self.alpha / self.rank * self.w_b_linear_v(self.w_a_linear_v(x))
new_q = self.alpha * self.w_b_linear_q(self.w_a_linear_q(x))
new_v = self.alpha * self.w_b_linear_v(self.w_a_linear_v(x))
qkv[:, :, :, :self.dim] += new_q
qkv[:, :, :, -self.dim:] += new_v
return qkv
Expand Down

0 comments on commit 98e9fcf

Please sign in to comment.