Skip to content

[Example] Add Chem Suzuki-Miyaura 交叉偶联反应产率预测 #1175

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

Open
wants to merge 35 commits into
base: develop
Choose a base branch
from

Conversation

YfB1125
Copy link

@YfB1125 YfB1125 commented Jun 25, 2025

PR types

PR changes

Describe

Suzuki-Miyaura 交叉偶联反应是在零价钯配合物催化下,芳基或烯基硼酸或硼酸酯与氯、溴、碘代芳烃或烯烃发生交叉偶联。该反应具有反应条件温和、转化率高的优点,在材料合成、药物研发等领域具有重要作用,但存在开发周期长,试错成本高的问题。本研究通过使用高通量实验数据分析反应底物(包括亲电试剂和亲核试剂),催化配体,碱基,溶剂对偶联反应产率的影响,从而建立预测模型。

Copy link

paddle-bot bot commented Jun 25, 2025

Thanks for your contribution!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

无关内容请不要修改

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已恢复权限

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

无关改动请删除

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

paddle_sparse已经试着加回来了,不知道这样处理是否合适?不行的话我就重新clone一份然后把现在这个分支全部覆盖掉

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文件名建议用全小写的 chem.py或者main.py

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

global x_train, y_train
x_train, y_train = data_processed(x_train, y_train)

# 构建约束
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

中文注释建议改为英文

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已按照建议修改

"batch_size": cfg.TRAIN.batch_size,
},
loss=ppsci.loss.MSELoss("mean"),
name="bc_sup",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个名字可以直接用"sup","bc_sup"有一些歧义,你这个案例里应该不会涉及 boundary condition之类的概念吧

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不会用到。已按照建议修改

Comment on lines 1 to 6
defaults: #
- ppsci_default #
- TRAIN: train_default #
- EVAL: eval_default #
# - INFER: infer_default #
- _self_ #
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议改成如下内容

Suggested change
defaults: #
- ppsci_default #
- TRAIN: train_default #
- EVAL: eval_default #
# - INFER: infer_default #
- _self_ #
defaults:
- ppsci_default
- TRAIN: train_default
- TRAIN/ema: ema_default
- TRAIN/swa: swa_default
- EVAL: eval_default
- INFER: infer_default
- hydra/job/config/override_dirname/exclude_keys: exclude_keys_default
- _self_

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

Comment on lines 54 to 55


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

连续空行保留一行即可

def __init__(
self, input_dim, hidden_dim, hidden_dim2, hidden_dim3, hidden_dim4, output_dim
):
super(ChemMultimodalMLP, self).__init__()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
super(ChemMultimodalMLP, self).__init__()
super().__init__()

Comment on lines 69 to 79

# 确保权重与特征的维度一致
weights = weights.clone().detach()

# 计算加权和
weighted_sum = sum(f * w for f, w in zip(features, weights))

# 计算权重和
total_weight = weights.sum()

# 返回加权平均
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的注释可以删掉

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ppsci/arch/chem.py]的内容已按照建议修改

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

本文件中的注释可以删除,多余空行也请删除

@YfB1125
Copy link
Author

YfB1125 commented Jun 30, 2025

请协助上传实验结果示意图,以供文档引用
chem

@YfB1125
Copy link
Author

YfB1125 commented Jun 30, 2025

还需要上传与实验结果对应的模型参数,请问怎么操作?

@HydrogenSulfate
Copy link
Collaborator

@leeleolay 看下

Copy link
Collaborator

@HydrogenSulfate HydrogenSulfate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 几处小问题还麻烦修改下
  2. @leeleolay 帮忙上传下数据

Comment on lines 11 to 14
``` sh
# 训练:
python chem.py mode=train
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
``` sh
# 训练:
python chem.py mode=train
```
``` sh
python chem.py
```

Comment on lines 18 to 21
``` sh
# 评估:
python chem.py mode=eval
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
``` sh
# 评估:
python chem.py mode=eval
```
``` sh
python chem.py mode=eval
```

solver.train()


def eval(cfg: DictConfig):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def eval(cfg: DictConfig):
def evaluate(cfg: DictConfig):

if cfg.mode == "train":
train(cfg)
elif cfg.mode == "eval":
eval(cfg)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
eval(cfg)
evaluate(cfg)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

函数名已修改

@leeleolay
Copy link
Contributor

leeleolay commented Jul 4, 2025

案例名字建议修改为SMCReac或其他有辨识度的名字,Chem的范围太大了

@leeleolay
Copy link
Contributor

https://paddle-org.bj.bcebos.com/paddlescience/datasets/SMCReac/data_set.xlsx 数据可参考这个链接,代码里可删除数据文件

@leeleolay
Copy link
Contributor

请协助上传实验结果示意图,以供文档引用 chem

https://paddle-org.bj.bcebos.com/paddlescience/docs/SMCReac/chem.png 图片可参考这个链接 原始文件可删除

@YfB1125
Copy link
Author

YfB1125 commented Jul 4, 2025

案例名字建议修改为SMCReac或其他有辨识度的名字,Chem的范围太大了

案例文件夹重命名为smc_reac,模型重命名为SuzukiMiyauraModel

@YfB1125
Copy link
Author

YfB1125 commented Jul 9, 2025

https://paddle-org.bj.bcebos.com/paddlescience/datasets/SMCReac/data_set.xlsx 数据可参考这个链接,代码里可删除数据文件

在smc_reac.md文档中已经新增数据集链接,并删除样例文件夹中的数据文件

@leeleolay
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants