ibp
bound_ibp(model, ptb, data, target, n_classes=10, bound_upper=False, reuse_input=False)
Compute the lower and upper bounds of the model's output using the IBP method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model
|
BoundedModule
|
The neural network model for which bounds are to be computed. |
required |
ptb
|
PerturbationLpNorm
|
The perturbation object defining the perturbation set. |
required |
data
|
Tensor
|
The input data tensor. |
required |
target
|
Tensor
|
The target labels tensor. Default is None. |
required |
n_classes
|
int
|
The number of classes for classification. Default is 10. |
10
|
bound_upper
|
bool
|
Whether to compute the upper bound. Default is False. |
False
|
reuse_input
|
bool
|
Whether to reuse the input data from previous bounding operation. Default is False. |
False
|
Returns:
Type | Description |
---|---|
Tuple[Tensor, Tensor]
|
The lower and upper bounds of the model's output. |
Source code in CTRAIN/bound/ibp.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|