Giter VIP home page Giter VIP logo

g2net-detecting-continuous-gravitational-waves's Introduction

G2Net Detecting Continuous Gravitational Waves

Introduction

This repository contains the code that achieve 12th place in G2Net Detecting Continuous Gravitational Waves.

Requirements

  • numpy
  • omegaconf
  • pandas
  • pyfstat
  • pytorch_lightning
  • scikit_learn
  • timm
  • torch
  • tqdm
  • wandb

Instead of installing the above modules independently, you can simply do at once by using:

$ pip install -f requirements.txt -f https://download.pytorch.org/whl/torch_stable.html

This repository supports NVIDIA Apex. It will automatically detect the apex module and if it is found then some training procedures will be replaced with the highly-optimized and fused operations in the apex module. Run the below codes in the terminal to install apex and enable performance boosting:

$ git clone https://github.com/NVIDIA/apex
$ sed -i "s/or (bare_metal_minor != torch_binary_minor)//g" apex/setup.py
$ pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" apex/
$ rm -rf apex

Instead, we recommend to use docker and PyTorch NGC Container where apex, optimized cuda driver and faster pytorch kernel are installed:

$ docker run --gpus all -it nvcr.io/nvidia/pytorch:22.07-py3

Getting started

First, you need pure simulated signal templates to create noise-combined images.

$ python scripts/simulate_signals.py resources/competition/timestamps.pkl

Note that the timestamps are extracted from test HDF5 data.

Next, generate random gaussian background noise to combine with the pure signals.

$ python scripts/synthesize_external_psds.py resources/external/train/signals

You can also make input data for validation.

To evaluate and predict with competition data, run the below code to convert HDF5 to our input format.

$ python extract_psds_from_hdf5.py [competition train/test hdf5 directory]

Now, let's train the model. It is simple!

$ python src/train.py config/convnext_small_in22ft1k.yaml

After training, you can find a pretrained model path like convnext_small_in22ft1k-6f6648-last.pt. There are two models - first one is a best-scored model and the second one is a latest one. To predict the test signals, run the below code:

$ python src/predict.py convnext_small_in22ft1k-6f6648-last.pt --use-flip-tta

That's all! There should be convnext_small_in22ft1k-6f6648-last.csv and just submit to kaggle.

g2net-detecting-continuous-gravitational-waves's People

Contributors

affjljoo3581 avatar

Stargazers

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