You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In exploring this library, I am trying to define a very particular parameter space for an optimization problem and am wondering if/how it can be implemented? I'm trying to do BO Experimental Design, and have defined my parameter space as the following:
Essentially, a 6 column matrix with each [[0,0.1,0.2...1]] in spacing of 0.1.
However, I would like to constrain this to have summation of x1 to x6 == 1. That is, only select x_new values to output a single vector but with the columns (x1 to x6) adding up to 1, rejecting any vector that does not meet this criteria.
Is this possible to implement? I have looked into the constraint libraries but have come up short. If not using constraints, is their a way to explicitly define that space (it will be a shape(2121,6) matrix in the end). My understanding is that a matrix cannot be used, but only a 1d or 2d (n,1) array can be used.
Thanks!
The text was updated successfully, but these errors were encountered:
Rblack999
changed the title
Parameter Space Constraint -
Parameter Space Constraint
Feb 13, 2022
Sounds like you just need to define a linear constraint. We support those, here is the doc link. Note that when your lower and upper bounds are the same, this turns into equality constraint, which is what you are after.
In exploring this library, I am trying to define a very particular parameter space for an optimization problem and am wondering if/how it can be implemented? I'm trying to do BO Experimental Design, and have defined my parameter space as the following:
parameter_space = ParameterSpace([DiscreteParameter('x1',np.linspace(0,1,11)),
DiscreteParameter('x2',np.linspace(0,1,11)),
DiscreteParameter('x3',np.linspace(0,1,11)),
DiscreteParameter('x4',np.linspace(0,1,11)),
DiscreteParameter('x5',np.linspace(0,1,11)),
DiscreteParameter('x6',np.linspace(0,1,11))])
Essentially, a 6 column matrix with each [[0,0.1,0.2...1]] in spacing of 0.1.
However, I would like to constrain this to have summation of x1 to x6 == 1. That is, only select x_new values to output a single vector but with the columns (x1 to x6) adding up to 1, rejecting any vector that does not meet this criteria.
Is this possible to implement? I have looked into the constraint libraries but have come up short. If not using constraints, is their a way to explicitly define that space (it will be a shape(2121,6) matrix in the end). My understanding is that a matrix cannot be used, but only a 1d or 2d (n,1) array can be used.
Thanks!
The text was updated successfully, but these errors were encountered: