{"id":21573664,"url":"https://github.com/yuyangw/imolclr","last_synced_at":"2026-02-18T06:31:13.328Z","repository":{"id":65400398,"uuid":"482628455","full_name":"yuyangw/iMolCLR","owner":"yuyangw","description":"Implementation of iMolCLR: \"Improving Molecular Contrastive Learning via Faulty Negative Mitigation and Decomposed Fragment Contrast\" in PyG.","archived":false,"fork":false,"pushed_at":"2022-08-30T19:00:52.000Z","size":9012,"stargazers_count":17,"open_issues_count":5,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T16:25:04.597Z","etag":null,"topics":["deep-learning","graph-neural-networks","molecule","pytorch","pytorch-geometric","self-supervised-learning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yuyangw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-17T20:39:53.000Z","updated_at":"2024-11-06T14:12:07.000Z","dependencies_parsed_at":"2023-01-23T02:00:51.339Z","dependency_job_id":null,"html_url":"https://github.com/yuyangw/iMolCLR","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yuyangw/iMolCLR","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuyangw%2FiMolCLR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuyangw%2FiMolCLR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuyangw%2FiMolCLR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuyangw%2FiMolCLR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yuyangw","download_url":"https://codeload.github.com/yuyangw/iMolCLR/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuyangw%2FiMolCLR/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29570327,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T06:19:27.422Z","status":"ssl_error","status_checked_at":"2026-02-18T06:18:44.348Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","graph-neural-networks","molecule","pytorch","pytorch-geometric","self-supervised-learning"],"created_at":"2024-11-24T12:07:40.219Z","updated_at":"2026-02-18T06:31:13.307Z","avatar_url":"https://github.com/yuyangw.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Improving Molecular Contrastive Learning via Faulty Negative Mitigation and Decomposed Fragment Contrast ## \n\n#### Journal of Chemical Information and Modeling [[Paper]](https://pubs.acs.org/doi/full/10.1021/acs.jcim.2c00495) [[arXiv]](https://arxiv.org/abs/2202.09346) [[PDF]](https://arxiv.org/pdf/2202.09346.pdf) \u003c/br\u003e \n[Yuyang Wang](https://yuyangw.github.io/), [Rishikesh Magar](https://www.linkedin.com/in/rishikesh-magar), Chen Liang, [Amir Barati Farimani](https://www.meche.engineering.cmu.edu/directory/bios/barati-farimani-amir.html) \u003c/br\u003e Carnegie Mellon University \u003c/br\u003e\n\n\u003cimg src=\"figs/pipeline.png\" width=\"500\"\u003e\n\nThis is the offical implementation of \u003cstrong\u003e\u003cem\u003eiMolCLR\u003c/em\u003e\u003c/strong\u003e: [\"Improving Molecular Contrastive Learning via Faulty Negative Mitigation and Decomposed Fragment Contrast\"](https://pubs.acs.org/doi/full/10.1021/acs.jcim.2c00495). \nIf you find our work useful in your research, please cite:\n\n```\n@article{wang2022improving,\n  title={Improving Molecular Contrastive Learning via Faulty Negative Mitigation and Decomposed Fragment Contrast},\n  author={Wang, Yuyang and Magar, Rishikesh and Liang, Chen and Farimani, Amir Barati},\n  journal={Journal of Chemical Information and Modeling},\n  volume={59},\n  number={8},\n  pages={3370--3388},\n  year={2022},\n  publisher={ACS Publications},\n  doi={10.1021/acs.jcim.2c00495}\n}\n\n@article{wang2022molclr,\n  title={Molecular contrastive learning of representations via graph neural networks},\n  author={Wang, Yuyang and Wang, Jianren and Cao, Zhonglin and Barati Farimani, Amir},\n  journal={Nature Machine Intelligence},\n  pages={1--9},\n  year={2022},\n  publisher={Nature Publishing Group},\n  doi={10.1038/s42256-022-00447-x}\n}\n```\n\n## Getting Started\n\n### Installation\n\nSet up conda environment and clone the github repo\n\n```\n# create a new environment\n$ conda create --name imolclr python=3.7\n$ conda activate imolclr\n\n# install requirements\n$ pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 -f https://download.pytorch.org/whl/torch_stable.html\n$ pip install torch-geometric==1.6.3 torch-sparse==0.6.9 torch-scatter==2.0.6 -f https://pytorch-geometric.com/whl/torch-1.7.0+cu110.html\n$ pip install PyYAML\n$ conda install -c conda-forge rdkit=2021.09.1 \n$ conda install -c conda-forge tensorboard\n\n# clone the source code of iMolCLR\n$ git clone https://github.com/yuyangw/iMolCLR.git\n$ cd iMolCLR\n```\n\n### Dataset\n\nYou can download the pre-training data and benchmarks used in the paper [here](https://drive.google.com/file/d/1aDtN6Qqddwwn2x612kWz9g0xQcuAtzDE/view?usp=sharing) and extract the zip file under `./data` folder. The data for pre-training can be found in `pubchem-10m-clean.txt`. All the databases for fine-tuning are saved in the folder under the benchmark name. You can also find the benchmarks from [MoleculeNet](https://moleculenet.org/).\n\n### Pre-training\n\nTo train the iMolCLR, where the configurations are defined in `config.yaml`\n```\n$ python imolclr.py\n```\n\nTo monitor the training via tensorboard, run `tensorboard --logdir ckpt/{PATH}` and click the URL http://127.0.0.1:6006/.\n\n### Fine-tuning \n\nTo fine-tune the iMolCLR pre-trained model on downstream molecular benchmarks, where the configurations are defined in `config_finetune.yaml`\n```\n$ python finetune.py\n```\n\n### Pre-trained model\n\nWe also provide a pre-trained model, which can be found in `ckpt/pretrained`. You can load the model by change the `fine_tune_from` variable in `config_finetune.yaml` to `pretrained`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuyangw%2Fimolclr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyuyangw%2Fimolclr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuyangw%2Fimolclr/lists"}