dmlc / dgl

Python package built to ease deep learning on graph, on top of existing DL frameworks.
http://dgl.ai
Apache License 2.0
13.55k stars 3.01k forks source link

Question about building graph using my own dataset in Transformer #2229

Closed yl3639 closed 4 years ago

yl3639 commented 4 years ago

❓ Questions and Help

Hi dgl team, I have a question about implementing the transformer on my own dataset. According to https://docs.dgl.ai/en/latest/tutorials/models/4_old_wines/7_transformer.html#graph-structure the tutorial of transformer, it seems we need to build the graph with nids['enc'], nids['dec'], eids['ee'], eids['ed'], eids['dd'] so that the transformer can run successfully.

But since I am implementing transformer on my own dataset, I build the graph by myself, but there is error with

image

and my code is like this:

image

May I ask what is the correct way to build my own dataset graph? Thanks a lot!

Before proceeding, please note that we recommend using our discussion forum (https://discuss.dgl.ai) for general questions. As a result, this issue will likely be CLOSED shortly.

yl3639 commented 4 years ago
image
yzh119 commented 4 years ago

Sorry for the very late reply, would you mind taking a look at the graph construction part of BPT which follows the spirit of the transformer tutorial (it is out-dated and no longer maintained)?