Closed nurlanov-zh closed 2 years ago
Intermediate bounds for node
can be accessed by node.lower
and node.upper
.
model._modules
is a dictionary containing all the nodes. You may get a node by name: model._modules[name]
. Or you may print items in model._modules
to see what nodes you have.
Thanks for the quick reply.
I have tried to access intermediate bounds by model._modules[name].lower
or model._modules[name].upper
, and it works for IBP
and IBP+backward
methods.
However, for backward
and CROWN-Optimized
methods it gives the following error:
AttributeError: 'BoundRelu' object has no attribute 'lower'
AttributeError: 'BoundRelu' object has no attribute 'upper'
I assume that in CROWN the bounds for non-linearities have different structure. Is it still possible to access them for these methods?
@nurlanov-zh The lower and upper bound for Relu are not computed in this case for efficiency reasons. You can get the lower and upper bound for the layer before ReLU (typically a linear layer), and apply a ReLU function on these bounds.
@huanzhang12 However, such obtained bounds will not be the same as in CROWN method, won't they? I wanted to look at intermediate bounds from particular methods. Is it possible to obtain those, even though the efficiency is reduced?
Hello,
I am wondering if the library provides access to intermediate bounds too?
Thanks, Zhak