Expand description
Applies a linear transformation to the input data y = a * x + b
The variables are:
y
: output valuea
: weight (a trainable weight in a neural network)x
: input valueb
: bias (only for Backends with thecoblas::plugin::Copy trait
)
§Input Data
The input can either have one or two dimensions:
- If the input has one dimension the transformation will just be applied to the input data.
- If the input has two dimensions the first dimension is treated as batch size (
N
) and the transformation will be applied to every vector in the second dimension, using the same weights and biases.
In the context of convolutional neural networks this layer is also called a “fully-connected layer” if it is used at the end of the network.
Structs§
- Linear Layer
- Specifies configuration parameters for a Linear Layer.