One Logo Pool Ball
Accelerate · IOS API REFERENCE

BNNS.BroadcastMatrixMultiplyLayer

class · iOS 14.0+ · SDK 27.1

class BroadcastMatrixMultiplyLayer

A broadcast matrix multiply layer.

Members (3)

method · iOS 14.0+

applyBackward

TypeScript
applyBackward(batchSize: number, inputA: BNNSNDArrayDescriptor, inputB: BNNSNDArrayDescriptor, output: BNNSNDArrayDescriptor, outputGradient: BNNSNDArrayDescriptor, inputAGradient: BNNSNDArrayDescriptor, inputBGradient: BNNSNDArrayDescriptor): void
Swift declaration
func applyBackward(batchSize: Int, inputA: BNNSNDArrayDescriptor, inputB: BNNSNDArrayDescriptor, output: BNNSNDArrayDescriptor, outputGradient: BNNSNDArrayDescriptor, generatingInputAGradient inputAGradient: BNNSNDArrayDescriptor, generatingInputBGradient inputBGradient: BNNSNDArrayDescriptor) throws

Applies the layer backward to generate input, output, weights, and bias gradients. - Parameter batchSize: The number of input-output pairs to process. - Parameter inputA: The first input descriptor. - Parameter inputB: The second input descriptor. - Parameter output: The output descriptor. - Parameter outputGradient: The output gradient descriptor. - Parameter inputAGradient: The first input gradient descriptor. - Parameter inputBGradient: The second input gradient descriptor. - Parameter weightsGradient: The weights gradient descriptor. - Parameter biasGradient: The bias gradient descriptor.

method · iOS 15.0+

apply

TypeScript
apply(batchSize: number, inputA: BNNSNDArrayDescriptor, inputB: BNNSNDArrayDescriptor, output: BNNSNDArrayDescriptor): void
Swift declaration
func apply(batchSize: Int, inputA: BNNSNDArrayDescriptor, inputB: BNNSNDArrayDescriptor, output: BNNSNDArrayDescriptor) throws

Applies the layer to several pairs of (input, output) data. - Parameter batchSize: The number of input-output pairs to process. - Parameter inputA: The first input descriptor. - Parameter inputB: The second input descriptor. - Parameter output: The output descriptor.

init · iOS 14.0+

init

TypeScript
static init(inputA: BNNSNDArrayDescriptor, transposeA: boolean, aIsWeights: boolean, inputB: BNNSNDArrayDescriptor, transposeB: boolean, bIsWeights: boolean, output: BNNSNDArrayDescriptor, alpha: number, accumulatesToOutput: boolean, isQuadratic: boolean, filterParameters?: (BNNSFilterParameters) | null): (BNNS_BroadcastMatrixMultiplyLayer) | null
Swift declaration
convenience init?(inputA: BNNSNDArrayDescriptor, transposed transposeA: Bool, isWeights aIsWeights: Bool, inputB: BNNSNDArrayDescriptor, transposed transposeB: Bool, isWeights bIsWeights: Bool, output: BNNSNDArrayDescriptor, alpha: Float, accumulatesToOutput: Bool, isQuadratic: Bool, filterParameters: BNNSFilterParameters? = nil)

Creates a new broadcast matrix multiply layer. - Parameter inputA: The descriptor of matrix _A_. - Parameter transposeA: A Boolean value indicating whether to transpose the last two dimensions of _A_. - Parameter aIsWeights: A Boolean value specifying whether to treat _A_ as weights. Note that both _A_ and _B_ can't be weights. - Parameter inputB: The descriptor of matrix _B_. - Parameter transposeB: A Boolean value indicating whether to transpose the last two dimensions of _B_. - Parameter bIsWeights: A Boolean value specifying whether to treat _B_ as weights. Note that both _A_ and _B_ can't be weights. - Parameter output: The output descriptor. - Parameter alpha: A scalar value that scales the result. - Parameter accumulatesToOutput: A Boolean value that speciies whether the result is added to the existing output. - Parameter isQuadratic: If true, the operation multiplies matrix _A_ with itself and matrix _B_ is ignored. This will make no difference on inference (except that higher performance may be achieved if `isQuadratic=true`), however the backward gradient calculation will be incorrect (or rather the desired gradient will otherwise be the sum of matrix _A_ gradient and matrix _B_ gradient if `isQuadratic=false`). - Parameter filterParameters: Runtime filter parameters. - Returns: A new broadcast matrix multiply layer.

Skipped declarations

No declarations were skipped in this snapshot.

All Accelerate types →