Filter löschen
Filter löschen

Mixed integer optimization gives infeasible solutions if trying to maximise an objective it was already able to minimize.

1 Ansicht (letzte 30 Tage)
I'm attempting to verify some properties of neural networks using mixed integer optimization but am struggling to see why my constraints aren't working. This is my problem:
and
. for
I approximated the last constraint using a binary variable a and other inequalties, as it is non linear:
and if or if .
I implemented this using the following code (I've included the full function in the attachments):
constraints.c1 = z_1_hat== W{1}*z_0+b{1};
constraints.c2 = z_2_hat== W{2}*z_1+b{2};
constraints.c3 = z_1>=0;
constraints.c4 = z_1>=z_1_hat;
constraints.c5 = optimconstr(size(Z_max{1}));
constraints.c6 = optimconstr(size(Z_max{1}));
for j=1:size(Z_max{1})
if Z_hat_max{1}(j)<=0
constraints.c5(j) = z_1(j)<=0; constraints.c6(j) = z_1(j)<=0;
elseif Z_hat_min{1}(j)>=0
constraints.c5(j) = z_1(j)<=z_1_hat(j); constraints.c6(j) = z_1(j)<=z_1_hat(j);
else
constraints.c5(j) = z_1(j)<=z_1_hat(j)-Z_hat_min{1}(j)*(1-a1(j));
constraints.c6(j) = z_1(j)<=Z_hat_max{1}(j)*a1(j);
end
end
It does provide feasible solutions as expected for several "properties", but for others it is unable to either maximise the cost function (even though it is able to minimise it) or vice versa. I'm not sure why this is happening because I am pretty certain my constraints are well defined. I've included the two functions required to run the code and 2 property.mat files that fail to give feasible solutions and two that do give feasible solutions. If anyone can explain why my code is failing I would appreciate it greatly.

Antworten (0)

Kategorien

Mehr zu Robust Control Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by