Skip to content
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

Refactor custom_preprocess() for more robustness #167

Merged
merged 23 commits into from
Oct 13, 2022
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3ccd638
implements more robust way of returning in custom_preprocess().
dkrako Oct 11, 2022
b7ea6be
Added running instructions to mypy
annahedstroem Oct 11, 2022
790db7f
Added running instructions to mypy
annahedstroem Oct 11, 2022
14a889e
Added running instructions to mypy
annahedstroem Oct 11, 2022
7418f9b
Update README.md
annahedstroem Oct 11, 2022
c9f437b
Update README.md
annahedstroem Oct 11, 2022
d1c900f
fix error in model_parameter_randomisation
dkrako Oct 11, 2022
529dc41
Merge branch 'main' into feature/robust-custom-preprocessing
dkrako Oct 11, 2022
6b0c9f4
simplify calling of custom_preprocess()
dkrako Oct 12, 2022
c9c75c6
fix return type hint of PixelFlipping.custom_preprocess
dkrako Oct 12, 2022
0a4de84
add documentation and examples to custom_preprocessing()
dkrako Oct 12, 2022
04d7fc6
add more info about custom_preprocessing() to CONTRIBUTING.md
dkrako Oct 12, 2022
9bf05fe
Merge branch 'main' into feature/robust-custom-preprocessing
annahedstroem Oct 12, 2022
ce410f1
Merge branch 'main' into feature/robust-custom-preprocessing
annahedstroem Oct 12, 2022
7211a19
Remove all remaining occurences in docstrings for unused c and p argu…
dkrako Oct 12, 2022
1f4772f
Align evaluate_instance() signatures.
dkrako Oct 12, 2022
b84bbf3
Remove custom_batch from __init__ signatures in metrics which don't u…
dkrako Oct 12, 2022
9e0b704
Add docstring to Metric.get_instance_iterator()
dkrako Oct 12, 2022
c4c0e5e
Add more info on `custom_preprocess()` implementation.
dkrako Oct 12, 2022
08e16d0
Fix return descriptions in custom_preprocess() docstrings.
dkrako Oct 12, 2022
330960c
Remove keyword argument `i` from `evaluate_instance()` as it wasn't u…
dkrako Oct 12, 2022
509ca7e
Remove keyword argument `i` from `evaluate_instance()` as it wasn't u…
dkrako Oct 12, 2022
05ca1c2
Fix type hint in SensitivityN
dkrako Oct 12, 2022
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
Prev Previous commit
Next Next commit
fix error in model_parameter_randomisation
dkrako committed Oct 11, 2022
commit d1c900f53940d8f2eb5b2680fc3cfcba7a1878e1
Original file line number Diff line number Diff line change
@@ -230,10 +230,6 @@ def __call__(
warn_func.deprecation_warnings(kwargs)
warn_func.check_kwargs(kwargs)

# This is needed for iterator (zipped over x_batch, y_batch, a_batch, s_batch, custom_batch)
if custom_batch is None:
custom_batch = [None for _ in x_batch]

data = self.general_preprocess(
model=model,
x_batch=x_batch,
@@ -248,6 +244,11 @@ def __call__(
softmax=softmax,
device=device,
)
# TODO: this is cumbersome. Handle this more conveniently.
model = data['model']
x_batch = data['x_batch']
y_batch = data['y_batch']
a_batch = data['a_batch']

# Results are returned/saved as a dictionary not as a list as in the super-class.
self.last_results = {}