Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/MadryLab/robustness
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewilyas committed Nov 1, 2019
2 parents e30a1aa + 410d421 commit ca52df7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
8 changes: 5 additions & 3 deletions robustness/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def get_model(self, arch, pretrained):
raise NotImplementedError

def make_loaders(self, workers, batch_size, data_aug=True, subset=None,
subset_start=0, subset_type='rand', val_batch_size=None,
only_val=False):
subset_start=0, subset_type='rand', val_batch_size=None,
only_val=False, shuffle_train=True, shuffle_val=True):
'''
Args:
workers (int) : number of workers for data fetching (*required*).
Expand Down Expand Up @@ -146,7 +146,9 @@ def make_loaders(self, workers, batch_size, data_aug=True, subset=None,
subset=subset,
subset_start=subset_start,
subset_type=subset_type,
only_val=only_val)
only_val=only_val,
shuffle_train=shuffle_train,
shuffle_val=shuffle_val)

class ImageNet(DataSet):
'''
Expand Down
15 changes: 14 additions & 1 deletion robustness/tools/imagenet_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,20 @@ def common_superclass_wnid(group_name):
'n07555863', #food (24)
'n03405725', #furniture (21)
'n02469914', #primate (20)
]
],
'mid_12': ['n02084071', #dog (100+)
'n01503061', #bird (52)
'n04576211', #wheeled vehicle
'n01661091', #reptile, reptilian (36)
'n02075296', #carnivore
'n02159955', #insect (27)
'n03800933', #musical instrument (26)
'n07555863', #food (24)
'n03419014', #garment (24)
'n03405725', #furniture (21)
'n02469914', #primate (20)
'n02512053', #fish (16)
]
}

if group_name in common_groups:
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.1',
version='1.1.post1',

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

0 comments on commit ca52df7

Please sign in to comment.