Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mace/modules/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def compute_forces_virials(
create_graph=training, # Create graph for second derivative
allow_unused=True,
)
stress = torch.zeros_like(displacement)
stress = None
if compute_stress and virials is not None:
cell = cell.view(-1, 3, 3)
volume = torch.linalg.det(cell).abs().unsqueeze(-1)
Expand Down
4 changes: 4 additions & 0 deletions mace/tools/tables_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def create_error_table(
)
elif (
table_type == "PerAtomRMSEstressvirials"
and "rmse_stress" in metrics
and metrics["rmse_stress"] is not None
):
table.add_row(
Expand All @@ -161,6 +162,7 @@ def create_error_table(
)
elif (
table_type == "PerAtomRMSEstressvirials"
and "rmse_virials" in metrics
and metrics["rmse_virials"] is not None
):
table.add_row(
Expand All @@ -174,6 +176,7 @@ def create_error_table(
)
elif (
table_type == "PerAtomMAEstressvirials"
and "mae_stress" in metrics
and metrics["mae_stress"] is not None
):
table.add_row(
Expand All @@ -187,6 +190,7 @@ def create_error_table(
)
elif (
table_type == "PerAtomMAEstressvirials"
and "mae_virials" in metrics
and metrics["mae_virials"] is not None
):
table.add_row(
Expand Down
4 changes: 4 additions & 0 deletions mace/tools/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def valid_err_log(
)
elif (
log_errors == "PerAtomRMSEstressvirials"
and "rmse_stress" in eval_metrics
and eval_metrics["rmse_stress"] is not None
):
error_e = eval_metrics["rmse_e_per_atom"] * 1e3
Expand All @@ -78,6 +79,7 @@ def valid_err_log(
)
elif (
log_errors == "PerAtomRMSEstressvirials"
and "rmse_virials_per_atom" in eval_metrics
and eval_metrics["rmse_virials_per_atom"] is not None
):
error_e = eval_metrics["rmse_e_per_atom"] * 1e3
Expand All @@ -88,6 +90,7 @@ def valid_err_log(
)
elif (
log_errors == "PerAtomMAEstressvirials"
and "mae_stress_per_atom" in eval_metrics
and eval_metrics["mae_stress_per_atom"] is not None
):
error_e = eval_metrics["mae_e_per_atom"] * 1e3
Expand All @@ -98,6 +101,7 @@ def valid_err_log(
)
elif (
log_errors == "PerAtomMAEstressvirials"
and "mae_virials_per_atom" in eval_metrics
and eval_metrics["mae_virials_per_atom"] is not None
):
error_e = eval_metrics["mae_e_per_atom"] * 1e3
Expand Down
Loading