Skip to content

Commit

Permalink
Style fixes and exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
keykholt committed Nov 9, 2021
1 parent 72ef90a commit d6a33c9
Show file tree
Hide file tree
Showing 4 changed files with 760 additions and 771 deletions.
6 changes: 4 additions & 2 deletions art/estimators/classification/deep_partition_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ def __init__(
)

if hash_function is None:
hash_function = lambda x: int(np.sum(x)) % ensemble_size

def hash_function(x):
return int(np.sum(x)) % ensemble_size

self.hash_function = hash_function
self.ensemble_size = ensemble_size
Expand Down Expand Up @@ -123,7 +125,7 @@ def predict( # pylint: disable=W0221
# Aggregate based on top-1 prediction from each classifier
if max_aggregate:
preds = super().predict(x, batch_size=batch_size, raw=True, **kwargs)
aggregated_preds = np.zeros_like(preds, shape=preds.shape[1:])
aggregated_preds = np.zeros_like(preds, shape=preds.shape[1:]) # pylint: disable=E1123
for i in range(preds.shape[0]):
aggregated_preds[np.arange(len(aggregated_preds)), np.argmax(preds[i], axis=1)] += 1
return aggregated_preds
Expand Down
2 changes: 1 addition & 1 deletion examples/inverse_gan_author_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def __len__(self):
return len(self.images)

def load(self, split, lazy=True, randomize=True):
""" Abstract function specific to each dataset."""
"""Abstract function specific to each dataset."""
pass


Expand Down
Loading

0 comments on commit d6a33c9

Please sign in to comment.