This repository contains workflows for training knowledge graph embedding models
on knowledge graphs representing interesting geometries (generated
by geometric_graphs
)
using PyKEEN and animate the evolution of
their entity embeddings. Rerun the examples with
$ pip install tox
$ tox
A linear dataset embedded with TransE/SoftPlus Loss by
running python cli.py line
:
![Embedding of a line in 2D](/cthoyt/translational-toys/raw/main/results/line/embedding.gif)
A square grid dataset embedded with TransE/NSSA Loss by
running python cli.py squares
:
![Embedding of a square grid in 2D](/cthoyt/translational-toys/raw/main/results/square_grid/embedding.gif)
Additional idea: try training in much higher dimensions, then use ISOMAP to reduce back down to 2D and see how true it is.
A hexagonal grid dataset embedded with TransE/SoftPlus Loss by
running python cli.py hexagons
:
![Embedding of a square grid in 2D](/cthoyt/translational-toys/raw/main/results/hexagon_grid/embedding.gif)
Note the hexagonal grid shape is not learned if there are no constraints on
the relations because it's easier to learn different sizes, and just create a
square grid. To get this behavior, I ran a modified TransE in which I set the
relation constrainer to normalize
.
TODO