Implementation of PySSL_SERS
We will set up the environment using Miniconda. Clone the current repo
git clone https://github.com/junho1ee/pyssl_sers.git
This is an example for how to set up a working conda environment to run the code (but make sure to use the correct pytorch, cuda versions or cpu only versions):
conda create --name pyssl_sers python=3.9
conda activate pyssl_sers
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
pip install lightning==2.0.9
If you want to train our models with the data then:
- download it from links:
- unzip the directory and place it into
data
such that you have the pathdata/bacteria-id/org
anddata/covid/org
If you want to preprocess the data then:
python preprocess/data_preprocess_bacteria.py
python preprocess/data_preprocess_covid.py
python lightning_pretrain_ssl.py --pre byol --augtype phys
python lightning_finetune_pred.py --pre byol --task class30 --augtype phys --fold 0
Our implementation referred to thre following repositories:
- PySSL (https://github.com/giakou4/pyssl)
- fairseq-signals (https://github.com/Jwoo5/fairseq-signals)
If you have any questions, please contact