Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cthoyt/translational-toys

Knowledge graphs representing geometric shapes matched to knowledge graph embedding models to learn them
https://github.com/cthoyt/translational-toys

Last synced: about 1 month ago
JSON representation

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

Awesome Lists containing this project

README

        

# translational-toys

This repository contains workflows for training knowledge graph embedding models
on knowledge graphs representing interesting geometries (generated
by [`geometric_graphs`](https://github.com/cthoyt/geometric-graphs/))
using [PyKEEN](https://github.com/pykeen/pykeen) and animate the evolution of
their entity embeddings. Rerun the examples with

```shell
$ 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