Code Monkey home page Code Monkey logo

Comments (5)

Wang-Yu-Qing avatar Wang-Yu-Qing commented on June 12, 2024 1

Oh I see. This encoding process is indeed wrong. I fixed this part in this commit. You can pull the latest code from master.

from eges.

Wang-Yu-Qing avatar Wang-Yu-Qing commented on June 12, 2024 1

And if you want to compute new node (node id that didn't shown in the whole graph), new node's base embedding will not be found. Thus you can only get new node's embedding via its side-information.

from eges.

Wang-Yu-Qing avatar Wang-Yu-Qing commented on June 12, 2024

If you run with the default arguments, the num_skus = len(sku_encoder) after graph construction using session will be 1006, which means there are total 1006 nodes (already encoded as [0, 1005] by sku_encoder) in the graph. And the model will use this num_skus to init nodes' base embeedings: base_embeds = th.nn.Embedding(num_nodes, dim). So the embedding number should be equal to the len(sku_encoder).

from eges.

kyeongchan92 avatar kyeongchan92 commented on June 12, 2024

Oh, I confused with https://github.com/dmlc/dgl/tree/master/examples/pytorch/eges.

The sku_encoder has 1006 nodes(items) encoded, and when making g through add_sessions, the items 73, 1000, 1001 are dropped. so in g has nodes that are relabeled from 1006 nodes to 1003 nodes. by being shifted and densified.

model's base_embeds is th.nn.Embedding(1006, dim=8).

so, encoded items : 0~1005(1006), g's items : 0 ~ 1002(1003).

Q1. because dataloader is set by range(1003)(which is range of g's nodes when dataloader declaration), model uses only 1003 embeddings in base_embeds. right?
Q2. if I want to use encoded items(0 ~ 1005)' embeddings in other task, do I have to convert g's item index back to encoded item index (g item index -> newtorkx graph's item index)?

from eges.

kyeongchan92 avatar kyeongchan92 commented on June 12, 2024

Thank you so much for this discussion and good tip 😃

from eges.

Related Issues (4)

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.