question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Order of edge features in "sparse" mode

See original GitHub issue

The documentation suggests that edge features (used by ECCConv, for instance) can be in sparse format to avoid padding large arrays with zeros. However, attempting to construct a Graph with e set to a scipy coo_matrix results in an error being raised by the following line:

https://github.com/danielegrattarola/spektral/blob/b6c3795cd12879c44e9591bd04b5d27acb511aab/spektral/data/graph.py#L81

It seems like only dense arrays are permitted for the edge features, unlike for the adjacency matrix (which also allows the type check to pass if sp.isspmatrix(a) is True). Is this intended, is there a workaround, or am I missing something?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
danielegrattarolacommented, Jul 28, 2021

You are correct, the documentation is imprecise in this regard and this is likely to cause issues to end-users. I will take some time today to:

  1. Improve the data loaders so that the specific ordering of the adjacency matrix/edge feature is not something that the users need to worry about
  2. Improve the documentation to clarify the meaning of “sparse format”.

Thanks for bringing this to my attention.

0reactions
danielegrattarolacommented, Jul 28, 2021

Ok so point 1 could be a little trickier than expected, but I’ve gone and added a significant section to the Getting Started tutorial that explains in detail how edge attributes should be represented in a Graph object. I’ve also fixed the wording of the Data Modes tutorial. I’ll update the online version of the docs soon.

I also made sure that, if edge attributes are sorted correctly, then all data loaders and layers will know how to deal with them. This still requires the users to correctly reorder the edge attributes, but I don’t see an easy way out for now.

I’ll change this issue into a discussion so that it remains part of the knowledge base of the library.

Thanks again

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multicast PIM Sparse-Dense Mode - NetworkLessons.com
Multicast PIM sparse-dense mode forwards multicast traffic with sparse mode when there is an RP and dense mode when there is no RP....
Read more >
Optimizing PIM Sparse Mode in a Large IP Multicast Deployment
Feature History and Information for Optimizing PIM Sparse Mode in a Large IP Multicast ... change only on redundant devices on the edge...
Read more >
Getting started - Spektral
You can use spektral.utils.sparse.reorder to sort a matrix of edge features in the correct row-major order given by an edge index (i.e., the...
Read more >
Deep Feature Learning for Graphs - arXiv
neighbors of a graph element (node, edge; see Table 1) to derive higher-order features from lower-order ones forming a hierarchical graph representation ...
Read more >
Machine Learning Glossary - Google Developers
The sequence of examples. Yes, the preceding model has an AUC of 0.5, not 0.0. Most models are somewhere between the two extremes....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found