devalab / cigin Goto Github PK
View Code? Open in Web Editor NEWAAAI 2020: Chemically Interpretable Graph Interaction Network for Prediction of Pharmacokinetic Properties of Drug-like Molecules
License: MIT License
AAAI 2020: Chemically Interpretable Graph Interaction Network for Prediction of Pharmacokinetic Properties of Drug-like Molecules
License: MIT License
Hi,
Thanks for your inputs, we would update the code with deep graph library. (https://www.dgl.ai/) shortly, in our second version,both are similar libraries.
You may look this up for performance comparisons. https://github.com/dmlc/dgl
Originally posted by @yp201 in #2 (comment)
With CIGIN in DGL as V2, it should be easy to port it to PyG as V3. That will broaden the appeal of CIGIN since PyG is three times more widely used than DGL. Also, please provide the data loaders for the real datasets in the package. Thanks.
hi,bro!
I have a question, when the model has been trained and save in "bese_model.tar", how to load and use the mode?
Please provide the data loader code for the MNSolv Dataset. I would like to try out the results reported in your paper. Thanks.
Hi, I conduct experiments on MNSol, and get the following error in the collate function.
(I am running: python main.py --name cigin --interaction dot --batch_size 32)
Traceback (most recent call last):
File "main.py", line 108, in <module>
main()
File "main.py", line 104, in main
train(max_epochs, model, optimizer, scheduler, train_loader, valid_loader, project_name)
File "/users7/ythou/Projects/code/Medical/CIGIN/CIGIN_V2/train.py", line 40, in train
for samples in tq_loader:
File "/users4/ythou/anaconda3/envs/py37/lib/python3.7/site-packages/tqdm/_tqdm.py", line 1032, in __iter__
for obj in iterable:
File "/users4/ythou/anaconda3/envs/py37/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 346, in __next__
data = self.dataset_fetcher.fetch(index) # may raise StopIteration
File "/users4/ythou/anaconda3/envs/py37/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch
return self.collate_fn(data)
File "main.py", line 57, in collate
solute_len_matrix = get_len_matrix(solute_graphs.batch_num_nodes)
File "/users7/ythou/Projects/code/Medical/CIGIN/CIGIN_V2/utils.py", line 23, in get_len_matrix
for l in len_list:
TypeError: iteration over a 0-d array
Here are the printed results for solute_graphs.batch_num_nodes
<bound method DGLHeteroGraph.batch_num_nodes of Graph(num_nodes=161, num_edges=270,
ndata_schemes={'x': Scheme(shape=(42,), dtype=torch.int64)}
edata_schemes={'w': Scheme(shape=(10,), dtype=torch.bool)})>
How can I deal with it?
Hi, Chang.
The code runs expected. 1) and 2) were being imported in the corresponding helper files, but for ease of use, we have fixed it.
Thanks
Originally posted by @yp201 in #4 (comment)
Please provide the full code (including data, data loading, model training and evaluation).
Thanks.
The code has issues. Here are trivial examples:
(1) main.py: dgl is undefined
(2) model.py: np is undefined
Please make necessary corrections, ensure the code runs, and ensure it generates expected results. Thanks.
Using backend: pytorch
0%| | 0/1 [00:00<?, ?it/s]
Traceback (most recent call last):
File "main.py", line 105, in
main()
File "main.py", line 101, in main
train(max_epochs, model, optimizer, scheduler, train_loader, valid_loader, project_name)
File "F:\zouyr\pythonProject\CIGIN-master\CIGIN_V2\train.py", line 40, in train
for samples in tq_loader:
File "D:\ANACONDA\envs\onionnet\lib\site-packages\tqdm\std.py", line 1178, in iter
for obj in iterable:
File "D:\ANACONDA\envs\onionnet\lib\site-packages\torch\utils\data\dataloader.py", line 517, in next
data = self._next_data()
File "D:\ANACONDA\envs\onionnet\lib\site-packages\torch\utils\data\dataloader.py", line 557, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "D:\ANACONDA\envs\onionnet\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "D:\ANACONDA\envs\onionnet\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "main.py", line 74, in getitem
solute_graph = get_graph_from_smile(solute)
File "F:\zouyr\pythonProject\CIGIN-master\CIGIN_V2\molecular_graph.py", line 95, in get_graph_from_smile
G.ndata['x'] = np.array(node_features)
File "D:\ANACONDA\envs\onionnet\lib\site-packages\dgl\view.py", line 81, in setitem
self._graph._set_n_repr(self._ntid, self._nodes, {key : val})
File "D:\ANACONDA\envs\onionnet\lib\site-packages\dgl\heterograph.py", line 3994, in _set_n_repr
if F.context(val) != self.device:
File "D:\ANACONDA\envs\onionnet\lib\site-packages\dgl\backend\pytorch\tensor.py", line 76, in context
return input.device
AttributeError: 'numpy.ndarray' object has no attribute 'device'
If not too much trouble, please adapt the code to use PyTorch Geometric. This has two benefits: (1) MessagePassing will conform to the common usage as a base class (framework) to be subclassed / implemented with concrete message, aggregation and update functions, and (2) All types of graph convolutions that subclass from MessagePassing in PyTorch Geometric can readily be used for the message passing phase.
Thanks.
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.