Define constraints on neurons of a neural network. Assuming neuron x, constants a b, and an affine transformation a * x + b, then example constraints are a * x + b <= or >= or == a' * x' + b'. Attributes: combination: an instance of the VarAffine class, i.e., affine transfo
| 200 | |
| 201 | @dataclass() |
| 202 | class VarConstraint: |
| 203 | """ |
| 204 | Define constraints on neurons of a neural network. |
| 205 | Assuming neuron x, constants a b, and an affine transformation a * x + b, |
| 206 | then example constraints are a * x + b <= or >= or == a' * x' + b'. |
| 207 | |
| 208 | Attributes: |
| 209 | combination: an instance of the VarAffine class, i.e., affine transformation of neuron(s) |
| 210 | isEquality: whether it is an equality or inequality, i.e., True if ==; False if >= or <=. |
| 211 | lowerBound: whether it is a lower bound, e.g., True if x + b >= b'. |
| 212 | upperBound: whether it is an upper bound, e.g., True if x + b <= b'. |
| 213 | """ |
| 214 | combination: VarAffine |
| 215 | isEquality: bool |
| 216 | lowerBound: Optional[float] |
| 217 | upperBound: Optional[float] |
| 218 | |
| 219 | |
| 220 | def Var(index): |