-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
用unimol+模型 inference出的pos_pred取同一个id的均值吗? #269
Comments
您好,请问第一个问题的id是什么,我可以先复现一下。然后也确认下这个id对应的构象是8个吗,因为不是所有的id都有8个构象;第二个问题确实是的,是把mol对象的坐标换成预测的坐标来生成的 |
1:不确定这里是怎么输出的每个id对应的构象坐标shape,如果可以的话可以提供一下相应的代码。不过不是所有id对应的构象都是8个,如果按照给出的图里全都是按照8个来切分,可能混淆了不同id的分子,所以原子数不一样。 |
1.发现相同id对应的预测构象坐标shape不同后,我检查了模型预测后得到的直接输出test-dev_0.pkl,以防是我输出shape的代码有误,check预测的坐标值(以id3379091为例子)结果如下:
我想代码中是以 df_grouped = df.groupby("id")按id分组的,并不是以8个为一组,如果是切分有误,那么问题可能发生在我的模型inference过程中,但是inference.py文件我并无改动,想知道您的test-dev测试集中该id的pos_pred结果原子数量有异吗? |
我重新检查了unimol+模型的inference过程。在unimol_plus文件夹下的pcq.py中的load_dataset函数部分,涉及到pcq_dataset.py文件中的PCQDataset函数,其中以下代码:
max_node_num 是每个batch里最大分子原子数,然后将其调整到最接近的 4 的倍数减去 1。atom_mask对分子的真实原子位赋1,新添加的虚拟原子位赋0,包括后面涉及到的attn_mask对新添的虚拟原子位赋-inf。经过这种处理,新添的虚拟原子坐标值一开始都是0,但是在经过inference后,虚拟原子(mask标记为0)的坐标也有了预测值,导致我上面出现的同一个id(相同分子)对应的原子数不相同的情况(原子个数为每个batch里的max_node_num)。 |
在make_pcq_test_dev_submission.py文件中gap_pred是取同一个id对应值的平均,大多数id是8个值的平均。然而在预测出的pos_pred(原子坐标信息中),为什么相同id得到的pos_pred形状会不一样?也就是说同一个分子的原子数量对不上?如下是某个id预测出的pos_pred
形状为Shape mismatch for id group: [(19, 3), (19, 3), (19, 3), (19, 3), (19, 3), (19, 3), (19, 3), (15, 3)],第8个预测出来的pos_pred只有15个原子对应的坐标信息,而其它为19个原子。
想请问这是什么情况?以及想得到某个id的最终pos_pred值,是采用什么方法?除去有异常原子数量的预测值,然后其余取均值吗?
The text was updated successfully, but these errors were encountered: