From 98e9fcfebf9b825b91e84e17755ec9b140d0e7bf Mon Sep 17 00:00:00 2001 From: Carolin Date: Fri, 1 Nov 2024 13:58:11 +0100 Subject: [PATCH] change scaling factor from ratio to multiplicative parameter --- micro_sam/models/peft_sam.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/micro_sam/models/peft_sam.py b/micro_sam/models/peft_sam.py index 3359de01..9b37ceeb 100644 --- a/micro_sam/models/peft_sam.py +++ b/micro_sam/models/peft_sam.py @@ -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