Comments (5)
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.
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.
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.
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.
Thank you so much for this discussion and good tip 😃
from eges.
Related Issues (4)
- 获取 encoded id 逻辑是否有误 HOT 1
- 解码器decoder
- 建图
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eges.