Wentao-Xu / HIST

The source code and data of the paper "HIST: A Graph-based Framework for Stock Trend Forecasting via Mining Concept-Oriented Shared Information".
241 stars 68 forks source link

About calculate the cos similarity #3

Closed Axl-zhang closed 2 years ago

Axl-zhang commented 2 years ago

i_shared_info, hidden in model.py line 116, are you calculate the same tensor? it seems hidden is equal to i_shared_info, even if i debug and step in cal_cos_similarity, the two paramters of cal_cos_similarity function is the same

Hidden Concept Module

    i_shared_info = x_hidden - e_shared_back
    hidden = i_shared_info
    i_stock_to_concept = cal_cos_similarity(i_shared_info, hidden)
Wentao-Xu commented 2 years ago

Yes, as you can see in Section 4.3 of our paper, we use stock embedding to initialize the hidden concept embedding. To better understand the code, I suggest you read our paper first.