class

ML::NN::Linear

Inherits Reference / Object

Linear layer: out_features = in_features @ weight^T + bias

Constructors

new(in_features : Int32, out_features : Int32, bias : Bool = true, device : Tensor::Device = Tensor.default_device)
Source

Instance methods

bias
Source
call(x : Autograd::Variable) : Autograd::Variable
Source
forward(x : Autograd::Variable) : Autograd::Variable

Forward pass: y = x @ W^T + b x: [..., in_features] - arbitrary batch dimensions output: [..., out_features]

Source
in_features
Source
out_features
Source
parameters

Get all trainable parameters

Source
weight
Source