Skip to content

Commit

Permalink
Fix load model test
Browse files Browse the repository at this point in the history
Convert model first
Code typos
Add help message to readme
  • Loading branch information
agitter committed Mar 17, 2024
1 parent 280f16f commit b5006c4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@ jobs:
# Load target model checkpoint and run inference on example variants
- name: Load and test target METL model
shell: bash --login {0}
run: python code/tests.py --checkpoint_path output/training_logs/DgLkMZxu/checkpoints/epoch=49-step=50.ckpt --variants E3K,G102S;T36P,S203T,K207R;V10A,D19G,F25S,E113V --dataset avgfp
run: |
python code/convert_ckpt.py output/training_logs/DgLkMZxu/checkpoints/epoch=49-step=50.ckpt
python code/tests.py --checkpoint_path output/training_logs/DgLkMZxu/checkpoints/DgLkMZxu.pt --variants E3K,G102S;T36P,S203T,K207R;V10A,D19G,F25S,E113V --dataset avgfp
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Output files
output/*
!output/README.md

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ python code/train_source_model.py @args/pretrain_avgfp_local.txt --max_epochs 5
The test metrics are expected to show poor performance after such a short training run.
For instance, `pearson_total_score` may be around 0.24.

See the help message for an explanation of all the arguments
```bash
python code/train_source_model.py --help
```

# Finetuning on experimental data

Experimental data is stored in [dms_data](data/dms_data) directory.
Expand All @@ -71,3 +76,8 @@ python code/train_target_model.py @args/finetune_avgfp_local.txt --enable_progre
```

Following the short demonstration pretraining and finetuning process is expected to give test set Spearman correlation around 0.6.

See the help message for an explanation of all the arguments
```bash
python code/code/train_target_model.py --help
```
3 changes: 1 addition & 2 deletions code/tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
""" testing code """
import argparse
import metl
import torch
import utils
Expand Down Expand Up @@ -46,4 +45,4 @@ def load_checkpoint_run_inference(checkpoint_path, variants, dataset):

parsed_args = parser.parse_args()

load_checkpoint_run_inference(args.checkpoint_path, args.variants, args.dataset)
load_checkpoint_run_inference(parsed_args.checkpoint_path, parsed_args.variants, parsed_args.dataset)

0 comments on commit b5006c4

Please sign in to comment.