Skip to content

Commit

Permalink
Merge pull request #99 from usnistgov/develop
Browse files Browse the repository at this point in the history
Fix atomwise default settings.
  • Loading branch information
knc6 committed May 1, 2023
2 parents 4820737 + 7bb6437 commit a8e8c38
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion alignn/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""Version number."""
__version__ = "2023.04.27"
__version__ = "2023.04.30"
6 changes: 3 additions & 3 deletions alignn/ff/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"val_ratio": 0.05,
"test_ratio": 0.05,
"target_multiplication_factor": null,
"epochs": 500,
"epochs": 100,
"batch_size": 16,
"weight_decay": 1e-05,
"learning_rate": 0.001,
Expand Down Expand Up @@ -52,7 +52,7 @@
"output_features": 1,
"grad_multiplier": -1,
"calculate_gradient": true,
"atomwise_output_features": 3,
"atomwise_output_features": 0,
"graphwise_weight": 1.0,
"gradwise_weight": 10.0,
"stresswise_weight": 0.0,
Expand All @@ -61,4 +61,4 @@
"zero_inflated": false,
"classification": false
}
}
}
2 changes: 1 addition & 1 deletion alignn/models/alignn_atomwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ALIGNNAtomWiseConfig(BaseSettings):
output_features: int = 1
grad_multiplier: int = -1
calculate_gradient: bool = True
atomwise_output_features: int = 3
atomwise_output_features: int = 0
graphwise_weight: float = 1.0
gradwise_weight: float = 0.0
stresswise_weight: float = 0.0
Expand Down
7 changes: 4 additions & 3 deletions alignn/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,8 @@ def get_batch_errors(dat=[]):
# )

if (
config.model.atomwise_output_features is not None
config.model.atomwise_output_features > 0
# config.model.atomwise_output_features is not None
and config.model.atomwise_weight != 0
):
loss2 = config.model.atomwise_weight * criterion(
Expand Down Expand Up @@ -514,7 +515,7 @@ def get_batch_errors(dat=[]):
result["out"].cpu().detach().numpy().tolist()
)
if (
config.model.atomwise_output_features is not None
config.model.atomwise_output_features > 0
and config.model.atomwise_weight != 0
):
loss2 = config.model.atomwise_weight * criterion(
Expand Down Expand Up @@ -622,7 +623,7 @@ def get_batch_errors(dat=[]):
result["out"].cpu().detach().numpy().tolist()
)

if config.model.atomwise_output_features is not None:
if config.model.atomwise_output_features > 0:
loss2 = config.model.atomwise_weight * criterion(
result["atomwise_pred"].to(device),
dats[0].ndata["atomwise_target"].to(device),
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setuptools.setup(
name="alignn",
version="2023.04.27",
version="2023.04.30",
author="Kamal Choudhary, Brian DeCost",
author_email="kamal.choudhary@nist.gov",
description="alignn",
Expand Down

0 comments on commit a8e8c38

Please sign in to comment.