auto_LiRPA
auto_LiRPA copied to clipboard
Can I compute the L2 local Lipschitz constant with the framework?
Hi, I am curious if the framework supports calculating the L2 local Lipschitz constant (bound of the L2-norm of the Jacobian). The NeurIPS 2022 paper seems like it is suggesting that only L-inf norm is supported. However, under examples/vision/jacobian.py, there are three examples, and I was not sure if one of them are calculating L2 local Lipschitz constant.
Specifically, I wasn't sure what the first example is calculating, without the norm=np.inf argument here: https://github.com/Verified-Intelligence/auto_LiRPA/blob/d2592c13198e0eb536967186758c264604b59539/examples/vision/jacobian.py#L56
Can you explain the difference between the first and the second example in the above link, and comment on whether there is a way for me to bound the L2-norm of the Jacobian with the framework in general?
Thank you for the help!
Hi @kwmaeng91 ,
There is no example of computing the L2 local Lipschitz constant in the current code. In the first example, we just bound the Jacobian matrix without taking any norm and the result is not a Lipschitz constant. The second example computes the Linf local Lipschitz constant.
The framework is intended for Linf norm only for now. For L2 norm which involves spectral norms, the current LiRPA framework seems to be produce loose bounds.
Hi, @shizhouxing, thank you for the reply!
Is there any other framework you would recommend for L2 norm? It seems like your team have published a stream of works and codebases related to this problem. If you have any other project you think would be more related I would love to know (e.g., will RecurJac or Fast-Lip be helpful?) If not, I want to know if it is possible to calculate the L2 norm, even if it is loose. If it is still reasonable, I would like to learn how it can be possible.
Thank you.
I previously tried computing L2 norm also and the code could produce some L2 results at that time. I need to check the current code and get back to you.
RecurJac and Fast-Lip are special cases of this new framework so I don't think they can produce tight results. I know LipSDP ([13] cited in the NeurIPS 2022 paper) can compute L2 results though it may be limited to small models due to its high cost.
Thanks @shizhouxing!! I will be awaiting your response.