nn_linear: Linear module

Description Usage Arguments Shape Attributes Examples

Description

Applies a linear transformation to the incoming data: y = xA^T + b

Usage

1
nn_linear(in_features, out_features, bias = TRUE)

Arguments

in_features

size of each input sample

out_features

size of each output sample

bias

If set to FALSE, the layer will not learn an additive bias. Default: TRUE

Shape

Attributes

Examples

1
2
3
4
5
6
7
if (torch_is_installed()) {
m <- nn_linear(20, 30)
input <- torch_randn(128, 20)
output <- m(input)
print(output$size())

}

torch documentation built on Oct. 7, 2021, 9:22 a.m.