-
Notifications
You must be signed in to change notification settings - Fork 233
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
is_layer_at_idx
not implemented
#264
Comments
Hi @adrhill ! Given the example in https://github.com/adrhill/innvestigate/blob/adrhill/custom-composite/examples/notebooks/imagenet_composite_lrp.ipynb, without the application of until_layer_rule , the only rule being applied to the model is the one specified in rule? |
Hi HugoTex98, that notebook is work in progress from PR #261 , which hasn't been merged yet due to this issue. That being said, you can still use analyzer = LRP(
model_wo_softmax,
rule="Z",
input_layer_rule="Bounded",
bn_layer_rule="Z"
) |
Thanks @adrhill! Btw, do you have any idea of a possible release date for this LRP with the until_layer_rule? |
It's high up on my to-do list, but it will have to wait until the TF2 release, which should be ready soon. |
The function
is_layer_at_idx
currently doesn't return anything when it should be returning a boolean value after checking the layer:innvestigate/src/innvestigate/utils/keras/checks.py
Lines 446 to 448 in c6ce893
This is used in all analyzers that inherit from
LRP
and use the kwargsuntil_layer_rule
anduntil_layer_idx
:innvestigate/src/innvestigate/analyzer/relevance_based/relevance_analyzer.py
Lines 399 to 410 in c3295be
As Python evaluates
bool(None)
asFalse
instead of throwing an error, theuntil_layer_rule
never gets applied.Currently only
LRPSequentialPresetBFlatUntilIdx
and user-defined composite LRP methods are affected, so this bug should be fixed before merging #261.Until then PR #263 adds a
NotImplementedError
.The text was updated successfully, but these errors were encountered: