wang-yu-qing / eges Goto Github PK
View Code? Open in Web Editor NEWDGL implementation of EGES
DGL implementation of EGES
skus = set([sku for s in sessions for sku in s])
encoder = {y: x for x, y in enumerate(skus)}
decoder = [y for x, y in enumerate(skus)]
sku 是set, 编码器和解码的 index不是一个啊。。。这个地方有问题吧???
skus = sorted(set([sku for s in sessions for sku in s]))
是不是应该这样??
for i in range(len(session) - 1):
edge = str(session[i]) + "," + str(session[i + 1])
try:
graph[edge] += 1
except KeyError:
graph[edge] = 1
构件图的时候使用的有向图吧?针对sku浏览行为使用无向图是不是更好些??
毕竟看了A洗发水再看B洗发水 和 先看B洗发水再看A洗发水 对用户来说没有任何区别
是不是这样才对????
for i in range(len(session) - 1):
# Ensure the smaller ID comes first for undirected edges
edge = tuple(sorted([session[i], session[i + 1]]))
try:
graph[edge] += 1
except KeyError:
graph[edge] = 1
Lines 107 to 116 in 470876a
Hi, I have a question about newtorkx graph and dgl graph.
The number of items is 33434. (0 ~ 33433) after encoding.
These items are entered into newtorkx's graph with some dropped items due to session length. so # of networkx's item is 14651.
that networkx's graph is transformed to dgl's graph. the items are relabeled from 0 ~ 14650. that dgl graph is 'train_g'.
dataloader get train_g's items like range(14651). so the dataloader's output is 0 ~ 14650.
but, in EGES model, item embedding is set by nn.Embedding(33434, 16) though dataloader's output is 0 ~ 14650.
is that right? but it works well.....
only 0 ~ 14650 index embeddings are used in embedding matrix, right?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.