Giter VIP home page Giter VIP logo

cnn-graph-classification's People

Contributors

giannisnik avatar robd2 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cnn-graph-classification's Issues

np.vstack

Hi @giannisnik ,

Could you please shed some light on why to append a zero row on top of Q_t?
Q_t = np.vstack([np.zeros(embedding_dim), Q_t]) # Line 154 in utils.py

Thanks.

RecursionError: maximum recursion depth exceeded

Hi giannisnik,

Thanks for your kind sharing code!

As I run "python main.py" without any code change, I get a RecursionError. The whole trace is posted below, could you pls help check?

$ python main.py
Computing graph maps
Number of communities: 2590
Average size: 7.53
Starting cross-validation
Create model
Traceback (most recent call last):
File "main.py", line 280, in
main()
File "main.py", line 101, in main
model = CNN(input_size=args.n_filters, hidden_size=args.hidden_size, n_classes=np.unique(y).size, d=args.d, n_kernels=n_kernels, max_n_communities=max_n_communities)
File "/Users/polarbear/Personal/NU/MSiA/Courses/Summer_Quarter_2018/OnPoint_Internship/cnn-graph-classification-master/kcnn/model.py", line 13, in init
self.init_weights()
File "/Users/polarbear/Personal/NU/MSiA/Courses/Summer_Quarter_2018/OnPoint_Internship/cnn-graph-classification-master/kcnn/model.py", line 16, in init_weights
xavier_uniform(self.conv.weight.data)
File "/Users/polarbear/Personal/NU/MSiA/Courses/Summer_Quarter_2018/OnPoint_Internship/cnn-graph-classification-master/kcnn/init.py", line 43, in xavier_uniform
xavier_uniform(tensor.data, gain=gain)
File "/Users/polarbear/Personal/NU/MSiA/Courses/Summer_Quarter_2018/OnPoint_Internship/cnn-graph-classification-master/kcnn/init.py", line 43, in xavier_uniform
xavier_uniform(tensor.data, gain=gain)
File "/Users/polarbear/Personal/NU/MSiA/Courses/Summer_Quarter_2018/OnPoint_Internship/cnn-graph-classification-master/kcnn/init.py", line 43, in xavier_uniform
xavier_uniform(tensor.data, gain=gain)
[Previous line repeated 985 more times]
File "/Users/polarbear/Personal/NU/MSiA/Courses/Summer_Quarter_2018/OnPoint_Internship/cnn-graph-classification-master/kcnn/init.py", line 42, in xavier_uniform
if isinstance(tensor, Variable):
RecursionError: maximum recursion depth exceeded

Thanks!

orthogonal

Hi @giannisnik,

Seems the function orthogonal is not used in your code.
What is it for? Is it to accelerate the model training?

Br,

Specify the dataset and the hyperparameters in the main.py file

Hi there. Thank you for the code. In which line in the main.py file can I specify the dataset and the hyperparameters? When I run python main.py it gives me the error below:

Computing graph maps
Number of communities: 2594
Average size: 7.52
Traceback (most recent call last):
File "main.py", line 280, in
main()
File "main.py", line 62, in main
Q, subgraphs, labels, shapes = compute_nystrom(args.dataset, use_node_labels, args.d, args.community_detection, kernels)
File "/home/n/Documents/GDL/cnn-graph-classification/kcnn/utils.py", line 152, in compute_nystrom
model.fit(communities)
File "/home/n/Documents/GDL/cnn-graph-classification/kcnn/nystrom.py", line 30, in fit
basis_kernel = self.kernel(basis, basis, **self._get_kernel_params())
File "/home/n/Documents/GDL/cnn-graph-classification/kcnn/graph_kernels.py", line 111, in wl_kernel
if len(neighbors) > 0:
TypeError: object of type 'generator' has no len()

Accuracy = 0

Thank you so much @giannisnik for publishing this code. Is a very interesting use of a CNN. I'm trying to reproduce some of your results but keep getting Accuracy = 0 measurements. Any thoughts on where to focus my debugging? Maybe related to the missing "best model"?

image

Code Detailed Comments

Hi giannisnik,
Thanks for your kind sharing code!
Can you give detailed code comments to help me learn?

And could you pls help explain what is the meaning below?
Epoch: [99] Avg accuracy 0.762; Average Loss 0.451; Avg Time x Batch 0.007

  • Average accuracy 0.700; Average Loss 0.727
    => loading best model './checkpoint/kcnn/model_best.pth'
    => loaded best model './checkpoint/kcnn/model_best.pth' (epoch 4)
  • Average accuracy 0.660; Average Loss 0.593
    Accuracy at iteration 10: 0.66
    Average accuracy: 0.6759999999999999
    std: 0.041279534881100574

categorical edges in graphs

@giannisnik ,

Thanks for sharing the code with us!
I am wondering how to handle categorical edges. For example, there are two types of edges in graphs among nodes, how coud I represent/identify type of a edge in graphs to feed graph kernel? 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.