Talario\Linear
Requires a Talario build. Licensed builds are available through sales. There is no public download. Availability
__construct
new Linear(Device $dev, int $in, int $out, bool $bias = true, ?int $seed = null)
Create a dense layer; allocates weight (and optional bias) Parameters on the device.
__invoke
__invoke(Tape $t, int $x): int
Forward: matmul then optional addBias.
invokeReLU
invokeReLU(Tape $t, int $x): int
Forward relu(x@W + b).
params
params(): array
The layer's trainable Parameters.
state
state(): array
Weights (and bias) as plain arrays for saving.
loadState
loadState(array $s): void
Restore weights from a state array.
Using a coding agent?
Copy a prompt for Talario\Linear, with 4 exact API signatures.