Below you can find a outline of how to reproduce our 1D Model solution for the G2Net-Gravitational-Wave-Detection competition. All shell commands used in each step are run from current directory
- Download kaggle competition data (assumes the Kaggle API is installed)
cd ../../data/kaggle competitions download -c g2net-gravitational-wave-detectionunzip -q g2net-gravitational-wave-detection
- Generate whiten wave from competition data
- run notebook
1D_Model/notebooks/generate_whiten_wave.ipynb)
- run notebook
- To train a single model using a config listed config.py, run
python train.py --model_config <config_name> - To perform inference on a single model, run
python infer.py --model_config <config_name> --gen_oof 1 --gen_test 1
-
very fast prediction: run
notebook/stacking.ipynb- uses precomputed predictions
- runs in 2 hours (on hardware similar to ours)
-
ordinary prediction: run
reproduce_infer_test.sh- uses pretrained models
- expect this to run for 6 hours
-
retrain models: run
python reproduce_train.sh- trains all models from scratch
- If we want to use ensemble, we need to run
python reproduce_infer_oof_test.sh. Then we need to change the directory insidenotebook/stacking.ipynbcorrespondingly to point to each oof prediction and submission file. - expect this to run about a week
1 x NVIDIA Tesla A100 or 2 x NVIDIA GeForce RTX 2080Ti.
- notebooks/:
stacking.ipynb: for stacking, use hacking-lb methodSyntheticSignal.ipynb: for GW simulationget_avg_w0.ipynb: for avg_w0 generationgenerate_whiten_wave.ipynb: for whiten wave generation:../data/1D_Model/whiten-train-w0/and../data/1D_Model/whiten-test-w0/- Richard_Models/: folder contains the original notebook for model generation from Richard
- src/:
augmentation.py: augmentation functionsconfig.py: Model configurationdataset.py: dataset preparationinfer_helper.py: helper functions for inferenceloss.py: related loss functionslrfinder.py: learning rate finder classmodels.py: interface to decide which model to usemodels_1d.py: 1D model structuremodels_2d.py: 2D model structuremodels_3d.py: 3D model structureoptim.py: optimizer classtrain_helper.py: helper functions for trainingTTA.py: class for test time augmentationutil.py: utility functions
infer.py: inference interfacetrain.py: training interfacereproduce_trian.sh: script file for model reproductionreproduce_infer.sh: script file for model prediction (OOF, test) reproduction