Skip to content

Commit

Permalink
add trainable ln option
Browse files Browse the repository at this point in the history
  • Loading branch information
iProzd committed Dec 9, 2024
1 parent 5f45320 commit be45407
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions deepmd/pt/model/descriptor/repformer_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,10 +552,16 @@ def __init__(

if self.update_style == "res_layer":
self.g1_layernorm = nn.LayerNorm(
self.g1_dim, device=env.DEVICE, dtype=self.prec
self.g1_dim,
device=env.DEVICE,
dtype=self.prec,
elementwise_affine=trainable_ln,
)
self.g2_layernorm = nn.LayerNorm(
self.g2_dim, device=env.DEVICE, dtype=self.prec
self.g2_dim,
device=env.DEVICE,
dtype=self.prec,
elementwise_affine=trainable_ln,
)

self.update_residual = update_residual
Expand Down Expand Up @@ -742,7 +748,10 @@ def __init__(
if self.has_angle:
if self.update_style == "res_layer":
self.angle_layernorm = nn.LayerNorm(
self.a_dim, device=env.DEVICE, dtype=self.prec
self.a_dim,
device=env.DEVICE,
dtype=self.prec,
elementwise_affine=trainable_ln,
)
angle_seed = 20
self.angle_dim = self.a_dim
Expand Down

0 comments on commit be45407

Please sign in to comment.