admm_nmr_clf: Classification using nuclear norm regression

Description Usage Arguments Value Author(s) References Examples

View source: R/admm_nmr.R

Description

Entering the training data set and the test data returns the optimal label.

Usage

1
  admm_nmr_clf(A, B, label)

Arguments

A

"A" is a train data set in the form of a three-dimensional array. This data set contains several face images used for algorithm learning.

B

"B" is an image of a face with occlusion.

label

"label" is a vector representing a label for train dataset A.

Value

val

The result of classification. It represents the optimal label.

Author(s)

Jisun Kang

References

https://ieeexplore.ieee.org/document/7420697

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
function (A, B, label)
{
    x <- ADMM_NMR_fit(A, B)
    A_x <- coef_img(A, x)
    label_unique <- unique(label)
    error_lst <- c()
    for (i in target_unique) {
        label_tf <- (label == label_unique)
        x_i <- x[label_tf]
        A_i <- A[, , label_tf]
        A_x_i <- coef_img(A_i, x_i)
        diff <- A_x - A_x_i
        error <- nuclear(diff)
        error_lst <- append(error_lst, error)
    }
    error_tf <- error == min(error)
    val <- label_unique[error_tf]
    return(val)
  }

riverKangg/NuclearNormClassifier documentation built on Jan. 1, 2020, 10:08 p.m.