Views
No views yet
(head, relation, tail, YYYY-MM-DD), the
Garcia-Duran, Dumancic & Niepert (EMNLP 2018) splits, fetched from the
mmkb release
(TemporalKGs/icews05-15/icews_2005-2015_{train,valid,test}.txt):
368,962 / 46,275 / 46,092 train/valid/test quads over 10,488 entities,
251 relations, and 4,017 daily timestamps (2005 through 2015). Entity
and relation vocabularies are interned in first-appearance order over
the splits; timestamps are interned in sorted (chronological) order.1# data fetched by heyting's scripts/fetch_icews0515.sh (mmkb, see above)
2tranz train-temporal --data data/icews05-15 \
3 --dim 256 --epochs 100 --batch-size 2048 --lr 0.01 --init-scale 0.01 \
4 --label-smoothing 0.1 --n3-reg 0.0025 --time-smooth 1.0 \
5 --output data/icews0515-tcomplex --evalcargo install tranz --features "burn-ndarray,burn-wgpu". About
30 min on an Apple M-series GPU; the --eval flag prints the metrics
above (1-N cross-entropy both directions, AdamW, no reciprocals).
Hyperparameters were carried over from ICEWS14 (selected there on the
validation split). Keep --init-scale 0.01 when the regularizers are
on: at the 1e-3 default the origin is a fixed point of the trilinear
score and the N3 pull wins (loss converges to exactly ln|E|, MRR ~0).entities.tsv — 10,488 entity embeddingsrelations.tsv — 251 relation embeddingstimes.tsv — 4,017 timestamp embeddings, rows in chronological order
(row 0 = 2005-01-01)<count> <dim>
(space-separated); every following line is a name and dim floats, all
TAB-separated (names contain spaces):110488 512
2Media Personnel (Pakistan) -0.70858896 0.43928194 -0.2324272 ...dim is 512 because the complex dimension is 256: columns 0..256 are
the real parts, columns 256..512 the imaginary parts. The score of a
quad is Re(<h, r ∘ w_τ, conj(t)>) (higher = more likely; tranz's
TemporalScorer negates it into a lower-is-better energy).1let (names, vecs) = tranz::io::import_embeddings(Path::new("entities.tsv"))?;
2// ... same for relations.tsv and times.tsv, then:
3let model = tranz::temporal::TComplEx::from_vecs(ent, rel, time, 256);1import numpy as np
2
3def load_w2v_tsv(path):
4 names, rows = [], []
5 with open(path) as f:
6 n, d = map(int, f.readline().split())
7 for line in f:
8 parts = line.rstrip("\n").split("\t")
9 names.append(parts[0])
10 rows.append(np.array(parts[1:], dtype=np.float32))
11 return names, np.stack(rows) # (n, d); re = [:, :d//2], im = [:, d//2:]icews14_temporal_clqa example with
ICEWS_DATA=data/icews05-15 ICEWS_EMB=data/icews0515-tcomplex.