TComplEx ICEWS05-15 (dim 256)
Temporal knowledge-graph embeddings for ICEWS05-15: TComplEx (Lacroix, Obozinski, Usunier, ICLR 2020) trained with the tranz CLI (v0.7.1) on Burn's wgpu/Metal backend, with the paper's weighted nuclear-3 (Ω³) and temporal smoothness (Λ₃) regularizers.
Time-aware filtered link prediction, test split: MRR 0.520, Hits@1 0.418, Hits@3 0.579, Hits@10 0.710.
Data
ICEWS05-15 event quads (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.
Training command
# data fetched by heyting's scripts/fetch_icews0515.sh (mmkb, see above)
tranz train-temporal --data data/icews05-15 \
--dim 256 --epochs 100 --batch-size 2048 --lr 0.01 --init-scale 0.01 \
--label-smoothing 0.1 --n3-reg 0.0025 --time-smooth 1.0 \
--output data/icews0515-tcomplex --eval
Build: cargo 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).
Files and format
entities.tsv— 10,488 entity embeddingsrelations.tsv— 251 relation embeddingstimes.tsv— 4,017 timestamp embeddings, rows in chronological order (row 0 = 2005-01-01)
Each file is word2vec-style text. The first line is <count> <dim>
(space-separated); every following line is a name and dim floats, all
TAB-separated (names contain spaces):
10488 512
Media 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).
Loading
Rust (tranz):
let (names, vecs) = tranz::io::import_embeddings(Path::new("entities.tsv"))?;
// ... same for relations.tsv and times.tsv, then:
let model = tranz::temporal::TComplEx::from_vecs(ent, rel, time, 256);
Python:
import numpy as np
def load_w2v_tsv(path):
names, rows = [], []
with open(path) as f:
n, d = map(int, f.readline().split())
for line in f:
parts = line.rstrip("\n").split("\t")
names.append(parts[0])
rows.append(np.array(parts[1:], dtype=np.float32))
return names, np.stack(rows) # (n, d); re = [:, :d//2], im = [:, d//2:]
Temporal complex-query answering over this checkpoint: the
heyting crate's
icews14_temporal_clqa example with
ICEWS_DATA=data/icews05-15 ICEWS_EMB=data/icews0515-tcomplex.