Description Usage Arguments Value Author(s) References See Also Examples
View source: R/recon_1prd_topn_par.R
Reconstruct predicate top scores on very large graphs from RESCAL Factorization A & R. NB: A and R should be already loaded in the environment calling the function. Calculates top scores of A%*%R[[p]]%*%A^T. Uses chunks for rows and columns and constraints on maximum possible value of scores to avoid calculations of too small values
1 2 | recon_1prd_topn_par(A,R,p, pcnt, rchLen = 1000, cchLen = 200, pve = 1e-10,
mxrIter = 5, mxcIter = 25, grpLen = 40, OS_WIN = FALSE, dsname = "", ncores = 8)
|
A |
Embedding matrix part resulting from RESCAL factorization. |
R |
core tensor resulting from RESCAL factorization (r by r by m ). |
p |
predicate number. |
pcnt |
Number of triples in the predicate (to be reconstructed) |
rchLen |
row chunk length. |
cchLen |
column chunk length |
pve |
positive value: representing the smallest value of allowed score of reconstructed triple. |
mxrIter |
maximum number of iterations (chunks) in rows |
mxcIter |
maximum number of iterations (chunks) in columns |
grpLen |
length of one group of iterations, when running iterations in parallel results are collected for all iterations to be summarized after last iteration. Thus more memory is required. To avoid that iterations are divided to groups with summaries calculated for each group. Default 40. |
ncores |
number of cores used to run in parallel, 0 means no paralellism |
OS_WIN |
True when the operating system is windows, used to allow using Fork when running in parallel |
dsname |
optional:name of dataset |
The result is a LIST of three items:
ikv |
A data frame containing the reconstructed triples (subject, Object, value, rchnk,chnk) using indexes of entities, rchnk and colun chunk are the chunk in which the triple is generated note predicate is an argument |
minThr |
the minimum score in each predicate (minimum score of a triple, threshold) |
Iter |
Number of iterations done |
Abdelmoneim Amer Desouki
-Maximilian Nickel, Volker Tresp, Hans-Peter-Kriegel, "Factorizing YAGO: Scalable Machine Learning for Linked Data" WWW 2012, Lyon, France
-SynthG: mimicking RDF Graphs Using Tensor Factorization, Desouki et al. IEEE ICSC 2021
rescal
scRescal
RescalReconstructBack
inv_rescal_sf_prd_chnkgrp
1 2 3 4 5 6 7 8 9 | ## Not run:
#Reconstructing one predicate from DBpedia factorization
#print(load('dbpi42_r100.RData'))
lst=recon_1prd_topn_par(A=A,R=R,p,pcnt=prd_cnt1[p],rchLen=250000,cchLen=750,
mxrIter=30,mxcIter=70,ncores=12,grpLen=40,pve=pve,dsname=name)
Res=cbind(S=lst$ikv[,1],P=p,lst$ikv[,2:5])#triples , value
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.