# HolE¶

class HolE(*, embedding_dim=200, entity_initializer=<function xavier_uniform_>, entity_constrainer=<function clamp_norm>, entity_constrainer_kwargs=None, entity_representation_kwargs=None, relation_initializer=<function xavier_uniform_>, relation_representation_kwargs=None, **kwargs)[source]

Bases: ERModel

An implementation of HolE [nickel2016].

Holographic embeddings (HolE) make use of the circular correlation operator to compute interactions between latent features of entities and relations:

$f(h,r,t) = \sigma(\textbf{r}^{T}(\textbf{h} \star \textbf{t}))$

where the circular correlation $$\star: \mathbb{R}^d \times \mathbb{R}^d \rightarrow \mathbb{R}^d$$ is defined as:

$[\textbf{a} \star \textbf{b}]_i = \sum_{k=0}^{d-1} \textbf{a}_{k} * \textbf{b}_{(i+k)\ mod \ d}$

By using the correlation operator each component $$[\textbf{h} \star \textbf{t}]_i$$ represents a sum over a fixed partition over pairwise interactions. This enables the model to put semantic similar interactions into the same partition and share weights through $$\textbf{r}$$. Similarly irrelevant interactions of features could also be placed into the same partition which could be assigned a small weight in $$\textbf{r}$$.

Initialize the model.

Parameters:

Attributes Summary

 entity_constrainer_default_kwargs The default settings for the entity constrainer hpo_default The default strategy for optimizing the model's hyper-parameters

Attributes Documentation

entity_constrainer_default_kwargs = {'dim': -1, 'maxnorm': 1.0, 'p': 2}

The default settings for the entity constrainer

hpo_default: ClassVar[Mapping[str, Any]] = {'embedding_dim': {'high': 256, 'low': 16, 'q': 16, 'type': <class 'int'>}}

The default strategy for optimizing the model’s hyper-parameters