Skip to contents

A(x) = || G_E(x) - E(G(x)) ||_1 (eq. 5), rescaled over the test set as s' = (s - min(S)) / (max(S) - min(S)) (eq. 6).

Usage

Ganomscore(z, zhat, threshold = 0.5)

Arguments

z

Bottleneck codes G_E(x), matrix (m x d) or vector.

zhat

Codes E(G(x)) of the reconstructions, same shape.

threshold

phi applied to the scaled scores.

Value

List with score, scaled, smin, smax, flagged, nflag, m, d.

References

Akcay, Atapour-Abarghouei and Breckon (2018), arXiv:1805.06725, equations (5) and (6), read from the ar5iv rendering of the arXiv source.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Ganomscore(V, V)
#> $score
#> [1] 0 0 0 0 0 0 0 0
#> 
#> $scaled
#> [1] 0 0 0 0 0 0 0 0
#> 
#> $smin
#> [1] 0
#> 
#> $smax
#> [1] 0
#> 
#> $flagged
#> [1] 0 0 0 0 0 0 0 0
#> 
#> $nflag
#> [1] 0
#> 
#> $m
#> [1] 8
#> 
#> $d
#> [1] 1
#> 
#> $method
#> [1] "GANomaly anomaly score (Akcay et al. 2018 eqs. 5-6)"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"