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

Automatically add channels for LIME if the input is greyscale #215

Merged
merged 1 commit into from
Feb 10, 2022

Conversation

loostrum
Copy link
Member

@loostrum loostrum commented Feb 9, 2022

Even if the input is greyscale, like MNIST, LIME still requires 3 channels. The preprocessing function was our workaround to handle this, but it is unclear to the user because LIME adds a batch axis, before the preprocessing function is called.

This PR adds functionality to automatically add/remove the extra channels for LIME.

I'm not too happy about the _get_full_preprocess_function method, but I couldn't find a better way yet without assigning lambda expressions, which the linter doesn't allow.

@loostrum loostrum requested review from egpbos and gcroci2 February 9, 2022 14:59
Copy link
Member

@egpbos egpbos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No comments, I like it much better this way! No more workarounds in the test case is always a good sign of improved UI.

@loostrum loostrum merged commit 2298148 into main Feb 10, 2022
@loostrum loostrum deleted the 212-grayscale-lime branch February 10, 2022 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants