neuralib.spikes.cascade.cascade_predict
- neuralib.spikes.cascade.cascade_predict(dff, model_type, *, threshold=0, padding=0, verbose=True, chunks_mode_limit=10, cache_dir=None)[source]
Spike prediction using Cascade pretrained model
- Parameters:
dff (ndarray) – dF/F activity to be predicted. Array[float, [N, F]|F]
model_type (Literal['Global_EXC_1Hz_smoothing500ms', 'Global_EXC_1Hz_smoothing1000ms', 'Zebrafish_1Hz_smoothing1000ms', 'Global_EXC_2Hz_smoothing300ms', 'Global_EXC_2Hz_smoothing500ms', 'Global_EXC_2Hz_smoothing1000ms', 'Global_EXC_2.5Hz_smoothing400ms_high_noise', 'Global_EXC_3Hz_smoothing400ms', 'Global_EXC_3Hz_smoothing400ms_high_noise', 'Global_EXC_3Hz_smoothing400ms_causalkernel', 'Global_EXC_4.25Hz_smoothing300ms', 'Global_EXC_4.25Hz_smoothing300ms_high_noise', 'Global_EXC_4.25Hz_smoothing300ms_causalkernel', 'Global_EXC_5Hz_smoothing200ms', 'Global_EXC_5Hz_smoothing200ms_causalkernel', 'Global_EXC_6Hz_smoothing200ms', 'Global_EXC_6Hz_smoothing200ms_causalkernel', 'Global_EXC_7Hz_smoothing200ms', 'Global_EXC_7Hz_smoothing200ms_causalkernel', 'Global_EXC_7.5Hz_smoothing200ms_high_noise', 'Global_EXC_7.5Hz_smoothing200ms', 'Global_EXC_7.5Hz_smoothing200ms_causalkernel', 'OGB_zf_pDp_7.5Hz_smoothing200ms', 'OGB_zf_pDp_7.5Hz_smoothing200ms_causalkernel', 'Global_EXC_10Hz_smoothing50ms', 'Global_EXC_10Hz_smoothing50ms_causalkernel', 'Global_EXC_10Hz_smoothing100ms', 'Global_EXC_10Hz_smoothing100ms_causalkernel', 'Global_EXC_10Hz_smoothing200ms', 'Global_EXC_10Hz_smoothing200ms_causalkernel', 'Global_EXC_12.5Hz_smoothing100ms', 'Global_EXC_12.5Hz_smoothing100ms_causalkernel', 'Global_EXC_12.5Hz_smoothing200ms', 'Global_EXC_12.5Hz_smoothing200ms_causalkernel', 'Global_EXC_15Hz_smoothing50ms', 'Global_EXC_15Hz_smoothing50ms_causalkernel', 'Global_EXC_15Hz_smoothing100ms_high_noise', 'Global_EXC_15Hz_smoothing100ms', 'Global_EXC_15Hz_smoothing100ms_causalkernel', 'Global_EXC_15Hz_smoothing200ms', 'Global_EXC_15Hz_smoothing200ms_causalkernel', 'Global_INH_15Hz_smoothing100ms', 'Global_EXC_17.5Hz_smoothing100ms', 'Global_EXC_17.5Hz_smoothing100ms_causalkernel', 'Global_EXC_17.5Hz_smoothing200ms', 'Global_EXC_17.5Hz_smoothing200ms_causalkernel', 'Global_EXC_20Hz_smoothing100ms', 'Global_EXC_20Hz_smoothing100ms_causalkernel', 'Global_EXC_20Hz_smoothing200ms', 'Global_EXC_20Hz_smoothing200ms_causalkernel', 'Global_EXC_25Hz_smoothing100ms', 'Global_EXC_25Hz_smoothing100ms_causalkernel', 'Global_EXC_25Hz_smoothing50ms', 'Global_EXC_25Hz_smoothing50ms_causalkernel', 'Global_EXC_30Hz_smoothing25ms', 'Global_EXC_30Hz_smoothing25ms_causalkernel', 'Global_EXC_30Hz_smoothing50ms', 'Global_EXC_30Hz_smoothing50ms_high_noise', 'Global_EXC_30Hz_smoothing50ms_causalkernel', 'Global_EXC_30Hz_smoothing100ms', 'Global_EXC_30Hz_smoothing100ms_causalkernel', 'Global_EXC_30Hz_smoothing200ms', 'Global_EXC_30Hz_smoothing100ms_causalkernel_high_noise', 'Global_EXC_30Hz_smoothing100ms_high_noise', 'Global_EXC_30Hz_smoothing200ms_causalkernel_high_noise', 'Global_EXC_40Hz_smoothing25ms_causalkernel', 'Global_EXC_40Hz_smoothing25ms', 'Global_EXC_40Hz_smoothing25ms_high_noise', 'Global_EXC_40Hz_smoothing50ms', 'Global_EXC_40Hz_smoothing50ms_high_noise', 'Global_EXC_40Hz_smoothing50ms_causalkernel', 'Global_INH_30Hz_smoothing50ms', 'Global_INH_30Hz_smoothing100ms', 'Global_EXC_30Hz_smoothing50ms_asymmetric_window_1_frame', 'Global_EXC_30Hz_smoothing50ms_asymmetric_window_2_frames', 'Global_EXC_30Hz_smoothing50ms_asymmetric_window_4_frames', 'Global_EXC_30Hz_smoothing50ms_asymmetric_window_6_frames', 'Global_EXC_30Hz_smoothing50ms_asymmetric_window_8_frames', 'GCaMP6f_mouse_30Hz_smoothing200ms', 'Spinal_cord_excitatory_30Hz_smoothing50ms', 'Spinal_cord_inhibitory_30Hz_smoothing50ms', 'Spinal_cord_excitatory_3Hz_smoothing400ms_high_noise', 'Spinal_cord_inhibitory_3Hz_smoothing400ms_high_noise', 'Spinal_cord_excitatory_2.5Hz_smoothing400ms', 'Spinal_cord_inhibitory_2.5Hz_smoothing400ms', 'GC8_EXC_5Hz_smoothing400ms_high_noise', 'GC8_EXC_5Hz_smoothing800ms_high_noise', 'GC8_EXC_7.5Hz_smoothing100ms_high_noise', 'GC8_EXC_7.5Hz_smoothing200ms_high_noise', 'GC8_EXC_10Hz_smoothing150ms_high_noise', 'GC8_EXC_10Hz_smoothing75ms_high_noise', 'GC8_EXC_15Hz_smoothing100ms_high_noise', 'GC8_EXC_15Hz_smoothing50ms_high_noise', 'GC8_EXC_30Hz_smoothing25ms_high_noise', 'GC8_EXC_30Hz_smoothing50ms_high_noise', 'GC8_EXC_40Hz_smoothing15ms_high_noise', 'GC8_EXC_40Hz_smoothing30ms_high_noise']) –
MODEL_TYPEthreshold (int | bool) – Allowed values: 0, 1 or False. 0: All negative values are set to 0. 1 or True: Threshold signal to set every signal which is smaller than the expected signal size of an action potential to zero (with dilated mask) False: No thresholding. The result can contain negative values as well
padding (float) – Value which is inserted for datapoints, where no prediction can be made (because of window around timepoint of prediction). Default value: np.nan, another recommended value would be 0 which circumvents some problems with following analysis.
verbose (bool) – Verbose of model information
chunks_mode_limit (float) – Decrease the number if memory issue dealing with large input arrays.
cache_dir (str | Path | PathLike[str] | None) – Cache directory for saving the model. If None, then used default under ~/.cache/neuralib
- Returns:
Spiking probability as predicted by the model. Array[float, [N, F]|F]
- Return type:
ndarray