Learn R Programming

SSDL (version 1.1)

ObjFun_COMP_cpp: COMP objective function

Description

Computation of the objective function from the Compressive Orthogonal Matching Pursuit algorithm.

Usage

ObjFun_COMP_cpp(d, W, residue)

Arguments

d

is a dictionary element

W

is a frequency matrix \(m \times s\) with frequency vectors in matrix rows.

residue

is a residue vector.

Value

an objective function value

Details

The objective function of the Compressive Orthogonal Matching Pursuit is defined as: \(-\frac{SK(d)\cdot r}{\|SK(d)\|}\), where \(SK(d)\) denotes a sketch of the dictionary element d and \(r\) is the residue vector, which is defined as the difference between the data sketch \(SK\) and the weighted sum of the dictionary elements' sketches, i.e. \(SK - \sum_{i=1}^K \beta_i \cdot SK(d_i)\). This function is involved in COMP_initialization routine.

See Also

COMP_initialization, Gradient_COMP_cpp

Examples

Run this code
# NOT RUN {
X = matrix(abs(rnorm(n = 1000)), ncol = 100, nrow = 10)
X_fbm = bigstatsr::as_FBM(X)$save()
W = chickn::GenerateFrequencies(Data = X_fbm, m = 64, N0 = ncol(X_fbm),
                                ncores = 1, niter= 3, nblocks = 2, sigma_start = 0.001)$W
SK= chickn::Sketch(X_fbm, W)
D = X_fbm[, sample(ncol(X_fbm), 10)]
weights = sample(10, 10)/10
SK_D = rbind(cos(W%*%D), sin(W%*%D))
d = D[,1]
r = SK - SK_D%*%weights
OF = ObjFun_COMP_cpp(d, W, r)
# }

Run the code above in your browser using DataLab