Bayesian optimization with sum constraint

조회 수: 6 (최근 30일)
Federico
Federico 2020년 12월 29일
댓글: Alan Weiss 2021년 1월 4일
I have an issue with the implementation of a particular problem to be optimized with a Bayesian Optimization (it could be argued that it is not the best choice for this particular case, but let's say I have no other choices).
Now, I have N decisional variables. These variables control the way a time series is quantized into discrete values. Without going into much details, I want to optimize a performance index related to the way the signal is quantized. So, there is an optimal quantization, which does not consist in equally spaced intervals, and I want to find this quantization.
Now, each decisional variable is the space between two dotted lines in the figure above (in that example, ). Ideally, this signal has a maximum value B. Therefore, each decisional variable is bounded in the interval . Moreover, they can be set to integer (no need for more precision).
For the very nature of the problem, I want the maximum possible generalization, so I would like the optimizer to take into account every possible combination of variables, with the only constraint being of course the following:
where are the variables. Still, I want every to assume any possible value in the defined interval. So for instance extreme choices where one variable is equal to B and the other ones are 0 should be feasible and possibly generated.
If I try to set the number of variables to or so (I would need to work with similar numbers), the Bayesian Optimization fails at attempting to find feasible sets of parameters: it eventually generates 10000 combinations of variables, but no combinations (or at most 1-2 of them) satisfy the sum constraint. Now, is there a way to increase the number of randomly generated variables (let's say from 10000 up to 10^7 or even more), so that enough combinations are produced satisfying this constraint?
Thank you in advance!

답변 (1개)

Alan Weiss
Alan Weiss 2020년 12월 30일
편집: Alan Weiss 2020년 12월 30일
This sounds like a balls-in-buckets problem. You have up to B balls to place into N buckets. The occupancy (number of balls) of bucket i is .
What I am suggesting is that you can generate random occupancies by this balls-in-buckets mechanism. The Statistics and Machiie Learning Toolbox™ mnrnd function can generate these random samples for fixed B and N. For example, if and , you can generate 10 random samples as follows:
N = 50;
B = 20;
p = ones(1,N)/N;
A = mnrnd(B,p,10);
The resulting matrix A has 10 rows, each row represents one of your variables a.
If, instead, you are looking to generate all possible occupancies, ask again. But I think that this mechanism gives you a good way of thinking about how to generate feasible samples.
Alan Weiss
MATLAB mathematical toolbox documentation
  댓글 수: 4
Federico
Federico 2021년 1월 4일
편집: Federico 2021년 1월 4일
Thank you Alan.
I tried, but at the second iteration, the algorithm starts again by selecting random points and eventually fails. Is there way to directly modify the acquisition function code, so I can control the random points generation procedure?
Alan Weiss
Alan Weiss 2021년 1월 4일
I am not sure, but you might be able to get your optimization going by using Conditional Constraints. In your conditional constraint function, check that the passed points satisfy the constraint, and if not, change them so that they do.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by