Giter Site home page Giter Site logo

Some API corner cases about dgl HOT 5 CLOSED

dmlc avatar dmlc commented on September 18, 2024
Some API corner cases

from dgl.

Comments (5)

GaiYu0 avatar GaiYu0 commented on September 18, 2024

(1) I agree that updating without message can be completed outside DGLGraph. Thus DGLGraph can refuse to update node without message.
(2) Maybe we can let user decide? Basically there is a tradeoff between storage and re-computation.
(3) I think we need a special object for this, e.g. None. The tricky case is when we tensorize reduce/update function. Currently I use a Python loop to filter out nodes without neighbor, which is very inefficient.

from dgl.

zzhang-cn avatar zzhang-cn commented on September 18, 2024

from dgl.

BarclayII avatar BarclayII commented on September 18, 2024

Requested by @zzhang-cn:
In the current implementation my UpdateModule treats the "no message" case as receiving a zero vector. This only happens on the root node of a tree since it is the starting point of the whole message passing process. The restriction that message phase is required for an update should have minimal impact on our model since I can move the root node computation out from the send/recv framework and initialize the states by set_repr().

For the three questions:
(1) What are the downsides (either from our perspective or the user's experience) if we do allow updates with no messages? I think allowing no-message-updates can let the users write more compact code if the nodes do update itself without any incoming messages.
(2) In socket programming, calling sendto would put the message into a buffer while recvfrom clears it. I suggest we stick to this convention as well (i.e. calling a recvfrom will clear the message from the edges). The users can stash the message by themselves if they hope to reuse it. The storage is not an issue here since the underlying tensor libraries already take care of keeping or freeing the message tensors.
(3) If we allow no-message-updates then I feel that this is not a problem.

from dgl.

jermainewang avatar jermainewang commented on September 18, 2024

Another corner case:
(4) If there is only one predecessor, do we allow optional reduce phase?

from dgl.

jermainewang avatar jermainewang commented on September 18, 2024

Done by PR #25

from dgl.

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.