Linear class

Fully connected (linear) layer: y = x @ W^T + b

Transforms input of shape (..., inFeatures) to (..., outFeatures).

Constructors

Linear(int inFeatures, int outFeatures, {bool useBias = true})

Properties

bias Tensor?
Optional bias vector of shape (outFeatures,).
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
inFeatures int
final
outFeatures int
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
weight Tensor
Weight matrix of shape (outFeatures, inFeatures).
getter/setter pair

Methods

forward(Tensor input) Tensor
Forward pass: x @ weight^T + bias
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited