Giter Club home page Giter Club logo

cigin's People

Contributors

yp201 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

Watchers

 avatar  avatar  avatar  avatar

cigin's Issues

Hi,

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.

best_model.tar

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?

CIGIN_V2 data loader

Please provide the data loader code for the MNSolv Dataset. I would like to try out the results reported in your paper. Thanks.

TypeError: iteration over a 0-d array

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.

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)

  1. is not fixed: np is undefined in model.py. (There may be more.) Please run the code as is, without external files, fix all errors and verify results.

Full code

Please provide the full code (including data, data loading, model training and evaluation).

Thanks.

CIGIN_V2

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.

AttributeError: 'numpy.ndarray' object has no attribute 'device'

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'

PyTorch Geometric implementation

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.

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.