Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Wanted: Black box example #5

Open
thhart opened this issue Sep 12, 2017 · 5 comments
Open

Wanted: Black box example #5

thhart opened this issue Sep 12, 2017 · 5 comments

Comments

@thhart
Copy link

thhart commented Sep 12, 2017

Hi, I am looking for a way to hook in a black box problem. I have a given set of variables which are used in my box. The box is evaluating the variables and spits out a simple real value which have to be maximized. Which interface must the box implement? Can you give a simple example please?

@cprudhom
Copy link
Member

Hi,

I don't know what is a box for you, at least you have to define to declare a model, some variables and constraints over variables, define an objective function if needed and ask the solver for a/the optimal solution.

There is no specific interface to implement.
Many users do not extend AbstractProblem even if it offers a simple way to set up, build and solve a problem. But keep in mind that is a implementation choice driven by 1) having homogeneous classes and 2) offering the possibility to run them automatically.

@thhart
Copy link
Author

thhart commented Sep 14, 2017

Hi Charles, I am speaking of a black box like this: "The goal of optimization is to find an as good as possible value f(x) within a predefined time, often defined by the number of available queries to the black box. Problems of this type regularly appear in practice, e.g., when optimizing parameters of a model that is either in fact hidden in a black box (e.g., a third party software library) or just too complex to be modeled explicitly." (https://bbcomp.ini.rub.de)

So in fact I can not model my problem into a set of constraints. But I can give out a value to be maximized dependent of the variables. The challenge for a solver is now to chose good variable value tuples to narrow to probably global maxima. The problem is usually not as bad gradiented as it sounds.

PS: I don't want to use the solver in a challenge as cited above, I really want to use it for real world problem though. ;-)

@cprudhom
Copy link
Member

Hi Thomas,

I never heard about such competition.
So to rephrase the objective: you are given a set of variables, their domains and a black box you can query.
For a given tuple, the box evaluates a hidden function and returns its value.
The goal is to find a tuple that optimize the function in a limited number of query.

Your idea is to first estimate the function with some queries (as little as possible) and then, before an ultimate query, to compute the optimale solution.
Am I right ?

@thhart
Copy link
Author

thhart commented Sep 14, 2017

Yes, your summary is right.

Your idea is to first estimate the function with some queries (as little as possible) and then, before an ultimate query, to compute the optimale solution.

Some queries is really relative and heavily depends on black box response time of course. I am speaking here of milliseconds to a small number of seconds to evaluate a tuple set just to give an impression. Evaluation might be parallelized of course via appropriate frameworks (Spark) or simple threading.

The challenge for a solver is now to narrow each variable within its domain to find optimums in reasonable time dependent on the output of the black box. From the output it might be able to detect gradients to "dive" into optimums.

@cprudhom
Copy link
Member

I have two remarks:

  • the website you cited talked about "continuous black box", if continuous refers to the type of domain, you should consider a continuous CP solver, like Ibex.
  • as far as I understand, your request as more to do with learning which is out of the scope of choco, which expects a model (variables + constraints) as input and is not able to learn a model. Something like a Global Constraint Seeker -- articel or Constraint acquisition

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

No branches or pull requests

2 participants