Skip to content

Commit

Permalink
better str method to account for ablated neurons
Browse files Browse the repository at this point in the history
  • Loading branch information
mklasby committed Aug 9, 2024
1 parent 2c09afb commit a7bac88
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sparsimony/dst/srigl.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ def __str__(self) -> str:
for config in self.groups:
mask = get_mask(**config)
mask_flat = mask.view(mask.shape[0], prod(mask.shape[1:]))
ffi.append(mask_flat.sum(dim=1, dtype=torch.int).unique().item())
this_ffi = mask_flat.sum(dim=1, dtype=torch.int).unique()
if len(this_ffi) > 1:
this_ffi = this_ffi[this_ffi != 0]
ffi.append(this_ffi.item())
s = super().__str__()
s += f"FFI: {ffi}\n"
return s

0 comments on commit a7bac88

Please sign in to comment.