Open mohrabi opened 3 years ago
The results look very strange. The bursting artifacts are edge effects. Can you provide a short code snippet which shows what you are doing?
Oops sorry! I meant LinearWarping
Anyway, here is my code:
twModelLinear = PiecewiseWarping(n_knots=0, warp_reg_scale=1e-6,
smoothness_reg_scale=20.0)
twModelLinear.fit(np.einsum('ijk->ikj', data.su), iterations=20)
linearTwSu = np.einsum('ijk->ikj', twModelLinear.transform(np.einsum('ijk->ikj', data.su)))
twModel = twModelShift
twSu = shiftedTwSu
fig, axes = plt.subplots(2, data.nUnit, figsize=(32,8))
for iUnit in range(data.nUnit):
spikeInds = [np.where(data.su[i, iUnit, :] == 1)[0] for i in range(data.nTrial)]
axes[0, iUnit].eventplot(np.array(spikeInds, dtype=object))
spikeInds = [np.where(twSu[i, iUnit, :] == 1)[0] for i in range(data.nTrial)]
axes[1, iUnit].eventplot(np.array(spikeInds, dtype=object))
and about that edge artifact, is there a clean way to identify (and probably remove) the corrupted trials? For example a simple method by which we can extract the valid time samples based on the warp functions.
Hi! So I have been trying to apply ShiftWarping on my dataset, but the transformed neurons have reduced spike count rate and in some of the trials, after a certain point of time, transformed units burst! I have no idea whether if this phenomenon is expected or it is due to my code.
The raster plot for one of my neurons is attached, before and after time warping.