Giter VIP home page Giter VIP logo

kaggle-hms-brain-activity's Introduction

kaggle-hms-brain-activity

An attempt at a Kaggle competition for seizure detection.

https://www.kaggle.com/competitions/hms-harmful-brain-activity-classification/overview

There are six patterns of interest for this competition:

  • seizure (SZ),
  • generalized periodic discharges (GPD),
  • lateralized periodic discharges (LPD),
  • lateralized rhythmic delta activity (LRDA),
  • generalized rhythmic delta activity (GRDA),
  • “other”. Detailed explanations of these patterns are available here.

Installation

A simple git clone will suffice

$ git clone https://github.com/BlakeJC94/kaggle-hms-brain-activity

The structure of this repo is laid out as:

.
├── artifacts    # Git-ignored dir for experiment outputs
├── data         # Links and dirs for raw/processed data
├── dataset_builders  # Scripts for processing data
├── experiments       # Directory for experiment configs/hyperparams
├── hms_brain_activity  # Core ML project code
├── scrap  # Scrap files for pre-experiment exploration and testing
├── tasks  # Scripts for ML tasks
│   ├── __init__.py
│   ├── predict.py
│   ├── stop.py
│   └── train.py
└── tests  # Unit tests

Experiments are arranged as

experiments/
├── 00_toy_classifier   # Numbered and titled experiment stem
│   ├── baseline.py     # Hyperparameters defined as a JSON-like python dictionary
│   └── __init__.py     # Configuration written as functions of hparams dictionaries
├── 01_resnet1d34
│   ├── baseline.py
│   ├── decrease_lr.py  # Hyperparmeter names appended to experiment name in clearml
│   └── __init__.py
└── 02_efficientnet_spectro
    ├── baseline.py
    └── __init__.py

Usage

First, download rye:

curl -sSf https://rye-up.com/get | bash

And once it's all configured and active, navigate to the project directory and create the environment:

$ rye sync

To launch a training job (after setting up ClearML):

$ rye run ipython -- tasks/train.py <path/to/hparams.py> [--dev-run <frac or -1>] [--offline] [--debug]

Launching a training job will create a temporary file ./.train.X.pid which contains the PID of the running training job. To terminate the job, send an INT signal to that PID (or use tasks/stop.py):

$ rye run ipython -- tasks/stop.py <.train.XX.pid>

To launch an inference job:

$ rye run ipython -- tasks/predict.py <path/to/hparams.py> <path/to/weights.ckpt>

To create a zip file to submit,

$ rye run ipython -- tasks/create_submission.py <path/to/hparams.py> <path/to/weights.ckpt>

This will create a minimal zip file with the code required to perform inference and a small run.py script. To use the output:

$ unzip submission_XXXX.zip
$ mkdir data
$ ln -s <path/to/hms/dataset> data/hms
$ rye sync
$ rye run ipython -- run.py

kaggle-hms-brain-activity's People

Contributors

blakejc94 avatar

Watchers

 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.