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

🐛 Bugfix rescale key list introduced by the multilayer pull #148

Merged
merged 2 commits into from
Feb 4, 2022

Conversation

nw13slx
Copy link
Collaborator

@nw13slx nw13slx commented Feb 4, 2022

Description

Motivation and Context

Resolves: #???

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds or improves functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation improvement (updates to user guides, docstrings, or developer docs)

Checklist:

  • My code follows the code style of this project and has been formatted using black.
  • All new and existing tests passed, including on GPU (if relevant).
  • I have added tests that cover my changes (if relevant).
  • The option documentation (docs/options) has been updated with new or changed options.
  • I have updated CHANGELOG.md.
  • I have updated the documentation (if relevant).

@nw13slx nw13slx changed the base branch from main to develop February 4, 2022 18:18
Comment on lines +859 to +871
if validation:
scaled_out = out
_data_unscaled = data
for layer in self.rescale_layers:
# loss function always needs to be in normalized unit
scaled_out = layer.unscale(scaled_out, force_process=True)
_data_unscaled = layer.unscale(_data_unscaled, force_process=True)
loss, loss_contrib = self.loss(pred=scaled_out, ref=_data_unscaled)
else:
# If we are in training mode, we need to bring the prediction
# into real units
for layer in self.rescale_layers[::-1]:
out = layer.scale(out, force_process=True)
Copy link
Collaborator

Choose a reason for hiding this comment

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

this looks correct--- have you tested it?

nequip/model/_scaling.py Show resolved Hide resolved
@Linux-cpp-lisp Linux-cpp-lisp merged commit c043849 into develop Feb 4, 2022
@Linux-cpp-lisp Linux-cpp-lisp deleted the bugfix_rescale branch February 4, 2022 22:05
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