deepmodeling / deepmodeling/Uni-Mol

[BUG] Wrong calculation on feat["pair_type"] in Uni-Mol2

Open
#368 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
1.2k
Forks
181
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

The calculation of feat["pair_type"] in Uni-Mol2 at line 64 `unimol2/unimol2/data/unimol2_dataset.py` should calculate the atom-atom pair. Instead, it calculates the bond-bond pair. Is this the expected behavior?

```python
#unimol2/unimol2/data/unimol2_dataset.py

def get_graph_features(...):
atom_feat = convert_to_single_emb(x[:, 1:], atom_feat_sizes)
# The atom number has been removed in the above step

...
feat = {}
feat["atom_feat"] = torch.from_numpy(atom_feat).long()
...
atoms = feat["atom_feat"][..., 0]
# As a result, the above code does not retrieve the atom number.

pair_type = torch.cat(
[
atoms.view(-1, 1, 1).expand(-1, N, -1),
atoms.view(1, -1, 1).expand(N, -1, -1),
],
dim=-1,
)
```

### Uni-Mol Version

Uni-Mol2

### Expected behavior

`atoms` should get directly from `x[:, 0]` instead of `atom_feat`.

### To Reproduce

_No response_

### Environment

_No response_

### Additional Context

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.