Contents

applied(to:eventHandler:)

Performs a prediction on a shaped array of features.

Declaration

func applied(to input: MLShapedArray<Scalar>, eventHandler: EventHandler? = nil) async throws -> MLShapedArray<Scalar>

Parameters

  • input:

    An shaped array of features. The shape must be [N, featureSize] where N is the length of the sequence, which must be at least inputWindowSize.

  • eventHandler:

    An event handler.

Return Value

A shaped array of predictions with shape [M, forecastWindowSize, annotationSize] where M is the number of predictions based on the input sequence length and the stride property.

Discussion

This method uses a sliding window to chunk the input features into inputWindowSize elements every stride elements. If you want to use a different windowing strategy, use applied(toWindow:eventHandler:).

See Also

Applying the model