Skip to content

ifuqy/Multi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi

Multi_AI project

This model's code is implemented using Tinygrad.

The pulsar candidates used as input for this model are generated by PRESTO.

Thanks to those who provided the data, computing resources, and all other contributors to this project.

Please use ./trained_model/weight_0.9954_0.9830.pth as the model weights.

Note: The paper "Improving pulsar search efficiency in next-generation pulsar surveys with artificial intelligence" has been published in MNRAS. Click here to view the article

Note: The results of the model performance evaluation reported in the paper can be found in evaluate_result.txt.

The testing environment for this program is as follows:

  • tinygrad==0.10.2
  • matplotlib==3.8.4
  • numpy==1.22.4
  • pyyaml==5.4.1
  • scikit-learn==1.1.3
  • tqdm==4.66.1
  • scipy==1.11.3

To install required dependencies, run:

pip install -r requirements.txt

The training parameters of the model are configured in the YAML files located in the config directory.

Before using the model for prediction, make sure to configure the number of processes and the prediction batch size in Multi/config/global_cfg.yaml.

The training input for this model can be provided either by a file listing .pfd file paths with labels or by using a dataloader.
For training, it is recommended to use the dataloader approach. You can create and generate the dataloader as follows:

python make_dataloader.py --pfd_dir ./pfds/ --output_root ./test_dataloader --batch_size 256
python make_dataloader.py --pfd_list ./mwa_pulsars.txt --output_root ./mwa_test --batch_size 256

You can train the denoising model using python denoise_model.py.
An example of correct execution is shown in denoise_model_process.jpg.

You can train the classification model using python train.py.
An example of correct execution is shown in train_model_process.jpg.

You can fine-tune a pre-trained model using python finetune.py.
An example of correct execution is shown in finetune_process.jpg.

The command to predict time-domain pulsar candidates is as follows:

python predict.py --ckpt ./trained_model/weight_0.9954_0.9830.pth --outfile clf_result.txt --pfd_dataloader test_dataloader.pkl --pfd_file ./test_pfdfile.txt --use_prob
python predict.py --ckpt ./trained_model/weight_0.9954_0.9830.pth --outfile ./test_pfdfile.txt --pfd_dir ./M5_knownpulsar/ --use_prob --chunk_size 500

# chunk_size = maximum number of .pfd files loaded at once.
# Reduce this value if you encounter RAM or GPU out-of-memory issues.

A more detailed user doc will be released soon.

About

Multi_AI project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages