GATNE icon indicating copy to clipboard operation
GATNE copied to clipboard

when i set schema,it goes wrong

Open YEA02 opened this issue 5 years ago • 12 comments

Take only 300 person-item data for experiments, set the meta path to person-item-person, the number of walks and length are the default values, but this will give an error line 56 in main.py iy = vocab [y] .index KeyError: '1006114' I printed "all_walks" , found that it did not walk to this node '1006114' Is there something wrong with me?Looking forward to your reply

YEA02 avatar Jan 07 '20 13:01 YEA02

Because this may be the case: Some nodes in G cannot be reached when walking along the specified meta path, so this method generate_vocab in utils.py, the vocab generated according to the number of node occurrences in all_walks, does not include all the nodes in G

YEA02 avatar Jan 08 '20 04:01 YEA02

I had also met the same problem as you found @yathe

wuqianliang avatar Jan 13 '20 01:01 wuqianliang

    for (x, y) in g:
    ##    if x in vocab and y in vocab:
            ix = vocab[x].index
            iy = vocab[y].index
            # N(i,r)
            neighbors[ix][r].append(iy)
            neighbors[iy][r].append(ix)

add one line leading by ## may solve the error @yathe

wuqianliang avatar Jan 13 '20 01:01 wuqianliang

My modification way is in 'generate_vocab': One more parameter ‘all_nodes’ was passed, and the following code was added.

for i in all_nodes:
        if i not in raw_vocab.keys():
            raw_vocab[i] = 0

When generating vocab, assign a value of 0 to the nodes that did not walk. I don’t know if it is not suitable for this modification, and the effect is not very good. @wuqianliang

YEA02 avatar Jan 13 '20 04:01 YEA02

My modification way is in 'generate_vocab': One more parameter ‘all_nodes’ was passed, and the following code was added.

for i in all_nodes:
        if i not in raw_vocab.keys():
            raw_vocab[i] = 0

When generating vocab, assign a value of 0 to the nodes that did not walk. I don’t know if it is not suitable for this modification, and the effect is not very good. @wuqianliang

this code part used to get neighborhood of node i on edge type r over some walk paths. So vocab generated from walks only were enough.

wuqianliang avatar Jan 13 '20 14:01 wuqianliang

thank you very much! I still have a question, is it impossible to get the embbeding of the nodes that have not been walked? @wuqianliang

YEA02 avatar Jan 14 '20 01:01 YEA02

thank you very much! I still have a question, is it impossible to get the embbeding of the nodes that have not been walked? @wuqianliang

according formula (6), only "bi" base embedding part for nodes that have not been walked

wuqianliang avatar Jan 14 '20 02:01 wuqianliang

Thank you very much for your answer! @wuqianliang

YEA02 avatar Jan 14 '20 03:01 YEA02

thank you very much! I still have a question, is it impossible to get the embbeding of the nodes that have not been walked? @wuqianliang

need to modify code according to formula (13) , if there is unobserved data in test dataset. this pytorch code still transductive.

wuqianliang avatar Jan 14 '20 12:01 wuqianliang

1.I use tensorflow version. I have unobserved data in my test set, but I don't know how to modify it ? 2.The "final_model" only contains all the nodes that have walked. If the node has not walked, how should it output its final embedding?

@wuqianliang

YEA02 avatar Jan 16 '20 03:01 YEA02

maybe i want to ask how to set the number of information aggregation layers ? @wuqianliang

lalw avatar Apr 13 '20 03:04 lalw

set the meta path to person-item-person

I solve this problem by setting the meta path to 'person-item-person, item-person-item'

DrQinZL avatar Jun 30 '22 12:06 DrQinZL