IBM / CLEVER-Robustness-Score

Codes for reproducing the robustness evaluation scores in “Evaluating the Robustness of Neural Networks: An Extreme Value Theory Approach,” ICLR 2018 ​​​​​​​
https://openreview.net/pdf?id=BkUHlMZ0b
Apache License 2.0
47 stars 18 forks source link

Undefined name 's' in estimate_gradient_norm.py #3

Closed cclauss closed 6 years ago

cclauss commented 6 years ago

flake8 testing of https://github.com/IBM/CLEVER-Robustness-Score on Python 3.7.0

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./utils.py:31:11: F821 undefined name 'Image'
    pic = Image.fromarray(fig)
          ^
./estimate_gradient_norm.py:467:53: F821 undefined name 's'
                        s12_2_norm = np.linalg.norm(s[0:batch_size-1:2] - s[1:batch_size:2], axis = 1)
                                                    ^
./estimate_gradient_norm.py:467:75: F821 undefined name 's'
                        s12_2_norm = np.linalg.norm(s[0:batch_size-1:2] - s[1:batch_size:2], axis = 1)
                                                                          ^
./estimate_gradient_norm.py:468:53: F821 undefined name 's'
                        s12_1_norm = np.linalg.norm(s[0:batch_size-1:2] - s[1:batch_size:2], ord=1, axis = 1)
                                                    ^
./estimate_gradient_norm.py:468:75: F821 undefined name 's'
                        s12_1_norm = np.linalg.norm(s[0:batch_size-1:2] - s[1:batch_size:2], ord=1, axis = 1)
                                                                          ^
./estimate_gradient_norm.py:469:53: F821 undefined name 's'
                        s12_i_norm = np.linalg.norm(s[0:batch_size-1:2] - s[1:batch_size:2], ord=np.inf, axis = 1)
                                                    ^
./estimate_gradient_norm.py:469:75: F821 undefined name 's'
                        s12_i_norm = np.linalg.norm(s[0:batch_size-1:2] - s[1:batch_size:2], ord=np.inf, axis = 1)
                                                                          ^
7     F821 undefined name 's'
7
pinyuchen commented 6 years ago

This is a dead code for internal testing and will not affect the CLEVER score computation. The Image function is now called from PIL