Giter VIP home page Giter VIP logo

gam's Introduction

Benedek A. Rozemberczki/ Homepage / Twitter / GitHub / Google Scholar

Welcome stranger

  • ⏰ Currently working on machine learning for drug discovery.
  • 🤖 I would love to collaborate on the machine learning libraries ChemicalX and RexMex.

Great news

gam's People

Contributors

benedekrozemberczki avatar deepakn97 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

gam's Issues

"inverse_labels"

Excuse me, in the program, which part of the paper does "inverse_labels" appear in? I downloaded the NCI_1 dataset without seeing it. I hope you can see the incomprehensible answer to me, thank you.

Loss is negative

And this loss was 2 at the beginning and then dropped to -400,what's wrong with it ?can you help me .thaks a lot.

ValueError: probabilities contain NaN

Hi, thank you very much for your excellent work, I created my own dataset following the .json file format in your code, I had this problem after training part of my data, I observed the difference between our data, there is a non-connected graph in my data and there are isolated nodes, is this the reason why the code is wrong in the middle of training?
Training started.

Epoch: 0%| | 0/10 [00:00<?, ?it/s]
0%| | 0/25 [00:00<?, ?it/s]
(Loss=4.1643): 0%| | 0/25 [00:01<?, ?it/s]
(Loss=4.1643): 4%|▍ | 1/25 [00:01<00:29, 1.22s/it]
(Loss=1.1765): 4%|▍ | 1/25 [00:02<00:29, 1.22s/it]
(Loss=1.1765): 8%|▊ | 2/25 [00:02<00:28, 1.26s/it]
(Loss=-1.8768): 8%|▊ | 2/25 [00:03<00:28, 1.26s/it]
(Loss=-1.8768): 12%|█▏ | 3/25 [00:03<00:26, 1.20s/it]
(Loss=-1.1337): 12%|█▏ | 3/25 [00:04<00:26, 1.20s/it]
(Loss=-1.1337): 16%|█▌ | 4/25 [00:05<00:26, 1.27s/it]
Epoch: 0%| | 0/10 [00:05<?, ?it/s]
Traceback (most recent call last):
File "D:/GAM-master/src/main.py", line 19, in
main()
File "D:/GAM-master/src/main.py", line 14, in main
model.fit()
File "D:\GAM-master\src\gam.py", line 272, in fit
self.epoch_loss = self.epoch_loss + self.process_batch(batches[batch])
File "D:\GAM-master\src\gam.py", line 240, in process_batch
batch_loss = self.process_graph(graph_path, batch_loss)
File "D:\GAM-master\src\gam.py", line 221, in process_graph
predictions, node, attention_score = self.model(data, graph, features, node)
File "D:\anaconda\envs\spyder\lib\site-packages\torch\nn\modules\module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "D:\GAM-master\src\gam.py", line 180, in forward
self.state, node, attention_score = self.step_block(data, graph, features, node)
File "D:\anaconda\envs\spyder\lib\site-packages\torch\nn\modules\module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "D:\GAM-master\src\gam.py", line 97, in forward
feature_row, node, attention_score = self.make_step(node, graph, features,
File "D:\GAM-master\src\gam.py", line 78, in make_step
label = self.sample_node_label(orig_neighbors, graph, features)
File "D:\GAM-master\src\gam.py", line 66, in sample_node_label
label = np.random.choice(np.arange(len(self.identifiers)), p=normalized_attention_spread)
File "mtrand.pyx", line 928, in numpy.random.mtrand.RandomState.choice
ValueError: probabilities contain NaN

Process finished with exit code 1

Here's an example from my .json file
{"target": 1,"edges":[[0,2],[0,8],[0,12],[0,13],[0,14],[1,2],[1,8],[2,3],[2,8],[3,5],[6,14],[11,12],[11,13]],"labels":{"0":113,"1":106,"2":78,"3":102,"4":91,"5":63,"6":68,"7":76,"8":73,"9":119,"10":87,"11":102,"12":110,"13":117,"14":78,"15":124},"inverse_labels":{"113":[0],"106":[1],"78":[2,14],"102":[3,11],"91":[4],"63":[5],"68":[6],"76":[7],"73":[8],"119":[9],"87":[10],"110":[12],"117":[13],"124":[15]}}

Sorry for disturbing you, thank you very much for your help !

Unhashable type dict

I tried to run the code with default parameters and dataset, and on different systems I got the same error:

Epoch:   0%|                                                                                    | 0/10 [00:00<?, ?it/s]Traceback (most recent call last):                                                                | 0/2 [00:00<?, ?it/s]
  File "src/main.py", line 17, in <module>
    main()
  File "src/main.py", line 12, in main
    model.fit()
  File "C:\Users\acecreamu\GAM\src\gam.py", line 251, in fit
    self.epoch_loss = self.epoch_loss + self.process_batch(batches[batch])
  File "C:\Users\acecreamu\GAM\src\gam.py", line 221, in process_batch
    batch_loss = self.process_graph(graph_path, batch_loss)
  File "C:\Users\acecreamu\GAM\src\gam.py", line 202, in process_graph
    predictions, node, attention_score = self.model(data, graph, features, node)
  File "C:\Users\acecreamu\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 491, in __call__
    result = self.forward(*input, **kwargs)
  File "C:\Users\acecreamu\GAM\src\gam.py", line 166, in forward
    self.state, node, attention_score = self.step_block(data, graph, features, node)
  File "C:\Users\acecreamu\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 491, in __call__
    result = self.forward(*input, **kwargs)
  File "C:\Users\acecreamu\GAM\src\gam.py", line 88, in forward
    feature_row, node, attention_score = self.make_step(node, graph, features, data["labels"], data["inverse_labels"])
  File "C:\Users\acecreamu\GAM\src\gam.py", line 69, in make_step
    original_neighbors = set(nx.neighbors(graph, node))
  File "C:\Users\acecreamu\Anaconda3\lib\site-packages\networkx\classes\function.py", line 64, in neighbors
    return G.neighbors(n)
  File "C:\Users\acecreamu\Anaconda3\lib\site-packages\networkx\classes\graph.py", line 1266, in neighbors
    return iter(self._adj[n])
TypeError: unhashable type: 'dict'

So the problem is in line original_neighbors = set(nx.neighbors(graph, node)) , but I have no clue how to solve it.

ValueError: probabilities contain NaN

image
This problem occurred when I used my own data set? Why did he happen, how can I solve it, I have turned my data into the same json format as the input folder.

HIV detaset

Where can I download the HIV dataset from you?

Run the code error:The number of graph classes is: 0.

Can you help me solve the error "
Collecting unique node labels.
0it [00:00, ?it/s]
The number of graph classes is: 0.
Training started.
0it [00:00, ?it/s]
ZeroDivisionError: division by zero
Epoch: 0%|
"when i run the code?
Thank U very much.

How to use GAM for edge prediction?

Hello,

I am going though your paper implementation and it's really exciting.
I am getting good result on the datasets which are already in repository.

However I was thinking to extend this network and use it for link prediction/ edge classification/ relation prediction task.

So suppose if my dataset looks like this:

bond_one           bond_two              relations

a_b                 b_c                 a_d_r , a_b , a_r .... etc ( relations can be many )
c_v                 r_a                 c_r_a , c_b_a , r_r_r..etc

Now if bond_one and bond_two are nodes in a graph and raltions are edges can we use GAM model for solving this kind of problem?

Or do you have any idea how we can use GAM model for this kind of task.

looking forward to hear from you.

Thank you !
Keep wiring keep sharing :)

