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

added surrogate model #2

Merged
merged 3 commits into from
Mar 27, 2024
Merged

added surrogate model #2

merged 3 commits into from
Mar 27, 2024

Conversation

akhilsnair2017
Copy link
Contributor

@akhilsnair2017 akhilsnair2017 commented Mar 27, 2024

Just have a doubt whether

y_copy = y.copy()
  for idx, mask in enumerate(self.params.target_bools):
  if not mask:
      y_copy[:, idx] *= -1
  # build the model
       pass

should be kept in the get_surrogate_model function or not

@mamunm
Copy link
Contributor

mamunm commented Mar 27, 2024

Just have a doubt whether

y_copy = y.copy()
  for idx, mask in enumerate(self.params.target_bools):
  if not mask:
      y_copy[:, idx] *= -1
  # build the model
       pass

should be kept in the get_surrogate_model function or not

Good point. You can create another function to correct the sign.

return model

return model, input_transform
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please check whether this is correct, I am bit doubtful regarding the function returning

@akhilsnair2017 akhilsnair2017 requested a review from mamunm March 27, 2024 17:47
Copy link
Contributor

@mamunm mamunm left a comment

Choose a reason for hiding this comment

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

It's almost done, but I'll add some changes later on my next push.

@@ -79,6 +84,26 @@ def get_surrogate_model(self, X, y):
returns:
model: Surrogate model for the MOBOQM9 model.
"""
X_scaled = Standardize(X)
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the changes. Instead of using Standardize, can you use input_transform and output_transform in the SingleTaskGP model?

src/mobo_qm9.py Outdated
else:
raise ValueError("Unsupported kernel type. Supported types are 'RBF', 'Matern', and 'Tanimoto'.")

model = SingleTaskGP(train_X, train_Y, likelihood=likelihood, kernel=kernel)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is only for single target optimization, can you use ModelListGP for multi-target?

@mamunm mamunm merged commit b439707 into main Mar 27, 2024
2 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.

2 participants