Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide better logging #37

Merged
merged 7 commits into from
Jan 26, 2024
Merged

Provide better logging #37

merged 7 commits into from
Jan 26, 2024

Conversation

frostedoyster
Copy link
Collaborator

@frostedoyster frostedoyster commented Jan 25, 2024

Copy link
Contributor

@PicoCentauri PicoCentauri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice job! I have one minor possible improvement.

Question is if you want to test the logging somehow. It could be done and if you like I can show it to you.

Comment on lines 165 to 185
for key, value in aggregated_train_info.items():
if key.endswith("_positions_gradients"):
# check if this is a force
target_name = key[: -len("_positions_gradients")]
if model.capabilities.outputs[target_name].quantity == "energy":
# if this is a force, replace the ugly name with "force"
if only_one_energy:
key = "force"
else:
key = f"force[{target_name}]"
elif key.endswith("_displacement_gradients"):
# check if this is a virial/stress
target_name = key[: -len("_displacement_gradients")]
if model.capabilities.outputs[target_name].quantity == "energy":
# if this is a virial/stress,
# replace the ugly name with "virial/stress"
if only_one_energy:
key = "virial/stress"
else:
key = f"virial/stress[{target_name}]"
logging_string += f", train {key} RMSE: {value:10.4f}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block and the one below seem to me exactly the same. Maybe just do another outer loop?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good idea

@frostedoyster
Copy link
Collaborator Author

For now, I would merge it. I will open an issue about cleaning up the logging, which will also cover other aspects of the logger

@frostedoyster frostedoyster merged commit e07e2a8 into main Jan 26, 2024
6 of 7 checks passed
@frostedoyster frostedoyster deleted the better-logging branch January 26, 2024 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants