Skip to contents

Cross-correlation, not flipped convolution – as in every DL library. Multi-channel input is a list of matrices or a 3-D array (C, H, W).

Usage

morie_geron_conv2d_forward(X, W, b = 0, stride = 1, padding = 0)

Arguments

X

Matrix (H, W) or 3-D array (C, H, W).

W

Matrix (kh, kw) or 3-D array (C, kh, kw).

b

Bias.

stride

Scalar or (sh, sw).

padding

Scalar or (ph, pw).

Value

List with Y, out_shape, padded_shape, n_multiply_adds.

Examples

M <- matrix(c(1, 2, 3, 4, 5, 6), nrow = 2)
morie_geron_conv2d_forward(M, M)
#> $Y
#>      [,1]
#> [1,]   91
#> 
#> $out_shape
#> [1] 1 1
#> 
#> $padded_shape
#> [1] 2 3
#> 
#> $n_multiply_adds
#> [1] 6
#> 
#> $stride
#> [1] 1 1
#> 
#> $padding
#> [1] 0 0
#> 
#> $estimate
#> [1] 91
#> 
#> $n
#> [1] 1
#> 
#> $method
#> [1] "2-D convolution forward pass"
#>