Code Monkey home page Code Monkey logo

imagemol's Introduction

ImageMol

The code is an official PyTorch-based implementation in the paper Accurate prediction of molecular properties and drug targets using a self-supervised image representation learning framework (accepted in Nature Machine Intelligence, 2022).

DOI OSCS Status GitHub GitHub last commit

Abstract

The clinical efficacy and safety of a drug is determined by its molecular properties and targets in humans. However, proteome-wide evaluation of all compounds in humans, or even animal models, is challenging. In this study, we present an unsupervised pretraining deep learning framework, named ImageMol, pretrained on 10 million unlabelled drug-like, bioactive molecules, to predict molecular targets of candidate compounds. The ImageMol framework is designed to pretrain chemical representations from unlabelled molecular images on the basis of local and global structural characteristics of molecules from pixels. We demonstrate high performance of ImageMol in evaluation of molecular properties (that is, the drug’s metabolism, brain penetration and toxicity) and molecular target profiles (that is, beta-secretase enzyme and kinases) across 51 benchmark datasets. ImageMol shows high accuracy in identifying anti-SARS-CoV-2 molecules across 13 high-throughput experimental datasets from the National Center for Advancing Translational Sciences. Via ImageMol, we identified candidate clinical 3C-like protease inhibitors for potential treatment of COVID-19.

framework

News!

[2022/11/17] ImageMol is online.

[2022/10/07] Accepted in Nature Machine Intelligence, 2022.

[2022/09/17] Upload more benchmark datasets, including multi-label CYP450, kinases and KinomeScan.

[2022/07/28] Repository installation completed.

Install environment

1. GPU environment

CUDA 10.1

2. create a new conda environment

conda create -n imagemol python=3.7.3

conda activate imagemol

3. download some packages

conda install -c rdkit rdkit

windows:

linux:

pip install torch-cluster torch-scatter torch-sparse torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.4.0%2Bcu101.html

pip install -r requirements.txt

source activate imagemol

Pretraining

1. preparing dataset

Download pretraining data and put it into ./datasets/pretraining/data/

Preprocess dataset:

python ./data_process/smiles2img_pretrain.py --dataroot ./datasets/pretraining/ --dataset data

Note: You can find the toy dataset in ./datasets/toy/pretraining/

2. start to pretrain

Usage:

usage: pretrain.py [-h] [--lr LR] [--wd WD] [--workers WORKERS]
                   [--val_workers VAL_WORKERS] [--epochs EPOCHS]
                   [--start_epoch START_EPOCH] [--batch BATCH]
                   [--momentum MOMENTUM] [--checkpoints CHECKPOINTS]
                   [--seed SEED] [--dataroot DATAROOT] [--dataset DATASET]
                   [--ckpt_dir CKPT_DIR] [--modelname {ResNet18}]
                   [--verbose] [--ngpu NGPU] [--gpu GPU] [--nc NC] [--ndf NDF]
                   [--imageSize IMAGESIZE] [--Jigsaw_lambda JIGSAW_LAMBDA]
                   [--cluster_lambda CLUSTER_LAMBDA]
                   [--constractive_lambda CONSTRACTIVE_LAMBDA]
                   [--matcher_lambda MATCHER_LAMBDA]
                   [--is_recover_training IS_RECOVER_TRAINING]
                   [--cl_mask_type {random_mask,rectangle_mask,mix_mask}]
                   [--cl_mask_shape_h CL_MASK_SHAPE_H]
                   [--cl_mask_shape_w CL_MASK_SHAPE_W]
                   [--cl_mask_ratio CL_MASK_RATIO]

Code to pretrain:

python pretrain.py --ckpt_dir ./ckpts/pretraining/ \
                   --checkpoints 1 \
                   --Jigsaw_lambda 1 \
                   --cluster_lambda 1 \
                   --constractive_lambda 1 \
                   --matcher_lambda 1 \
                   --is_recover_training 1 \
                   --batch 256 \
                   --dataroot ./datasets/pretraining/ \
                   --dataset data \
                   --gpu 0,1,2,3 \
                   --ngpu 4

