Skip to content

Commit

Permalink
update snapshot; fix test seed and change tolerance
Browse files Browse the repository at this point in the history
  • Loading branch information
misko committed Aug 16, 2024
1 parent eee8bf1 commit 46bee2f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/fairchem/core/models/equiformer_v2/equiformer_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,6 @@ def __init__(
)

self.apply(partial(eqv2_init_weights, weight_init=self.weight_init))
# self.apply(eqv2_uniform_init_rad_func_linear_weights)

def _init_gp_partitions(
self,
Expand Down
4 changes: 2 additions & 2 deletions tests/core/models/__snapshots__/test_equiformer_v2.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
# ---
# name: TestEquiformerV2.test_gp.1
Approx(
array([-0.03269595], dtype=float32),
array([0.12408739], dtype=float32),
rtol=0.001,
atol=0.001
)
Expand All @@ -69,7 +69,7 @@
# ---
# name: TestEquiformerV2.test_gp.3
Approx(
array([ 0.00208857, -0.00017979, -0.0028318 ], dtype=float32),
array([ 1.4928661e-03, -7.4134863e-05, 2.9909245e-03], dtype=float32),
rtol=0.001,
atol=0.001
)
Expand Down
3 changes: 2 additions & 1 deletion tests/core/models/test_rank2_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def batch():
def test_rank2_head(
batch, decompose, edge_level_mlp, use_source_target_embedding, extensive
):
torch.manual_seed(100) # fix network initialization
backbone = EquiformerV2Backbone(
num_layers=2,
sphere_channels=8,
Expand All @@ -58,7 +59,7 @@ def test_rank2_head(
assert r2_out["out_isotropic"].shape[1] == 1
tensor = _reshape_tensor(r2_out["out_isotropic"])
# anisotropic must be traceless
assert torch.diagonal(tensor).sum().item() == pytest.approx(0.0, abs=1e-8)
assert torch.diagonal(tensor).sum().item() == pytest.approx(0.0, abs=2e-8)
else:
assert "out" in r2_out
tensor = r2_out["out"].view(3, 3)
Expand Down

0 comments on commit 46bee2f

Please sign in to comment.