Skip to content

Knowledge graphs representing geometric shapes matched to knowledge graph embedding models to learn them

License

Notifications You must be signed in to change notification settings

cthoyt/translational-toys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

translational-toys

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

Line

A linear dataset embedded with TransE/SoftPlus Loss by running python cli.py line:

Embedding of a line in 2D

Square Grid in 2D

A square grid dataset embedded with TransE/NSSA Loss by running python cli.py squares:

Embedding of a square grid in 2D

Additional idea: try training in much higher dimensions, then use ISOMAP to reduce back down to 2D and see how true it is.

Hexagonal Grid in 2D

A hexagonal grid dataset embedded with TransE/SoftPlus Loss by running python cli.py hexagons:

Embedding of a square grid in 2D

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.

Circle in 2D

TODO

About

Knowledge graphs representing geometric shapes matched to knowledge graph embedding models to learn them

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages