zjunlp / molgen Goto Github PK
View Code? Open in Web Editor NEW[ICLR 2024] Domain-Agnostic Molecular Generation with Chemical Feedback
Home Page: https://huggingface.co/spaces/zjunlp/MolGen
License: MIT License
[ICLR 2024] Domain-Agnostic Molecular Generation with Chemical Feedback
Home Page: https://huggingface.co/spaces/zjunlp/MolGen
License: MIT License
您好,我对你们的工作很感兴趣,并想要复现Table 1那些遥遥领先的测试分数。然而,使用提供的预训练模型 link1 生成分子进行测试,我并没有得到接近表格中的结果。
使用moses test数据集的前10K个分子作为指导分子。使用 generate.sh 脚本生成分子:
deepspeed --include localhost:0,1,2,3 generate_ds.py --dist 1 \
--gpu 4 \
--batch_size 5 \
--exp_name generate \
--exp_id qed \
--return_num 20 \
--max_len 100 \
--min_len 20 \
--top_k 30 \
--top_p 1 \
--beam 1300 \
--process 'generate' \
--generate_mode 'topk' \
--checkpoint_path '../moldata/checkpoint/molgen.pkl' \
--input_path '../moldata/finetune/test_first_10K.csv' \
--generate_path '../moldata/generate/optimize_f10K.csv' \
--property 'qed' \
--deepspeed \
--deepspeed_config generate_config.json \
采用moses的测试函数对其进行测试。
import moses.metrics as mcs
file_path = "./MolGen/moldata/generate/optimize_f10K.csv"
data = pd.read_csv(file_path, dtype=str)
smiles = data['candidate_smiles']
metrics = mcs.get_all_metrics(smiles, device="cuda:0")
预期生成结果如Table 1,实际生成结果如下:
{'FCD/Test': 40.90308785709429,
'FCD/TestSF': 42.028217393026495,
'Filters': 0.02705060207140637,
'Frag/Test': 0.28600698030425464,
'Frag/TestSF': 0.27391998139090723,
'IntDiv': 0.8993964364626843,
'IntDiv2': 0.8804226826180745,
'Novelty': 1.0,
'QED': 0.6386171938374946,
'SA': 3.5723966047348865,
'SNN/Test': 0.17555409343519618,
'SNN/TestSF': 0.1655550900856655,
'Scaf/Test': 0.0,
'Scaf/TestSF': 0.0,
'logP': 2.028207020853999,
'unique@1000': 0.875,
'unique@10000': 0.8301,
'valid': 0.99739,
'weight': 123.78018379991674}
可以看到,很多分数与预期实验结果相差甚远。尝试修改return_num/max_len等参数也没有获得更好的结果。
希望您能指出我的测试方法存在的不足,并给出得到Table 1优异数据的方法步骤。我还是一个科研菜鸟,这是我第一次尝试复现前沿研究论文,如是简单错漏请多多包涵,万分感谢!祝你们以后的研究一直“遥遥领先”!
Hello, and great job!
1、When generating the 10K molecules in Table 1、Table2, or Table3, should we input some molecules, are they from the ZINK250K or MOSES?
2、MOLGEN can generate better molecules when gives the inputs, so the generation process is actually an optimization process, am i right?
Thank you very much!
Really thanks for your great code and essay.
When I was trying to do the project, questions came to me like the usage of the different datasets, the input/output things and the time it consumes.
For datasets confusions, it is obvious that 100M data from ZINC15 were selected for pretraining but there are several datasets files in dir "finetune" which confuse me. I am just wondering, in order to achieve the whole process, which one should be used for pretraining and which for finetune under the multi-task environment.
Otherwise, about the time, I checked 250,000 data running on our device(usage of 3 V100s, 16GB) and it turned out to be in 2-3 days to complete the whole process. And you mentioned 6 V100s were used for training, so i was wondering how long it took to pretrain your model on 100M ZINC15 dataset as my personal reference.
Last, I've seen the .sh files in your dir, it bothered me whether the defaulted parameters in it need to be fixed or not, including the datasets path... because I found some path or files' names didn't exist in the project...
Thanks for noticing this :)
Hi,
After I tried preprocessing and fine-tuning, I found that two checkpoint files were generated, one is called 'mp_rank_00_model_states.pt' and the other one is called 'zero_pp_rank_0_mp_rank_00_optim_states.pt'. It seems that both of them could be used for the following generative task as the checkpoint_path, and give me similar generative results. It would be highly appreciated if more details or explanations could be given.
Many thanks in advance!
Song
Hello, and great job!
Before running the finetuning process, you mentioned generating the candidate datasets with the pretrained model.
Is the pretrained model located at the path moldata/checkpoint/molgen.pkl?
I have downloaded the Hugging Face model but didn't find molgen.pkl.
moldata
├── checkpoint
│ ├── molgen.pkl # pre-trained model
Thank you!
Hi,
Fascinating project! I was just wondering, how should I format the data for finetuning purposes? More specifically, what columns do I need? The CandidateDataset class asks for 'input' and 'candidates', but the files under moldata/finetune/ do not have these columns. If I have a custom property that I'd like to predict, what should I name it?
Thanks a lot!
Hi, thanks for you great work.
In your paper, you mentioned that this work is focused on two-dimensional molecules. From my understanding, two-dimensional molecules refer to molecules represented using a graph data structure. I would like to know the reason behind using this term.
I would like to ask, are the vocabularies used in NP dataset and synthetic dataset the same, that is, in the second stage of pre-training mentioned in the paper, but the Nature products are much longer than the synthetic? Can you tell me what sequence length you set for the encoder?
Hi,
I recently came across your work "Molecular Language Model as Multi-task Generator" and found it very interesting. I have a question regarding molecule generation with optimized chemical properties.
I noticed that in your code, the QED and PlogP features are calculated using RDKit, which relies on SMILES strings as input. However, I was wondering if it is possible to use other chemical features that do not rely on SMILES strings to achieve the generative task.
For example, if I have a dataset with SMILES and their chemical properties (which are experimental data), would it be possible to use your model to achieve the generative task?
I am very interested in exploring this idea further and would appreciate any insights or suggestions you may have. Thank you so much for your time.
Best regards,
Song
Bravor job! I'm curious that if the size of "src_id" and "candidate_id" are "[bs, num_input, max_len]" and "[bs, num_cand, max_len]", in which num_cand = num_samples*num_input. However, when the 2nd dimension of them are different, the programme doesn't make sense.
By the way, "input_ids" and "decoder_input_ids" don't seem to be used in finetune.py.
Hope for your reply!
Hi Authors,
Congratulations on your outstanding work. MolGen is an invaluable contribution to the field of molecule generation.
I am particularly interested in understanding the training intricacies of the recently released LM Mol-Gen 7b. Specifically, I have a few questions:
Your insights would greatly enrich my understanding of the model's architecture and training strategy. I look forward to your response.
你好, 请问一下啊, 文章中说 MPT 可以在不同 tasks 和 domains 之间共享知识 是什么意思呢?
使用 MPT 方法, 不也是对每个 QED, p-logP 优化任务单独做参数调整吗?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.