Implementation) TGAT : Inductive Representation Learning on Temporal Graphs

김진현·2021년 9월 1일
0

Implementation

목록 보기
2/2

Previous Review

Paper Review)

https://velog.io/@rlawlsgus117/Paper-Review-Inductive-Representation-Learning-on-Temporal-Graphs

Code Review)

Original Source Code

https://github.com/StatsDLMathsRecomSys/Inductive-representation-learning-on-temporal-graphs

Dataset

reddit의 posts와 comments 데이터를 가지고 TGAT와 LSTM을 통해 test post에서 comment 생성 유무 prediction을 진행한다.

Issue


Issue #001 : [Fixed] Integrated test-train Dataframe

Problem

source code에서 test-train data를 전부 df를 통해 접근하는 방식이여서
subreddit별로 test와 train을 미리 쪼개지 말고 MySQL에서 하나의 파일로 추출 후, 코드로 분할한다.

Solved

  1. MySQL

    WHERE from_unixtime(unix_timestamp(created_utc)-32400) < '2018-02-15 00:00:00' AND is_valid = 1
    ->
    WHERE is_valid = 1 and UNIX_TIMESTAMP('2018-03-01 00:00:00') - UNIX_TIMESTAMP(created_utc) > 0

Issue #002 : [Fixed] Adjusted val_time / test_time

Problem

기존 코드는 np.quantile을 사용해, val_time, test_time = 0.7, 0.85로 설정했다.

사용할 데이터셋에서는 train data의 날짜가 fix되어 있어 수정이 필요했다.

Solved

  1. valid_time - mysql에서 추출
    +-----------------------------------------------------------------------------+
    | UNIX_TIMESTAMP('2018-02-15 00:00:00')-UNIX_TIMESTAMP('2018-01-01 00:00:00') |
    +-----------------------------------------------------------------------------+
    | 3888000 |
    +-----------------------------------------------------------------------------+

  2. test_time - np.quantile 이용

    test_time = np.quantile(g_df[g_df['ts'] > val_time].ts, 0.5)

Code

val_time = 3888000
test_time = np.quantile(g_df[g_df['ts'] > val_time].ts, 0.5)

Issue #003 : [Fixed] Adjusted raw_data range when extracting from MySQL

Problem

현재 데이터 - 2018년 1월 1일 ~ 3월4일의 posts/comments.
aim to - 2018년 1월 1일 ~ 2월28일의 posts/comments.

Solved


Issue #004 : [Added] Virtual Node

Problem

Solved

0개의 댓글