HICAI-ZJU / KANO

Code and data for the Nature Machine Intelligence paper "Knowledge graph-enhanced molecular contrastive learning with functional prompt".
MIT License
108 stars 24 forks source link

Problem of finetuning and predicting in custom dataset #5

Closed zw-SIMM closed 1 year ago

zw-SIMM commented 1 year ago

If I have a custom dataset .csv file, how can I use KANO for finetuning(this can refer finetune.sh) and predicting(not mentioned) ?

ZJU-Fangyin commented 1 year ago

Sure, your question can be addressed by referring to the way mentioned in this link: https://github.com/HICAI-ZJU/KANO#conducting-experiments-on-a-specified-dataset.

Here is a specific example of how to use a custom .csv file for fine-tuning or prediction:

python train.py \
    --data_path $../your_train.csv$ \
    --separate_test_path $../your_test.csv$ \
    --separate_val_path $../your_val.csv$ \
    --dataset_type $classification$ \
    --epochs 100 \
    --num_runs 1 \
    --gpu 1 \
    --batch_size 256 \
    --step 'functional_prompt' \
    --exp_name finetune \
    --exp_id your_exp_id \
    --checkpoint_path "./dumped/pretrained_graph_encoder/original_CMPN_0623_1350_14000th_epoch.pkl"

In this script, --data_path, --separate_test_path, and --separate_val_path are the paths to your custom .csv files for training, testing, and validation, respectively.

zw-SIMM commented 1 year ago

Thanks for your rapid reply, I will try!