ImportError: cannot import name 'parameter_parser'

I had this issue with import:

File "src/main.py", line 1, in <module>
    from parser import parameter_parser
ImportError: cannot import name 'parameter_parser'

I solved it by renaming parser.py (e.g. my_parser.py) and calling from my_parser import parameter_parser
No problems anymore, just that it may be helpful for others.

[IndexError] Mismatched node label indexing?

Hi, thanks for sharing the codes.

I want to test GAM on my own dataset and encountered the IndexError. This is my simplied dataset: https://drive.google.com/file/d/1P2Z0i86ffF0dMq4OXcRPR2Icj4pvZ1WP/view?usp=sharing

Is there any problem of the generated dataset? The node labels are actually the node degree and the sizes of graphs are always 50.

I have tried to debug and found the most relevant codes: line 45-75 in src/gam.py . I am suspending that the indexing of labels in self.identifiers, labels, and inverse_labels are mismatched. In detail, the return label of function sample_node_label is not in the same domain of labels.keys(). They are referring to different mappings of the labels.

Actually, I have changed the labels[str(label)] in line 73 and 74 to label . There is no bug afterwards. But I am not sure if the change is correct.

Could you help me with this debug? Thank you!

Create own dataset

Hello,

I would like to test you code with my own dataset, however, I did not undestand the format of it, specially the label key . In your README yo say that

labels key has a dictonary value for each node, these labels are stored as key-value pairs (e.g. node - atom pair)

Can the labels be strings? If the label must be numbers, why is the labels needed as a dictionary? I mean, could not it be a list of the nodes? It is all confusing for me. Could you explain it please? Pehaps you could create an image of the graph you are representing in your example of the README. I think that a image would clarify how the json can be made.

Graph embeddings

When I execute the script by default, it performs the learning and graph classification task, etc, but how could I get explicitly the graph embedding for my training/test examples?

Thnaks

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.