You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use TorchLRP to extract the most relevant parameters from each layer of a given model.
To do so, I’m working on extending the explain_mnist.py, and I extract the parameters relevance map using the following code snippet:
The goal is to convert layer_wise_relevance into a binary mask to extract the most relevant parameters of each layer. This approach works well for nn.Linear layers since the relevance map produced by lrp.trace.collect_and_disable() matches the shape of the layer's weight tensor.
However, I’m encountering challenges with nn.Conv2D layers. For instance, consider the following layer:
How can I interpret or transform the relevance map for Conv2D layers so that it aligns with the shape of the layer's weight tensor? Any suggestions or resources would be greatly appreciated!
Additionally, I propose extending the trace.collect_and_disable() function to return metadata, such as the name or ID of the layer associated with each relevance map. This enhancement would make it easier to map relevance data to specific model parameters, streamlining the analysis process.
The text was updated successfully, but these errors were encountered:
I want to use TorchLRP to extract the most relevant parameters from each layer of a given model.
To do so, I’m working on extending the
explain_mnist.py
, and I extract the parameters relevance map using the following code snippet:The goal is to convert
layer_wise_relevance
into a binary mask to extract the most relevant parameters of each layer. This approach works well fornn.Linear
layers since the relevance map produced bylrp.trace.collect_and_disable()
matches the shape of the layer's weight tensor.However, I’m encountering challenges with
nn.Conv2D
layers. For instance, consider the following layer:Its weight tensor has the shape:
But the corresponding relevance map extracted from
lrp.trace.collect_and_disable()
has a different shape:How can I interpret or transform the relevance map for
Conv2D
layers so that it aligns with the shape of the layer's weight tensor? Any suggestions or resources would be greatly appreciated!Additionally, I propose extending the
trace.collect_and_disable()
function to return metadata, such as the name or ID of the layer associated with each relevance map. This enhancement would make it easier to map relevance data to specific model parameters, streamlining the analysis process.The text was updated successfully, but these errors were encountered: