issues
search
chr5tphr
/
zennit
Zennit is a high-level framework in Python using PyTorch for explaining/exploring neural networks using attribution methods like LRP.
Other
190
stars
32
forks
source link
Expand low/high in ZBox to improve usability
#101
Closed
chr5tphr
closed
2 years ago
chr5tphr
commented
2 years ago
add zennit.core.expand, which expands tensors to a shape, in a more lenient fashion than simply torch.expand:
allow scalars (0-dim tensor or float/int)
assume trailing dimensions to be singleton if number of dimensions is smaller than target number of timensions
[backwards-compatibility] cut first (batch) dimension to
shape
if the supplied first dimension is larger (only if cut_batch_dim flag is set True)
use expand in zennit.rules.ZBox to expand
low
and
high
shape
if the supplied first dimension is larger (only if cut_batch_dim flag is set True)low
andhigh