Skip to Content
DEEPCRAFT™ Studio 5.10 has arrived. Read more →

Streaming RNN model validation

When the model input shape is [batch, 1, features], the toolchain treats the model as a streaming RNN:

  • The toolchain invokes the model once per time step, carrying the recurrent state forward between calls.
  • For validation, the toolchain uses only the output from the final time step, then resets the model state.

Data Format

NPZ: Provide streaming input arrays with shape [samples, time_steps, features] (or [samples, time_steps, features_0, features_1]). No additional configuration is required.

Example:

A single-input non-streaming LSTM model trained on 20-step windows with 8 sensor features:

Model input shape: [1, 20, 8] (batch=1, time_steps=20, features=8) Model output shape: [1, 4] (batch=1, classes=4) NPZ array shape: [500, 20, 8] (500 samples)

For a non-streaming model the toolchain does a single inference with input [1, 20, 8] for every sample.

For the equivalent streaming version of the same model (one call per time step):

Model input shape: [1, 1, 8] (processes one step at a time) NPZ array shape: [500, 20, 8] (same dataset - toolchain slices it)

The toolchain slices each sample into 20 time steps, invokes the model 20 times with input shape [1, 1, 8], and preserves the model state across the time steps, resetting the internal state of the model after 20 timesteps (or the provided timesteps) before moving to the next sample. The NPZ data shape remains unchanged.

Streaming multi-input multi-output RNNs

A streaming multi-input RNN can combine different input types:

  • Sequence inputs: shape [samples, time_steps, features], sliced one time step at a time.
  • State inputs: shape [samples, features], passed unchanged at every time step.

The toolchain identifies input types automatically based on shape (rank 3 = sequence, rank 2 = state). No additional configuration is required, provided the NPZ file contains correctly shaped arrays.

Model inputs: "sequence" → shape [1, 1, 16] (streaming sequence input) "state_in" → shape [1, 32] (external state input) NPZ arrays: "sequence" → shape [200, 60, 16] (200 samples, 60 time steps, 16 features) "state_in" → shape [200, 32] (one state vector per sample)
Last updated on