Class Linear
java.lang.Object
ai.beestream.jitnn.nn.Module
ai.beestream.jitnn.nn.Linear
- All Implemented Interfaces:
AutoCloseable
y = x W^T + b with W of shape [out, in]. Initialised like PyTorch's
nn.Linear: weight
and bias uniform in [-1/sqrt(in), 1/sqrt(in)).-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class Module
buffer, buffers, child, close, isClosed, isTraining, loadStateDict, parameter, parameterCount, parameters, stateDict, train, zeroGrad
-
Constructor Details
-
Linear
public Linear(int in, int out, long seed) A linear layer fromintooutfeatures with a bias, initialised fromseed. -
Linear
public Linear(int in, int out, boolean bias, long seed) A linear layer fromintooutfeatures, with or without a bias, initialised fromseed.
-
-
Method Details
-
weight
The weight [out, in]. -
bias
The bias [out], or null without one. -
forward
-
forwardRelu
relu(forward(x)) as one fused GEMM;Sequentialuses it for a Linear followed by ReLU.
-