You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromdiceeimportKGE# (1) Upload a trained KGE model.pre_trained_kge=KGE(path='..')
# (2) Train a KGE model on numerical literalspre_trained_kge.train_literal(path="")
deftrain_literal(path=""):
# (3) Read a knowledge graph where all tails are numerical literals# (4) For each unique relation (e.g. dataproperty), we introduce a regression problem.# (5) Tackle each regression problem individually.# ....
Lets say we have a knowledge graph containing only data properties
A height 185
A age 35
B height 180
B age 19
A and B embeddings are learned at step (2). Let's assume A = [0.1, -1.5] and B = [0.9, -0.5]
Lets assume that the embeddings of data properties are defined as such height=[0.0, 0.0] and age=[0.0, 0.0]
yhat=sum( [0.1, -1.5] * [0.0, 0.0] )
y=185# compute loss w.r.t.single_loss=pow( yhat-y, 2)
# Compute the gradient of the loss w.r.t. weights.
Interface
Lets say we have a knowledge graph containing only data properties
A
andB
embeddings are learned at step (2). Let's assumeA = [0.1, -1.5]
andB = [0.9, -0.5]
Lets assume that the embeddings of data properties are defined as such
height=[0.0, 0.0]
andage=[0.0, 0.0]
Ideally, we should be able to observe
The text was updated successfully, but these errors were encountered: