Skip to contents

Feature map: activation(conv(x, K) + b), convolution delegated to hmfmap's core (hmfmap)

Usage

morie_geron_feature_map(
  x,
  K,
  b = 0,
  activation = "relu",
  stride = 1,
  padding = 0
)

Arguments

x

(H,W) or (C,H,W).

K

One filter or a stack (F,...).

b

Bias (scalar or per filter).

activation

"relu"/"identity"/"tanh"/"sigmoid".

stride, padding

Conv controls.

Value

List with feature_map, pre_activation, out_shape, n_filters, sparsity.

Examples

M <- matrix(c(1, 2, 3, 4, 5, 6), nrow = 2)
morie_geron_feature_map(M, M)
#> $feature_map
#>      [,1]
#> [1,]   91
#> 
#> $pre_activation
#>      [,1]
#> [1,]   91
#> 
#> $out_shape
#> [1] 1 1
#> 
#> $n_filters
#> [1] 1
#> 
#> $activation
#> [1] "relu"
#> 
#> $sparsity
#> [1] 0
#> 
#> $max_response
#> [1] 91
#> 
#> $argmax
#>      [,1] [,2] [,3]
#> [1,]    1    1    1
#> 
#> $estimate
#> [1] 91
#> 
#> $n
#> [1] 1
#> 
#> $method
#> [1] "F = phi(conv(x, K) + b); convolution delegated to grcvf"
#>