UnitFilter#

class torch_brain.transforms.UnitFilter(mask_fn, field, reset_index=True)[source]#

Bases: object

Drop units based on the mask_fn given in the constructor.

Parameters:
  • mask_fn (Callable[[ArrayDict], ndarray]) – A function that takes the unit ids and returns a mask to keep the units.

  • field (str) – The field to apply the filter.

  • reset_index (bool) – If True, it will reset_index the unit index of the time series.