microsoft / microsoft/Graphormer

How to evaluate for dataset zinc?

Open
#85 9 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.5k
Forks
374
PR merge metrics
No merged PRs in 30d

Description

Thanks for the code. Good job.
I train graphormer_slim in zinc dataset by bash examples/property_prediction/zinc.sh.
Then I try to evalute it by:

python graphormer/evaluate/evaluate.py \  
--user-dir graphormer \  
--num-workers 16 \  
--ddp-backend=legacy_ddp \  
--dataset-name zinc \  
--dataset-source pyg \
--task graph_prediction \  
--criterion l1_loss \  
--arch graphormer_slim \  
--num-classes 1 \  
--batch-size 64 \  
--save-dir exp/checkpoints_dir/ckpts_zinc \  
--metric mae \  
--split test      

An error happen:

TypeError: mean() received an invalid combination of arguments - got (out=NoneType, dtype=NoneType, axis=NoneType, ), but expected one of:
 * (*, torch.dtype dtype)
 * (tuple of ints dim, bool keepdim, *, torch.dtype dtype)
 * (tuple of names dim, bool keepdim, *, torch.dtype dtype)

I change the code
mae = np.mean(np.abs(y_true-y_pred))
to
mae = torch.nn.functional.l1_loss(y_true, y_pred)

But got the mae in zinc dataset is :

2022-01-10 14:40:42 | INFO | graphormer.tasks.graph_prediction | Loaded test with #samples: 5000
2022-01-10 14:40:46 | INFO | __main__ | mae: 0.06235151365399361 

Is this result normal? I doubt that I make some mistakes.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with graphormer/evaluate/evaluate.py and the evaluation path invoked by examples/property_prediction/zinc.sh. Reproduce the zinc test evaluation using the command and checkpoint details in the issue, then inspect how y_true and y_pred are passed to the MAE calculation. Done means the evaluation runs without the reported TypeError and the expected zinc MAE is clarified or covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.