Giter Site home page Giter Site logo

kylemath / deepeeg Goto Github PK

View Code? Open in Web Editor NEW
259.0 259.0 58.0 19.62 MB

Deep Learning with Tensor Flow for EEG MNE Epoch Objects

License: MIT License

Jupyter Notebook 70.90% Python 29.05% Shell 0.04%
deep-learning eeg keras-tensorflow machine-learning neuroscience

deepeeg's People

Contributors

korymath avatar kylemath avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deepeeg's Issues

Attempting to bump versions, need to catch up integration with MNE

Reproduce:

  1. Remove versions in requreiments.txt
  2. follow installation instructions
  3. fix tensorflow 1 -> tensorflow 2 random seed.
  4. run tests, the following errors then occurs
======================================================================
ERROR: test_example_muse (tests.ExampleTest)
Testing example Muse code.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/korymath/Documents/code/DeepEEG/tests.py", line 37, in test_example_muse
    raw = LoadMuseData(subs=[101, 102], nsesh=2, data_dir='visual/cueing')
  File "/Users/korymath/Documents/code/DeepEEG/utils.py", line 106, in LoadMuseData
    raw.append(muse_load_data(data_dir, sfreq=sfreq ,subject_nb=sub,
  File "/Users/korymath/Documents/code/DeepEEG/utils.py", line 148, in muse_load_data
    return load_muse_csv_as_raw(fnames,
  File "/Users/korymath/Documents/code/DeepEEG/utils.py", line 204, in load_muse_csv_as_raw
    info = create_info(ch_names=ch_names, ch_types=ch_types,
TypeError: create_info() got an unexpected keyword argument 'montage'

======================================================================
ERROR: test_frequencydomain_complex (tests.ExampleTest)
Testing simulated data pipeline.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/korymath/Documents/code/DeepEEG/tests.py", line 84, in test_frequencydomain_complex
    raw,event_id = SimulateRaw(amp1=50, amp2=60, freq=1.)
  File "/Users/korymath/Documents/code/DeepEEG/utils.py", line 277, in SimulateRaw
    raw_sim_zero = simulate_raw(raw, stc_zero, trans_fname, src, bem_fname,
TypeError: simulate_raw() got an unexpected keyword argument 'cov'

======================================================================
ERROR: test_simulate_raw (tests.ExampleTest)
Testing simulated data pipeline.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/korymath/Documents/code/DeepEEG/tests.py", line 62, in test_simulate_raw
    raw,event_id = SimulateRaw(amp1=50, amp2=60, freq=1.)
  File "/Users/korymath/Documents/code/DeepEEG/utils.py", line 277, in SimulateRaw
    raw_sim_zero = simulate_raw(raw, stc_zero, trans_fname, src, bem_fname,
TypeError: simulate_raw() got an unexpected keyword argument 'cov'

----------------------------------------------------------------------
Ran 5 tests in 1495.999s

FAILED (errors=3)

Move pip requirements to requirements.txt

pip installations should be listed in a requirements.txt file

Make a new text file called requirements.txt with the following text:

h5py==2.9.0
Keras==2.2.4
Keras-Applications==1.0.7
Keras-Preprocessing==1.0.9
mne==0.17.0
numpy==1.16.1
PyYAML==3.13
scipy==1.2.0
six==1.12.0

And then the installation of the packages can be done with a one-line call:

pip install -r requirements.txt

Tenserflow version

Could you update the TensorFlow requirements if possible? Version 1.13 is really old and higher versions give errors during compilation.

multilevel model over subjects

You can include other data outside

so input could be a 64x64 image and a vector of real numbers. Those numbers could be fed into a layer 'after' the convolution. This is common for multi-sensor setups.

So, learning to compress EEG data to a latent space and then regenerate it would give you good features for downstream tasks. I wonder if a word vectors method has been used for EEG.

How to solve these? both in Sim and BV, should we change the pip install -- r requirements?

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
xarray 0.15.1 requires pandas>=0.25, but you have pandas 0.24.1 which is incompatible.
umap-learn 0.4.6 requires numpy>=1.17, but you have numpy 1.16.1 which is incompatible.
umap-learn 0.4.6 requires scipy>=1.3.1, but you have scipy 1.2.0 which is incompatible.
tensorflow-probability 0.11.0 requires gast>=0.3.2, but you have gast 0.2.2 which is incompatible.
tensorflow-metadata 0.26.0 requires absl-py<0.11,>=0.9, but you have absl-py 0.7.0 which is incompatible.
tensorflow-metadata 0.26.0 requires protobuf<4,>=3.7, but you have protobuf 3.6.1 which is incompatible.
tensorflow-hub 0.10.0 requires protobuf>=3.8.0, but you have protobuf 3.6.1 which is incompatible.
plotnine 0.6.0 requires matplotlib>=3.1.1, but you have matplotlib 3.0.2 which is incompatible.
plotnine 0.6.0 requires pandas>=0.25.0, but you have pandas 0.24.1 which is incompatible.
nbclient 0.5.1 requires jupyter-client>=6.1.5, but you have jupyter-client 5.3.5 which is incompatible.
mizani 0.6.0 requires matplotlib>=3.1.1, but you have matplotlib 3.0.2 which is incompatible.
mizani 0.6.0 requires pandas>=0.25.0, but you have pandas 0.24.1 which is incompatible.
google-colab 1.0.0 requires astor~=0.8.1, but you have astor 0.7.1 which is incompatible.
google-colab 1.0.0 requires pandas~=1.1.0; python_version >= "3.0", but you have pandas 0.24.1 which is incompatible.
google-colab 1.0.0 requires six~=1.15.0, but you have six 1.12.0 which is incompatible.
flask 1.1.2 requires Werkzeug>=0.15, but you have werkzeug 0.14.1 which is incompatible.
fbprophet 0.7.1 requires pandas>=1.0.4, but you have pandas 0.24.1 which is incompatible.
datascience 0.10.6 requires folium==0.2.1, but you have folium 0.8.3 which is incompatible.
albumentations 0.1.12 requires imgaug<0.2.7,>=0.2.5, but you have imgaug 0.2.9 which is incompatible.

Issue in the key, value sorted items

>>> from utils import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/korymathewson/work/DeepEEG/utils.py", line 212
    for key, value in sorted(event_id.iteritems(), key=lambda (k,v): (v,k)):
                                                              ^
SyntaxError: invalid syntax

Minor issue in how these are being called, should use a method that is compatible.

Stagnant training accuracy and loss?

First off I wanted to say that I think the idea behind this project is amazing and thank you for creating it and releasing it.

I seem to struggle to be able to use it properly however.

First, I tried to run it locally on my windows x64 machine.
I followed the instructions (for the muse_p3) example, used the example commands in the readme, and there were no errors, however the training accuracy and loss seemed to be relatively stagnant and never went too far above a low percentage. I then changed the model_type to a 3DCNN and subsequently an LSTM to see if those models would better be able to interpret the data, but got similar behavior. I had assumed the example data you included would show the model going to a high level of competency so I felt like something was off.

Assuming there must have been something wrong with my setup, I then went to the COLAB example. As I am interested in MUSE data, I followed the link for the MUSE jupyter notebook. On COLAB, just running all the cells by default I still got the same behavior. Validation accuracy barely went over 50%. Is this really intended? I also tried increasing the number of epochs to 350 in the colab notebook but again to no avail.

Please give me guidance on how I can get better results with this incredible pipeline.

Thank you!

Yup, I'll add that to the conda create command python=3 or 3.8?

Yup, I'll add that to the conda create command python=3 or 3.6?

On Sun., Feb. 10, 2019, 6:32 p.m. Kory, [email protected] wrote:

This is likely due to python version differences. I would recommend that
we move forward with python3.

$ pip install matplotlib==3.0.2
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting matplotlib==3.0.2
Could not find a version that satisfies the requirement matplotlib==3.0.2 (from versions: 0.86, 0.86.1, 0.86.2, 0.91.0, 0.91.1, 1.0.1, 1.1.0, 1.1.1, 1.2.0, 1.2.1, 1.3.0, 1.3.1, 1.4.0, 1.4.1rc1, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 2.0.0b1, 2.0.0b2, 2.0.0b3, 2.0.0b4, 2.0.0rc1, 2.0.0rc2, 2.0.0, 2.0.1, 2.0.2, 2.1.0rc1, 2.1.0, 2.1.1, 2.1.2, 2.2.0rc1, 2.2.0, 2.2.2, 2.2.3)
No matching distribution found for matplotlib==3.0.2

โ€”
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#7 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ADfjFUYlqB_0YaPZgseXVJOAKyPhdqg_ks5vMMg4gaJpZM4ayTPU
.

Originally posted by @kylemath in #7 (comment)

keyword arguments on Feats class should be descriptive

Currently line,

def __init__(self, a=2, b=[1,1], c=[16,], d=1, e='1',
reads

def __init__(self, a=2, b=[1,1], c=[16,], d=1, e='1', f=1, g=1, h=1, i=1, j=1, k=1):

These attributes are then set with keyword arguments, they should use the keyword names, rather than the alphabetical placeholders.

Data for running DeepEEG_Sim is missing

Hi

This repository looks great! I'd like to run your example code, but it seems the data on 'visual/cueing' is missing. I tried to follow the README, and also run the Colab noteblook DeepEEG_Sim, but the code fails find the files. I also tried to look it up both on this repo and the eeg-notebook repo. Do you think you could upload a few example datasets to run the code with?

Unittest working?

@korymath -

python -m unittest 

says 0 tests complete

but

python tests.py

runs on its own and says 3 tests complete,
is the unittest working correctly?

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.