Giter VIP home page Giter VIP logo

brainlm's Introduction

BrainLM

Preprint License: CC BY-NC-ND 4.0

Pytorch implementation of Brain Language Model (BrainLM), aiming to achieve a general understanding of brain dynamics through self-supervised masked prediction. Alt text

Quickstart

Clone this repository locally:

git clone https://github.com/vandijklab/BrainLM.git

Create an Anaconda environment from the environment.yml file using:

conda env create --file environment.yml
conda activate brainlm

And check the installation of major packages (Pytorch, Pytorch GPU-enabled, huggingface) by running these lines in a terminal:

python -c "import torch; print(torch.randn(3, 5))"
python -c "from transformers import pipeline; print(pipeline('sentiment-analysis')('I love you'))"

Datasets

Datasets are available on shared storage. Ask Syed or Antonio for more details.

Training Models

To train a model on Yale HPC, see the example HPC job submission script in scripts/train_brainlm_mae.sh.

Pre-trained model

The weights for our pre-trained model can be downloaded from huggingface

Manual Environment Creation

If the environment.yml file does not successfully recreate the environment for you, you can follow the below steps to install the major packages needed for this project:

  1. Create and activate an anaconda environment with Python version 3.8:
conda create -n brainlm python=3.8
conda activate brainlm
  1. Install Pytorch: conda install pytorch==1.12.0 torchvision==0.13.0 cudatoolkit=11.3 -c pytorch

  2. Install latest huggingface version: pip install git+https://github.com/huggingface/transformers

  3. Install Huggingface datasets: conda install -c huggingface datasets

  4. Install Pandas, Seaborn, and Matplotlib: conda install pandas seaborn

  5. Install Weights & Biases: conda install -c conda-forge wandb

  6. Install AnnData: pip install anndata==0.8.0

  7. Install UMAP: pip install umap-learn

  8. Install Pytest: conda install -c anaconda pytest

brainlm's People

Contributors

ahof1704 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.