For testing, you can simply pre-train ImageMol using single GPU on toy dataset:

python pretrain.py --ckpt_dir ./ckpts/pretraining-toy/ \
                   --checkpoints 1 \
                   --Jigsaw_lambda 1 \
                   --cluster_lambda 1 \
                   --constractive_lambda 1 \
                   --matcher_lambda 1 \
                   --is_recover_training 1 \
                   --batch 16 \
                   --dataroot ./datasets/toy/pretraining/ \
                   --dataset data \
                   --gpu 0 \
                   --ngpu 1

Finetuning

1. Download pre-trained ImageMol

You can download pre-trained model and push it into the folder ckpts/

2. Finetune with pre-trained ImageMol

a) You can download molecular property prediciton datasets, CYP450 datasets, multi-label CYP450 dataset, SARS-CoV-2 datasets, kinases datasets and KinomeScan datasets and put it into datasets/finetuning/

b) The usage is as follows:

usage: finetune.py [-h] [--dataset DATASET] [--dataroot DATAROOT] [--gpu GPU]
                   [--workers WORKERS] [--lr LR] [--weight_decay WEIGHT_DECAY]
                   [--momentum MOMENTUM] [--seed SEED] [--runseed RUNSEED]
                   [--split {random,stratified,scaffold,random_scaffold,scaffold_balanced}]
                   [--epochs EPOCHS] [--start_epoch START_EPOCH]
                   [--batch BATCH] [--resume PATH] [--imageSize IMAGESIZE]
                   [--image_model IMAGE_MODEL] [--image_aug] [--weighted_CE]
                   [--task_type {classification,regression}]
                   [--save_finetune_ckpt {0,1}] [--log_dir LOG_DIR]

c) You can run ImageMol by simply using the following code:

python finetune.py --gpu ${gpu_no} \
                   --save_finetune_ckpt ${save_finetune_ckpt} \
                   --log_dir ${log_dir} \
                   --dataroot ${dataroot} \
                   --dataset ${dataset} \
                   --task_type ${task_type} \
                   --resume ${resume} \
                   --image_aug \
                   --lr ${lr} \
                   --batch ${batch} \
                   --epochs ${epoch}

For example:

python finetune.py --gpu 0 \
                   --save_finetune_ckpt 1 \
                   --log_dir ./logs/toxcast \
                   --dataroot ./datasets/finetuning/benchmarks \
                   --dataset toxcast \
                   --task_type classification \
                   --resume ./ckpts/ImageMol.pth.tar \
                   --image_aug \
                   --lr 0.5 \
                   --batch 64 \
                   --epochs 20

Note: You can tune more hyper-parameters during fine-tuning (see b) Usage).

Finetuned models

To ensure the reproducibility of ImageMol, we provided finetuned models for eight datasets, including:

You can evaluate the finetuned model by using the following command:

python evaluate.py --dataroot ${dataroot} \
                   --dataset ${dataset} \
                   --task_type ${task_type} \
                   --resume ${resume} \
                   --batch ${batch}

For example:

python evaluate.py --dataroot ./datasets/finetuning/benchmarks \
                   --dataset toxcast \
                   --task_type classification \
                   --resume ./toxcast.pth \
                   --batch 128

GradCAM Visualization

More about GradCAM heatmap can be found from this link: https://drive.google.com/file/d/1uu3Q6WLz8bJqcDaHEG84o3mFvemHoA2v/view?usp=sharing

To facilitate observation of high-confidence regions in the GradCAM heatmap, we use a confidence to filter out lower-confidence regions, which can be found from this link: https://drive.google.com/file/d/1631kSSiM_FSRBBkfh7PwI5p3LGqYYpMc/view?usp=sharing

run script

We also provide a script to generate GradCAM heatmaps:

usage: main.py [-h] [--image_model IMAGE_MODEL] --resume PATH --img_path
               IMG_PATH --gradcam_save_path GRADCAM_SAVE_PATH
               [--thresh THRESH]

