ganguli-lab/twpca

Handle variable length trials and data with NaN values

ahwillia opened this issue · 2 comments

Trial lengths can be variable in some experiments. We should extend twPCA to handle this by simply ignoring NaN values in the data tensor. Users still specify the data as a trials x time x neuron array, but indicate missing data with nans.

Another possibility would be to pass in a vector holding the indices of trial start or end:

model = TWPCA(n_components).fit(data, trial_start=..., trial_end=...)

Things that need to get fixed:

  • Low-rank factor initialization. Need to replace SVD with matrix completion or other strategy.
  • Initial time warps (linear scaling to same length? still use shifts?)
  • Mask loss function to only consider valid timepoints

Fixed in #6