Giter Club home page Giter Club logo

Comments (2)

williamleif avatar williamleif commented on August 20, 2024 5

Hi, in this case we can use one-hot indicator vectors as the features for each node. I.e., we can assign node $i$ as a vector of size |V| where all values in this vector or zero except for the entry corresponding to node $i$.

However, this leads to very sparse features and so for implementation we have a special flag called "identity_dim" for this case. If you have no node features than you can set "identity_dim" to a positive value. This flag will associate each node with a dense embedding vector, and we backpropagate gradients through these embeddings. (Mathematically, this is equivalent to representing each node by a one-hot indicator vector and then multiplying these vectors by a learned feature matrix of size |V|xidentity_dim).

Hope that makes some sense...

from graphsage.

David-AJ avatar David-AJ commented on August 20, 2024

@williamleif Wow, this comment perfectly solves my question! When I first got this TF code, I wondered why you used trainable variables to initialize the embeddings of nodes that have no features. So you are using this method to model the multiplication of one-hot encoding with a trainable weight matrix?

from graphsage.

Related Issues (20)

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.