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

Refactor constraints #78

Merged
merged 5 commits into from
Nov 27, 2024
Merged

Conversation

thomaswmorris
Copy link
Contributor

This PR adds two important features:

  • You can have an objective that has both a target and a constraint, e.g. "I want my beam to be as small as possible, but definitely at least this small".
  • You can use only constraints "I just want my beam to be in this spot and at least this small, otherwise I don't care"

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@thomaswmorris thomaswmorris marked this pull request as ready for review November 21, 2024 05:53
@mrakitin mrakitin requested a review from jennmald November 26, 2024 16:49
Copy link
Member

@mrakitin mrakitin left a comment

Choose a reason for hiding this comment

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

Looks good, went through that with @thomaswmorris interactively.
Just a couple of minor comments below.

@@ -184,7 +182,7 @@ def refresh(self):
def redigest(self):
self._table = self.digestion(self._table, **self.digestion_kwargs)

def sample(self, n: int = DEFAULT_MAX_SAMPLES, method: str = "quasi-random") -> torch.Tensor:
def sample(self, n: int = DEFAULT_MAX_SAMPLES, normalize: bool = False, method: str = "quasi-random") -> torch.Tensor:
Copy link
Member

Choose a reason for hiding this comment

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

Please add the normalize parameter into the docstring.

@thomaswmorris thomaswmorris merged commit 1e747ea into NSLS-II:main Nov 27, 2024
6 checks passed
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.

3 participants