torch_brain.utils#

stitch

Pools values that share the same timestamp using mean or mode operations.

seed_everything

Sets random seed for reproducibility.

create_linspace_latent_tokens

Creates a sequence of latent tokens.

create_start_end_unit_tokens

Creates for each unit a start and end token.

resolve_weights_based_on_interval_membership

Determine weights for timestamps based on which intervals they fall within.

isin_interval

Check if timestamps are in any of the intervals in the Interval object.

prepare_for_readout

np_string_prefix

Adds a string prefix to each element of a numpy string array.

bin_spikes

Bins spikes into time bins of size bin_size.