you can run the following script:

python main.py --resume ${resume} \
               --img_path ${img_path} \
               --gradcam_save_path ${gradcam_save_path} \
               --thresh ${thresh}

Process your own dataset

If you want to process your own dataset and obtain molecular images, use the following steps:

  1. Preprocessing smiles: Please use the method preprocess_list(smiles) of this link to process your raw SMILES data;
  2. Transforming smiles to image: Convert canonical smiles to molecular images using dataloader.image_dataloader.Smiles2Img(smis, size=224, savePath=None)

Reference

If you use ImageMol in scholary publications, presentations or to communicate with your satellite, please cite the following work that presents the algorithms used:

@article{zeng2022accurate,
  title={Accurate prediction of molecular properties and drug targets using a self-supervised image representation learning framework},
  author={Zeng, Xiangxiang and Xiang, Hongxin and Yu, Linhui and Wang, Jianmin and Li, Kenli and Nussinov, Ruth and Cheng, Feixiong},
  journal={Nature Machine Intelligence},
  volume={4},
  number={11},
  pages={1004--1016},
  year={2022},
  publisher={Nature Publishing Group}
}

If you additionally want to cite this code package, please cite as follows:

@software{hongxinxiang_2022_7088986,
  author       = {HongxinXiang},
  title        = {HongxinXiang/ImageMol: v1.0.0},
  month        = sep,
  year         = 2022,
  publisher    = {Zenodo},
  version      = {v1.0.0},
  doi          = {10.5281/zenodo.7088986},
  url          = {https://doi.org/10.5281/zenodo.7088986}
}

imagemol's People

Contributors

hongxinxiang avatar pykao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

imagemol's Issues

ImportError: cannot import name 'parallel_info' from 'torch.config'

Hi authors,
I'm very interested in this model and I'm trying to install it on my system.
However, I've gotten to the PyTorch installation and I keep getting an error showing

Using cached torch_cluster-1.6.0.tar.gz (43 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Traceback (most recent call last):
File "", line 36, in
File "", line 34, in
File "/tmp/pip-install-m6s5wd8n/torch-cluster_c5c4961158204cfc86d0996e50312235/setup.py", line 10, in
from torch.config import parallel_info
ImportError: cannot import name 'parallel_info' from 'torch.config' (/home/zainab_ik/miniconda3/envs/imagemol/lib/python3.7/site-packages/torch/config.py)
[end of output]

I'd love your input on it.
@pykao @HongxinXiang

where is your pre-train model?

Dear author;
Thanks for your works. i am very interesting in this model. so i download pre-train model that you supplied. but when i download it totally i finded there was no model file in it, it conclude data only. Do you forget upload?

hyperparameter optimization

Hello,
I noticed finetune.py takes the inputs like learning rate, batch size, number of epochs (or use the default values if we do not specify them). I was wondering how we can optimize the hyperparameters for our own dataset.

Thank you

关于MPP下游任务实验结果的复现

学长你好,使用您预训练好的模型在下游任务跑的时候,即使我进行了超参数的搜索,也很难达到您论文中的结果,我不知道我的哪里出现了问题,我知道您提供了微调模型,但是我还是想请教您下游任务上的具体参数,谢谢!

issue with ImageMol performance

Hello,
training_class.out.txt
train_reg.out.txt

I am reaching out to seek help regarding the ImageMol package. I have used ImageMol to predict the antibiotic activity of compounds both for continuous and binary data. However, I am facing some issues and I am hoping you or one member of your group could help me in this regard.
For classification, the log file shows that the AUC is 0.725, however, I noticed all the probabilities are close to zero and therefore all the y_pred are zero. I was wondering if you have any suggestions to solve this problem. I am not sure why all the y_pred are zero with this high AUC.

For regression, all the y_score have the same value.

I really appreciate your help in this matter.

For your reference, I am attaching the log files for both classification and regression. Could you see if there is anything unusual in the log files?

Best Regards
Soo

issue with new evaluate.py

I just wanted to let you know the new "evaluate.py" still has issues. Please see the error below. I used the same pretrained model you provided in the Github and finetune it with my own datasets.

Traceback (most recent call last):
File "evaluate_cpu.py", line 123, in
main(args)
File "evaluate_cpu.py", line 95, in main
model.load_state_dict(checkpoint)
File "/scratch/gpfs/sg6615/CONDA/envs/imagemol/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1672, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for ResNet:
Missing key(s) in state_dict: "conv1.weight", "bn1.weight", "bn1.bias", "bn1.running_mean", "bn1.running_var", "layer1.0.conv1.weight", "layer1.0.bn1.weight", "layer1.0.bn1.bias", "layer1.0.bn1.running_mean", "layer1.0.bn1.running_var", "layer1.0.conv2.weight", "layer1.0.bn2.weight", "layer1.0.bn2.bias", "layer1.0.bn2.running_mean", "layer1.0.bn2.running_var", "layer1.1.conv1.weight", "layer1.1.bn1.weight", "layer1.1.bn1.bias", "layer1.1.bn1.running_mean", "layer1.1.bn1.running_var", "layer1.1.conv2.weight", "layer1.1.bn2.weight", "layer1.1.bn2.bias", "layer1.1.bn2.running_mean", "layer1.1.bn2.running_var", "layer2.0.conv1.weight", "layer2.0.bn1.weight", "layer2.0.bn1.bias", "layer2.0.bn1.running_mean", "layer2.0.bn1.running_var", "layer2.0.conv2.weight", "layer2.0.bn2.weight", "layer2.0.bn2.bias", "layer2.0.bn2.running_mean", "layer2.0.bn2.running_var", "layer2.0.downsample.0.weight", "layer2.0.downsample.1.weight", "layer2.0.downsample.1.bias", "layer2.0.downsample.1.running_mean", "layer2.0.downsample.1.running_var", "layer2.1.conv1.weight", "layer2.1.bn1.weight", "layer2.1.bn1.bias", "layer2.1.bn1.running_mean", "layer2.1.bn1.running_var", "layer2.1.conv2.weight", "layer2.1.bn2.weight", "layer2.1.bn2.bias", "layer2.1.bn2.running_mean", "layer2.1.bn2.running_var", "layer3.0.conv1.weight", "layer3.0.bn1.weight", "layer3.0.bn1.bias", "layer3.0.bn1.running_mean", "layer3.0.bn1.running_var", "layer3.0.conv2.weight", "layer3.0.bn2.weight", "layer3.0.bn2.bias", "layer3.0.bn2.running_mean", "layer3.0.bn2.running_var", "layer3.0.downsample.0.weight", "layer3.0.downsample.1.weight", "layer3.0.downsample.1.bias", "layer3.0.downsample.1.running_mean", "layer3.0.downsample.1.running_var", "layer3.1.conv1.weight", "layer3.1.bn1.weight", "layer3.1.bn1.bias", "layer3.1.bn1.running_mean", "layer3.1.bn1.running_var", "layer3.1.conv2.weight", "layer3.1.bn2.weight", "layer3.1.bn2.bias", "layer3.1.bn2.running_mean", "layer3.1.bn2.running_var", "layer4.0.conv1.weight", "layer4.0.bn1.weight", "layer4.0.bn1.bias", "layer4.0.bn1.running_mean", "layer4.0.bn1.running_var", "layer4.0.conv2.weight", "layer4.0.bn2.weight", "layer4.0.bn2.bias", "layer4.0.bn2.running_mean", "layer4.0.bn2.running_var", "layer4.0.downsample.0.weight", "layer4.0.downsample.1.weight", "layer4.0.downsample.1.bias", "layer4.0.downsample.1.running_mean", "layer4.0.downsample.1.running_var", "layer4.1.conv1.weight", "layer4.1.bn1.weight", "layer4.1.bn1.bias", "layer4.1.bn1.running_mean", "layer4.1.bn1.running_var", "layer4.1.conv2.weight", "layer4.1.bn2.weight", "layer4.1.bn2.bias", "layer4.1.bn2.running_mean", "layer4.1.bn2.running_var", "fc.weight", "fc.bias".
Unexpected key(s) in state_dict: "epoch", "model_state_dict", "optimizer_state_dict", "lr_scheduler", "loss", "result_dict".

tsne of molecular representation

hello @HongxinXiang , i want to plot the tsne figure of molecular representations, but my result is odd, i don't know where i make mistakes, can you show me an example of plotting such a figure, like using the 3CL dataset?
I am looking forward to your answer.

Reproducing Results for Finetuning ImageMol on GPCR assays and Sars-CoV2 assays

Hi!
I have been trying to fine tune ImageMol on SARS-CoV-2 and GPCR assays but I have not been able to get the same rocauc score as mentioned in the paper's results. Here are some of the hyperparam values that I have tried. along with their results:

3CL enzymatic activity

  • lr: 0.5, batch 128, epochs 20 with final results: highest_valid: 0.685, final_train: 0.532, final_test: 0.542
  • lr: 0.1, batch 32, epochs 20 with final results: highest_valid: 0.586, final_train: 0.489, final_test: 0.240
  • lr: 0.01, batch 32, epochs 30 with final results: highest_valid: 0.551, final_train: 0.956, final_test: 0.677

It's a bit odd that there's a downward trend within the validation score with decreasing the learning rate. Could you please provide me with the exact choice of hyperparameter values for reproducing the paper's results across all 13 SARS-CoV-2 and the 10 GPCR assays? It's a tall ask but if you could share the fine tuned models, that would be fantastic!

I am a volunteer at https://github.com/ersilia-os/ , a non profit, where we are building data science tools to aid drug discovery in low resourced countries. We are very interested in incorporating ImageMol fine tuned on these assays in our model hub because this will be immensely valuable for the community, and we value any help you could offer on this front.

pretrained model

Hello,
I would like to double-check that I used the right pre-trained model. Is the model in the link below the complete and updated model?

gdown --id 1wQfby8JIhgo3DxPvFeHXPc14wS-b4KB5

I tried to generate pre-train model myself, however, when I run the code below, only around 4 million smiles converted to images. Is this what it is supposed to be?
python ./data_process/smiles2img_pretrain.py --dataroot ./datasets/pretraining/ --dataset data

I appreciate it if you help me to run Imagemol on my dataset.

running imagemol on gpu

Hello,
I am having difficulty running Imagemol on GPU. Here are my slurm job and the error that I get:

I appreciate your help.

Best Regards
Soo

#!/bin/bash
#SBATCH --job-name=test
#SBATCH --nodes=1 # node count
#SBATCH --ntasks=1 # total number of tasks across all nodes
#SBATCH --cpus-per-task=4 # cpu-cores per task (>1 if multi-threaded tasks)
#SBATCH --mem-per-cpu=4G # memory per cpu-core (4G is default)
#SBATCH --time=72:00:00 # total run time limit (HH:MM:SS)
#SBATCH --mail-type=begin # send email when job begins
#SBATCH --mail-type=end # send email when job ends
#SBATCH --[email protected]
#SBATCH -o ./classification/test_logs/gpu_testing.out
#SBATCH -p cryoem
#SBATCH --gres=gpu:1 # number of gpus per node

module purge
module load anaconda3/2023.3
#conda activate imagemol
#module load cudatoolkit/11.7
#module load nvhpc/22.5
conda activate gpu-imagemol

python ../finetune_gpu.py --gpu 1 --ngpu 1 --save_finetune_ckpt 1 --log_dir ./classification/test_logs --dataroot /scratch/gpfs/sg6615/ImageMol/final_data --dataset classification --task_type classification --resume /scratch/gpfs/sg6615/ImageMol/pretrain_model/ImageMol.pth.tar --image_aug --lr 0.5 --batch 8 --epochs 10 --split random

/scratch/gpfs/sg6615/CONDA/envs/gpu-imagemol/lib/python3.7/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: libtorch_cuda_cu.so: cannot open shared object file: No such file or directory
warn(f"Failed to load image Python extension: {e}")
Traceback (most recent call last):
File "../finetune_gpu.py", line 10, in
import torchvision.transforms as transforms
File "/scratch/gpfs/sg6615/CONDA/envs/gpu-imagemol/lib/python3.7/site-packages/torchvision/init.py", line 5, in
from torchvision import datasets, io, models, ops, transforms, utils
File "/scratch/gpfs/sg6615/CONDA/envs/gpu-imagemol/lib/python3.7/site-packages/torchvision/models/init.py", line 17, in
from . import detection, optical_flow, quantization, segmentation, video
File "/scratch/gpfs/sg6615/CONDA/envs/gpu-imagemol/lib/python3.7/site-packages/torchvision/models/quantization/init.py", line 3, in
from .mobilenet import *
File "/scratch/gpfs/sg6615/CONDA/envs/gpu-imagemol/lib/python3.7/site-packages/torchvision/models/quantization/mobilenet.py", line 1, in
from .mobilenetv2 import * # noqa: F401, F403
File "/scratch/gpfs/sg6615/CONDA/envs/gpu-imagemol/lib/python3.7/site-packages/torchvision/models/quantization/mobilenetv2.py", line 5, in
from torch.ao.quantization import DeQuantStub, QuantStub
ImportError: cannot import name 'QuantStub' from 'torch.ao.quantization' (/scratch/gpfs/sg6615/CONDA/envs/gpu-imagemol/lib/python3.7/site-packages/torch/ao/quantization/init.py)

issue with evaluate.py

Hello,
I am running imagemol for my dataset to predict the properties of molecules. I used the pretrained model on the github and ran finetune.py on my dataset. Now, I run into an error when I run evaluate.py. Please see the error below. Could you please help me with this issue? Should I trained the pretrained model?

Thank you

/scratch/gpfs/sg6615/CONDA/envs/imagemol/lib/python3.7/site-packages/torchvision/models/_utils.py:209: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.
f"The parameter '{pretrained_param}' is deprecated since 0.13 and may be removed in the future, "
/scratch/gpfs/sg6615/CONDA/envs/imagemol/lib/python3.7/site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or None for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing weights=None.
warnings.warn(msg)
Architecture: ResNet18
eval_metric: rmse
****smiles Cc1ccc(C(C)(C)C(=O)N2CCC(c3cc(Nc4ncccn4)cc(C)n3)CC2)cc1
****smiles Cc1c(Cl)cccc1S(=O)(=O)NC(=O)c1ccc(OCc2ccccc2F)cc1
=> loading checkpoint '/scratch/gpfs/sg6615/ImageMol/logs/random/random_valid_best.pth'
Traceback (most recent call last):
File "evaluate.py", line 120, in
main(args)
File "evaluate.py", line 92, in main
model.load_state_dict(checkpoint)
File "/scratch/gpfs/sg6615/CONDA/envs/imagemol/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1672, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for ResNet:
Missing key(s) in state_dict: "conv1.weight", "bn1.weight", "bn1.bias", "bn1.running_mean", "bn1.running_var", "layer1.0.conv1.weight", "layer1.0.bn1.weight", "layer1.0.bn1.bias", "layer1.0.bn1.running_mean", "layer1.0.bn1.running_var", "layer1.0.conv2.weight", "layer1.0.bn2.weight", "layer1.0.bn2.bias", "layer1.0.bn2.running_mean", "layer1.0.bn2.running_var", "layer1.1.conv1.weight", "layer1.1.bn1.weight", "layer1.1.bn1.bias", "layer1.1.bn1.running_mean", "layer1.1.bn1.running_var", "layer1.1.conv2.weight", "layer1.1.bn2.weight", "layer1.1.bn2.bias", "layer1.1.bn2.running_mean", "layer1.1.bn2.running_var", "layer2.0.conv1.weight", "layer2.0.bn1.weight", "layer2.0.bn1.bias", "layer2.0.bn1.running_mean", "layer2.0.bn1.running_var", "layer2.0.conv2.weight", "layer2.0.bn2.weight", "layer2.0.bn2.bias", "layer2.0.bn2.running_mean", "layer2.0.bn2.running_var", "layer2.0.downsample.0.weight", "layer2.0.downsample.1.weight", "layer2.0.downsample.1.bias", "layer2.0.downsample.1.running_mean", "layer2.0.downsample.1.running_var", "layer2.1.conv1.weight", "layer2.1.bn1.weight", "layer2.1.bn1.bias", "layer2.1.bn1.running_mean", "layer2.1.bn1.running_var", "layer2.1.conv2.weight", "layer2.1.bn2.weight", "layer2.1.bn2.bias", "layer2.1.bn2.running_mean", "layer2.1.bn2.running_var", "layer3.0.conv1.weight", "layer3.0.bn1.weight", "layer3.0.bn1.bias", "layer3.0.bn1.running_mean", "layer3.0.bn1.running_var", "layer3.0.conv2.weight", "layer3.0.bn2.weight", "layer3.0.bn2.bias", "layer3.0.bn2.running_mean", "layer3.0.bn2.running_var", "layer3.0.downsample.0.weight", "layer3.0.downsample.1.weight", "layer3.0.downsample.1.bias", "layer3.0.downsample.1.running_mean", "layer3.0.downsample.1.running_var", "layer3.1.conv1.weight", "layer3.1.bn1.weight", "layer3.1.bn1.bias", "layer3.1.bn1.running_mean", "layer3.1.bn1.running_var", "layer3.1.conv2.weight", "layer3.1.bn2.weight", "layer3.1.bn2.bias", "layer3.1.bn2.running_mean", "layer3.1.bn2.running_var", "layer4.0.conv1.weight", "layer4.0.bn1.weight", "layer4.0.bn1.bias", "layer4.0.bn1.running_mean", "layer4.0.bn1.running_var", "layer4.0.conv2.weight", "layer4.0.bn2.weight", "layer4.0.bn2.bias", "layer4.0.bn2.running_mean", "layer4.0.bn2.running_var", "layer4.0.downsample.0.weight", "layer4.0.downsample.1.weight", "layer4.0.downsample.1.bias", "layer4.0.downsample.1.running_mean", "layer4.0.downsample.1.running_var", "layer4.1.conv1.weight", "layer4.1.bn1.weight", "layer4.1.bn1.bias", "layer4.1.bn1.running_mean", "layer4.1.bn1.running_var", "layer4.1.conv2.weight", "layer4.1.bn2.weight", "layer4.1.bn2.bias", "layer4.1.bn2.running_mean", "layer4.1.bn2.running_var", "fc.weight", "fc.bias".
Unexpected key(s) in state_dict: "epoch", "model_state_dict", "optimizer_state_dict", "lr_scheduler", "loss", "result_dict".

Documentation improvement

Hi,
While installing the ImageMol on my system, I realized my error is due to a misunderstanding of the docs and I request to fix that.
I'd love to do a few edits to the readme file.
Thank you.

pretrained model

Dear author:
I am very interested in the new molecular representation you proposed, but there is something wrong when I download the pre-trained model. Could you please provide a more general github URL containing the training data and the pre-trained model. Thank you.

IndexError for getting labels

Thanks for this great work! When I run the pretrain code, I encounter this exception:

original_label2_var = torch.autograd.Variable(original_label[1].cuda())
IndexError: index 1 is out of bounds for dimension 0 with size 1

at

original_label1_var = torch.autograd.Variable(original_label[0].cuda())

Dataloader will generator data with an extra batch-axis at dim 0:
image
I think the following mght fix up this issue.
image
Is it correct?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.