Skip to content

Conversation

@franckma31
Copy link
Collaborator

Add several empirical evaluations of the Lipschitz constant of a model.
Code is also moved from utils/init.py to utils/evaluate_lip_const.py

Methods implemented are:

  • jacobian_norm: evaluate the norm of the jacobian ($||\nabla_x f(x)||$) on a set of input samples
  • noise_norm: evaluate random noise influence on the output ($||f(x+\delta)-f(x)||/||\delta||$)
  • adversarial attack: Same evaluation, but performed on the attack that maximizes the Lipschitz constant $||f(x+\delta)-f(x)||/||\delta||$ using the Projected Gradient Descent (PGD) algorithm. Additionally, a two-step attack is introduced to compute $||f(x+\delta_1+\delta_2)-f(x+\delta_1)||/||\delta_2||$ allowing us to search for a steeper slope in the neighborhood of $x+\delta_1$

@franckma31 franckma31 requested review from cofri and thib-s October 10, 2025 16:15
@franckma31 franckma31 mentioned this pull request Oct 10, 2025
Copy link
Collaborator

@cofri cofri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very useful!
I left some comments

@franckma31 franckma31 force-pushed the check_model_lipschitzness branch from 40ac03d to e81a107 Compare October 19, 2025 20:56
@franckma31 franckma31 force-pushed the check_model_lipschitzness branch from e81a107 to 2ff6b63 Compare October 19, 2025 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants