Learn R Programming

parafac4microbiome (version 1.1.2)

parafac_gradient: Calculate gradient of PARAFAC model.

Description

Calculate gradient of PARAFAC model.

Usage

parafac_gradient(x, Tensor)

Value

Gradient of the PARAFAC model.

Arguments

x

Vector of fitted loadings generated by the PARAFAC algorithm, can also be a Fac object

Tensor

input data

Examples

Run this code
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)
init = initializePARAFAC(X, 2)
g = parafac_gradient(init, X)

Run the code above in your browser using DataLab