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

Implement Query Method for Python Client #265

Open
crasanders opened this issue Mar 29, 2023 · 0 comments
Open

Implement Query Method for Python Client #265

crasanders opened this issue Mar 29, 2023 · 0 comments

Comments

@crasanders
Copy link
Contributor

crasanders commented Mar 29, 2023

The Python client can currently only send setup, ask, tell, and resume messages to the server. We would also like a query method that sends "query" messages to the server. This method would take in query_type, probability_space, and other arguments that get passed to the server's query method. See server.query, server.handle_query, and test_server.test_strat_query to see examples of "query" messages and what types of arguments can be sent.

Examples of use:

client.query(type="max") # return the x value with the highest y value in the form of a d-length vector, where d is the dimensionality. See the output of AEPsychModel.get_max.

client.query(type="min", locked_dims={0: [0, 1]}) # return the x value with the lowest y value in the form of a d-length vector; the first element must be between 0 and 1. See the output of AEPsychModel.get_min.

client.query(type="prediction", x=torch.tensor([[0, 1], [2,3]])) # return the model predictions at x=[0,1] and x=[2,3], in the form of a 2 n-length vectors, where n is the number of x values given. The first vector is the means, the second is the variances. See the output of BinaryClassificationGP.predict.

client.query(type="inverse", y=0.0) # # return the x value where y=0.0. Returns the actual y value of this point as a float as well as x in the form of a d-length vector, where d is the dimensionality. See the output of AEPsychModel.inv_query.
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

No branches or pull requests

1 participant