timesfm-ts - v1.0.0
    Preparing search index...

    Function decode

    • Run the full decode loop.

      Concurrency safety: This function is pure with respect to the engine — it reads from the engine but never mutates shared state. Multiple decode() calls can run concurrently (e.g., main path + flip path in Promise.all) without races, provided the engine supports concurrent forward() calls. ONNX Runtime sessions are safe for concurrent use.

      Parameters

      • engine: IInferenceEngine

        Inference backend (ONNX Runtime).

      • normedInputs: Float32Array<ArrayBufferLike>[]

        Pre-normalised patched inputs [batch][numPatches * inputPatchLen].

      • patchedMasks: Uint8Array<ArrayBufferLike>[]

        Patch masks [batch][numPatches * inputPatchLen].

      • contextMu: Float32Array<ArrayBufferLike>[]

        Per-patch means [batchSize * numPatches].

      • contextSigma: Float32Array<ArrayBufferLike>[]

        Per-patch stds [batchSize * numPatches].

      • lastStats: RunningStats[]

        Running stats after last context patch (for AR decode start).

      • horizon: number

        Forecast horizon.

      • fc: ForecastConfig

        Forecast config.

      • mc: ModelConfig = TIMESFM_25_CONFIG

        Model config.

      • Optionalsignal: AbortSignal

        Optional AbortSignal for cancellation.

      Returns Promise<DecodeResult>