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

Scaling bugs fixes #72

Merged
merged 5 commits into from
Oct 8, 2020
Merged

Conversation

zakv
Copy link
Collaborator

@zakv zakv commented Oct 8, 2020

There are a few bugs with scalings, which I've patched in this PR.

The first one is that the uncertainties were scaled the wrong way in GuassianProcessLearner. When normalizing costs, the cost_scaler divides them by cost_scaler.scale_ (see here) and when rescaling costs back to their original range it multiplies the scaled cost by cost_scaler.scale_ (see here). The same should be done for the uncertainties, but previously the multiplication and division were switched. This PR corrects that issue. Furthermore the uncertainties in GaussianProcessVisualizer.return_cross_sections() weren't rescaled back, and this has been corrected as well.

The second issue is more minor. The value of cross_parameter_arrays in GaussianProcessLearner.return_cross_sections() and NeuralNetLearner.return_cross_sections() was scaled previously, but does not need to be scaled. When it is created, its values go between self.min_boundary and self.max_boundary which aren't scaled, so there's no scaling to undo. This was likely a small mix-up where the scaling was meant to be applied to uncertainty_arrays but was accidentally applied to cross_parameter_arrays instead, and then that mix-up was copy/pasted to NeuralNetVisualizer.return_cross_sections() . Fortunately the value returned for cross_parameter_arrays isn't used anywhere in M-LOOP, so it didn't cause any other issues.

Changes proposed in this pull request:

  • Correct uncertainty scaling in GaussianProcessLearner and GaussianProcessVisualizer
  • Correct cross_parameter_arrays scaling in GaussianProcessVisualizer and NeuralNetVisualizer

@qctrl/support @charmasaur

zakv added 5 commits October 7, 2020 19:12
The values in cross_parameter_arrays range from self.min_boundary to self.max_boundary which are already in real units, so it doesn't need to be scaled. The uncertainty arrays on the other hand do need to be unscaled
Changed variable names to be consistent with convention that normalized values are "scaled" while un-normalized values are "unscaled".
…ake it more clear when costs are/aren't scaled.
@zakv
Copy link
Collaborator Author

zakv commented Oct 8, 2020

I should also mention that there are a lot of scalings done in neuralnet.py. I haven't tested any of those, but they all looked correct when I read through them!

Copy link
Collaborator

@charmasaur charmasaur left a comment

Choose a reason for hiding this comment

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

Nice catch!

@charmasaur charmasaur merged commit 4c2e37b into michaelhush:master Oct 8, 2020
@zakv zakv deleted the uncertainty-bugs-fixes branch October 8, 2020 17:56
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