Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion robustness/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
name = "robustness"
__version__ = "1.0.post1"
__version__ = "1.2.post1"
1 change: 0 additions & 1 deletion robustness/attack_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ def project(self, x):
def step(self, x, g):
"""
"""
# Scale g so that each element of the batch is at least norm 1
l = len(x.shape) - 1
g_norm = ch.norm(g.view(g.shape[0], -1), dim=1).view(-1, *([1]*l))
scaled_g = g / (g_norm + 1e-10)
Expand Down
3 changes: 2 additions & 1 deletion robustness/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ def override_args(self, default_args, new_args):
if len(extra_args) > 0: raise ValueError(f"Invalid arguments: {extra_args}")
for k in kwargs:
req_type = type(default_args[k])
if not isinstance(kwargs[k], req_type):
no_nones = (default_args[k] is not None) and (kwargs[k] is not None)
if no_nones and (not isinstance(kwargs[k], req_type)):
raise ValueError(f"Argument {k} should have type {req_type}")
return {**default_args, **kwargs}

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='1.2',
version='1.2.post1',

description='Tools for Robustness',
long_description=long_description,
Expand Down