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

Sampler connected to a REST API #25

Open
glouppe opened this issue Mar 3, 2016 · 3 comments
Open

Sampler connected to a REST API #25

glouppe opened this issue Mar 3, 2016 · 3 comments

Comments

@glouppe
Copy link
Contributor

glouppe commented Mar 3, 2016

We have this idea of having something similar to carl.distributions.Sampler but connected to a REST API (instead of sampling from a fixed given array).

@lukasheinrich I think you already have something along these lines. Could you comment on the expected REST API? or an example?

CC: @cranmer

@cranmer
Copy link
Member

cranmer commented Mar 3, 2016

@lukasheinrich needs to add the actual REST API first, but it's mainly working

https://github.com/aretha-hep/aretha-doc

@lukasheinrich
Copy link

Since we don't have an API yet, we can design it around an actual usecase. what would the needed API endpoints look like? Do you need the events streamed as a file? Or would something else work as well (database?)

Would something like curl api.aretha.io/<sampleid> > file work?
Also what format would the events need to be in?

@glouppe
Copy link
Contributor Author

glouppe commented Mar 4, 2016

I think it can be quite simple. We would need to able to implement the following methods:

  • rvs(n_samples): this should return an array of n_samples samples. Under the hood, this should call the REST api to fetch these.
  • pdf(X): X is an array of samples, where each row is an individual sample. This should return an array of size len(X), where is each value is pdf(X[i]). (This is optional; as we will usually assume the likelihood-free setup)
  • nnlf(X): same as pdf(X) but for the negative log-likelihood. (Again, this is optional)

In some way or another, the generator behind the REST api should also be tied to model parameters that can be specified when making requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants