DriftTexture · function

evalNetwork

Evaluate the network, writing shape.outputs values into out.

Explained in DriftTexture.

function evalNetwork(shape: NetworkShape, weights: Float32Array, input: Float32Array, out: Float32Array, scratch: Float32Array): void
import { evalNetwork } from '@driftengine/texture';

Parameters

ParameterTypeDescription
shapeNetworkShape
weightsFloat32Array
inputFloat32Array
outFloat32Array
scratchFloat32Array

In depth

Weights are read in layer order: for each layer, the weight matrix row-major by output, then the biases. scratch must hold at least twice the widest layer and is reused across calls so this allocates nothing.