Skip to contents

Y = X W^T + b with W stored (out, in) as in nn.Linear.

Usage

morie_geron_linear_layer_forward(X, W, b)

Arguments

X

Instance vector or (batch, in) matrix.

W

(out, in) weight matrix.

b

Scalar or length-out bias.

Value

List with output, preactivation_norm, in_features, out_features, n_parameters, batch.

Examples

morie_geron_linear_layer_forward(X = c(1, 2, 3, 4, 5, 6, 7, 8), W = c(1, 2, 3, 4, 5, 6, 7, 8),
  b = 5L)
#> $output
#> [1] 209
#> 
#> $preactivation_norm
#> [1] 209
#> 
#> $in_features
#> [1] 8
#> 
#> $out_features
#> [1] 1
#> 
#> $n_parameters
#> [1] 9
#> 
#> $batch
#> [1] FALSE
#> 
#> $estimate
#> [1] 209
#> 
#> $n
#> [1] 1
#>