NeuralNetworkVerification/Marabou

Pyhtonic API multiple constraints lead to replacement

Closed this issue · 3 comments

Dear Marabou developers,

Currently, I am working on a local robustness query in the Marabou pythonic API.
See code:

 
 #X_hw : input variable
# I_hw : pixel value of input
 #Setting upper and lower bound based on the problem statement
network.setLowerBound(X_hw, lowerbound)
 network.setUpperBound(X_hw, upperbound)
            
 '''#Setting local robustness property constraints on the input. '''
 network.addConstraint(Var(X_hw) >= I_hw - epsilon )
 network.addConstraint(Var(X_hw) <= I_hw + epsilon )


A problem I am encountering is that when I add the first two constraints, the input variables are all clipped between UB and LB, however when I add the second set of constraints, I encounter input bounds that are lower than LB and higher than UB.

Ofcourse I can calculate the min max before adding the constraints to the MIP, but this could become a problem when my MIP eventually becomes more complex.

My question: Is it possible to add multiple constraints on the input or are the first constraints overwritten by the later constraints?

Kindly

Unfortunately, this is not possible. You would need to check one set of constraints at a time.

Thank you for your quick answer!
Not being able to have multiple input constraints could be worked around here, but in the future we might as a community want to check more complex properties. Just out of curiosity, are you guys already working on this as a feature?

Not being able to have multiple input constraints could be worked around here, but in the future we might as a community want to check more complex properties. Just out of curiosity, are you guys already working on this as a feature?

One of the points of Vehicle is to be able handle such constraints naturally 😄