powered by
PARAFAC loss function calculation
parafac_fun(x, Tensor, lambdas = NULL)
Scalar value of the loss function
Vector of fitted loadings generated by the PARAFAC algorithm, can also be a Fac object
input data
If lambdas (from the kruskal tensor case) are generated to make the Fac norm 1, they can be supplied.
A = array(rnorm(108*2), c(108,2)) B = array(rnorm(100*2), c(100,2)) C = array(rnorm(10*2), c(10,2)) X = reinflateTensor(A, B, C) model = parafac(X, 2) f = parafac_fun(model$Fac, X)
Run the code above in your browser using DataLab