Giter VIP home page Giter VIP logo

learning-stance-embeddings-from-signed-social-graphs's People

Contributors

lejohnyjohn avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

learning-stance-embeddings-from-signed-social-graphs's Issues

Inhomogeneous walks length gives error

Hi, thanks for sharing the code of your work. I'd love to run this project and see it in action.

I have loaded the BirdwatchSG dataset from HuggingFace:

from datasets import load_dataset
edge_data = load_dataset("Twitter/SignedGraphs")
edge_data = pd.DataFrame(edge_data['train'])

However, I am facing the following error in the last training cell : ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (55,) + inhomogeneous part.
in this part of the code:

Cell In[26], line 124, in TrainingSamples.convert(self, walks, topic_idx, workers)
    122 print("check [len(w) for w in walks]")
    123 print([len(w) for w in walks])
--> 124 walks_lists = np.array_split(walks, workers)

which indicates that the elements in the walks array don't have the same shape.
I have printed the walks array and indeed this is the case:
[2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 3, 2, 2, 2, 3, 3, 2, 3, 2, 2, 3, 3, 2, 2, 3, 2, 2, 2, 2, 4, 3, 2, 2, 2, 3, 2, 4, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 2, 2, 3, 3, 2, 2, 3, 2]

This is happening because for some of the walks, there are more neighbors present, so there are longer walk_options :

walk_options = d_graph[walk[-1]].get(neighbors_key, None)

For example for source node: 2665, the walk options are: [482, 2804], and for 482 the walk options are [1595]. So the walk length becomes [2665, 482, 1595], (whereas the walk length is normally 2 for other nodes). But for some source nodes, the walk length is only [2345, 593].

I'd like to know if we need to limit the walk length to be homogenous (i.e., either through padding the length)? or allow for inhomogenous walks?

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.