Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transformed Units Have Drastically Reduced Fire Rates #16

Open
mohrabi opened this issue Aug 22, 2021 · 2 comments
Open

Transformed Units Have Drastically Reduced Fire Rates #16

mohrabi opened this issue Aug 22, 2021 · 2 comments

Comments

@mohrabi
Copy link

mohrabi commented Aug 22, 2021

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.

130361430-c98d5ec8-f895-473c-b713-9445d158f870

@ahwillia
Copy link
Owner

The results look very strange. The bursting artifacts are edge effects. Can you provide a short code snippet which shows what you are doing?

@mohrabi
Copy link
Author

mohrabi commented Aug 23, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants