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

Improve efficiency of Masker process function #1937

Open
lauramurgatroyd opened this issue Sep 26, 2024 · 0 comments
Open

Improve efficiency of Masker process function #1937

lauramurgatroyd opened this issue Sep 26, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@lauramurgatroyd
Copy link
Member

lauramurgatroyd commented Sep 26, 2024

Description

The Masker processor needs refactoring to improve efficiency.

The way that Masker performs averaging and interpolating needs improving.

The averaging or interpolating is along a single axis only.

The processor starts by looping over the axis to be averaged along:

for i in range(arr.shape[axis_index]):

Then it updates any Masked values at the first index on that axes before looping over the remaining indices and repeating.

However, there isn't necessarily a masked value at each index on the axis. It would make more sense for the loop to be over the values in the mask.

Environment

import cil, sys
print(cil.version.version, cil.version.commit_hash, sys.version, sys.platform)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant