Git Product home page Git Product logo

deepmeg-recurrent-encoder's Introduction

DeepMEG-Encoding project

This project investigates models for forecasting MEG data, using past MEG and external stimuli. These models range from linear to nonlinear, with or without access to the initial brain state, and conclude with our Deep Recurrent Encoder (DRE) architecture. The DRE outperforms current methods and trains across subjects simulatenously. An ablation study yields insight into the modules which best explain its predictive performance. A simple feature importance analysis helps interpret what the deep architecture learns.

Predictive Performance Feature Importance

General information

You will need Python >= 3.7 to use this code.

Install Python package requirements with:

pip install -r requirements.txt

Find help with:

python3 -m neural --help

Data extraction

First, install the MOUS dataset from https://data.donders.ru.nl/collections/di/dccn/DSC_3011020.09_236?3 To do so, you may register via your orchid account.

To extract MEG and stimuli from the MOUS dataset:

python3 -m neural.extraction --data /path/to/dataset --out /path/to/extraction

Notes:

  • This script will create the folder /path/to/extraction/full.
  • This step takes a few hours and requires in the extraction folder at least 90GB of disk space.
  • This step does not need a GPU to run.
  • Setting --n-subjects 1 would perform the extraction over one subject only. This is useful if you have a limited disk space and you want to test quickly.
  • Setting --use-pca would extract 40 components from the MEG and the extraction folder becomes /path/to/extraction/40. This will require less disk space (about 15GB).

Then, proceed to train encoding models.

Train the Deep Recurrent Encoder (DRE)

To train the DRE:

python3 -m neural --data /path/to/extraction/full --out /path/to/metrics

The ablations of the DRE (resp. "NO-CONV", "PCA", "NO-SUB", "NO-INIT") in the paper were trained using:

python3 -m neural --data /path/to/extraction --out /path/to/metrics --epochs 40 --conv-layers=0
python3 -m neural --data /path/to/full/extraction --out /path/to/metrics --pca 40
python3 -m neural --data /path/to/full/extraction --out /path/to/metrics --subject-dim=0
python3 -m neural --data /path/to/full/extraction --out /path/to/metrics --meg-init 0

Train the Linear Encoders (TRF, RTRF)

python3 -m neural.linear --with-forcing --with-init --shuffle --out /path/to/metrics

License

This repository is released under the CC-BY-NC 4.0. license as found in the LICENSE file.

deepmeg-recurrent-encoder's People

Contributors

adefossez avatar

Watchers

James Cloos avatar

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.