mirror of
https://github.com/SakanaAI/doc-to-lora.git
synced 2026-07-23 17:01:04 +02:00
training working!: l2norm before head
This commit is contained in:
parent
cd28af25c0
commit
c5cae72d1d
1 changed files with 2 additions and 3 deletions
|
|
@ -776,8 +776,6 @@ class HyperLoRA(nn.Module):
|
|||
]
|
||||
else:
|
||||
layers = [
|
||||
# nn.Linear(self.d_latent, self.d_latent),
|
||||
# nn.LayerNorm(self.d_latent),
|
||||
MLPResidualBlock(
|
||||
input_size=self.config.latent_size,
|
||||
hidden_size=self.config.latent_size * 4,
|
||||
|
|
@ -1051,7 +1049,8 @@ class HyperLoRA(nn.Module):
|
|||
flat_loras = None
|
||||
if self.target_modules:
|
||||
lora_emb = self.layers(lora_emb)
|
||||
flat_loras = self.head(lora_emb)
|
||||
norm_lora_emb = lora_emb / torch.norm(lora_emb, dim=-1, keepdim=True)
|
||||
flat_loras = self.head(norm_lora_emb)
|
||||
|
||||
flat_layernorms = None
|
||||
if self.num_extra_modules:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue