-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix min_epsilon of BoundaryAttack to receive a non-negative value #1262
Fix min_epsilon of BoundaryAttack to receive a non-negative value #1262
Conversation
Signed-off-by: kaitokishi <kishi.kaito@fujitsu.com>
I would like to make a pull request to |
Codecov Report
@@ Coverage Diff @@
## dev_1.7.2 #1262 +/- ##
==========================================
Coverage 43.42% 43.42%
==========================================
Files 231 231
Lines 21201 21202 +1
Branches 3956 3956
==========================================
+ Hits 9207 9208 +1
Misses 10852 10852
Partials 1142 1142
|
@@ -76,7 +76,7 @@ def __init__( | |||
num_trial: int = 25, | |||
sample_size: int = 20, | |||
init_size: int = 100, | |||
min_epsilon: Optional[float] = None, | |||
min_epsilon: float = 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
min_epsilon: float = 0, | |
min_epsilon: Union[float, int] = 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In PEP 484,
when an argument is annotated as having type float, an argument of type int is acceptable
so I think only float
is sufficient as in epsilon
and delta
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @kaitokishi Thank you very much for your first pull request to ART! This is really great! I have created branch dev_1.7.2
now and updated the PR accordingly. I like removing the None
, but I would like to suggest to apply typing and testing for int
and float
explicitly for good testing. What do you think?
Co-authored-by: Beat Buesser <49047826+beat-buesser@users.noreply.github.com>
Thank you for your suggestion. I think using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @kaitokishi Thank you very much for you first pull request to ART!
Signed-off-by: kaitokishi kishi.kaito@fujitsu.com
Description
Passing a positive float value into
min_epsilon
ofBoundaryAttack
raises Exception. This is because_check_params()
raisesValueError
even ifself.min_epsilon
is positive float. This PR is to fix this bug.Also, this PR makes it simple to use
min_epsilon
by avoiding to useNone
.Fixes #1258
Type of change
Please check all relevant options.
Testing
works.
Test Configuration:
Checklist