Giter Site home page Giter Site logo

eden-kramer-lab / rate_adjustment_for_spike_coherence Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 4.0 597 KB

An implementation of the spike-rate adjustment method from Aoi et al. (2015) for comparing spike-field and spike-spike coherences.

License: MIT License

Jupyter Notebook 99.55% Python 0.45%
spike-field-coherence spike-spike-coherence neuroscience python firing-rate-dependence spikes local-field-potential

rate_adjustment_for_spike_coherence's Introduction

Eden-Kramer-Lab

Website

rate_adjustment_for_spike_coherence's People

Contributors

edeno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rate_adjustment_for_spike_coherence's Issues

MemoryError after changing sampling frequency

Hi,
I would like to use your code to determine the spike-field coherence of my data. My sampling rate is 20 kHz, I have 200 trials, and I would like to examine a 300 ms time interval. I initially tried the example using the surrogate LFPs and spikes based on the Aoi et al., 2015 publication. This worked great. After I converted my spike data and LFP data into the correct format I ran it and I obtained a MemoryError.
To try to determine what was causing the error I used the surrogate data example again and there I changed the n_time to 10000, the sampling_frequency to 10000 and ran the code. Again I obtained the same MemoryError:

Connected to pydev debugger (build 202.8194.22)
INFO:spectral_connectivity.transforms:Multitaper(sampling_frequency=10000, time_halfbandwidth_product=5,
time_window_duration=1.0, time_window_step=1.0,
detrend_type='constant', start_time=0, n_tapers=9)
INFO:spectral_connectivity.transforms:Multitaper(sampling_frequency=10000, time_halfbandwidth_product=25,
time_window_duration=1.0, time_window_step=1.0,
detrend_type='constant', start_time=0, n_tapers=49)
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.1\plugins\python-ce\helpers\pydev\pydevd.py", line 1448, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.1\plugins\python-ce\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/Users/dsuchane/PycharmProjects/iCSD/Test_coherence.py", line 78, in
c = Connectivity.from_multitaper(m)
File "C:\Users\dsuchane\PycharmProjects\untitled\venv\lib\site-packages\spectral_connectivity\connectivity.py", line 108, in from_multitaper
fourier_coefficients=multitaper_instance.fft(),
File "C:\Users\dsuchane\PycharmProjects\untitled\venv\lib\site-packages\spectral_connectivity\transforms.py", line 217, in fft
self.sampling_frequency).swapaxes(2, -1)
File "C:\Users\dsuchane\PycharmProjects\untitled\venv\lib\site-packages\spectral_connectivity\transforms.py", line 315, in _multitaper_fft
tapers[np.newaxis, np.newaxis, ...])
MemoryError
python-BaseException
Backend TkAgg is interactive backend. Turning interactive mode on.

If I run only 20 trials at a time it works, so what I thought I'd do is run a set of 20 trials at a time and then average the 20 resulting coherence spectra. I'm not sure if that is even allowed, I'm not a mathematician. Any help on this would be greatly appreciated.

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.