Esc
Ask AIAnswers may be inaccurate; check the linked pages.Esc
Ask anything about these docs, like how to get started or what a function does.

informer_training.py

Window construction and JIT/scan training for Informer.

build_windows

informer_training.build_windows

Rolling windows [n_windows, input_size+h] of y (step 1).

Parameter Type Default Description
y jnp.ndarray - (undocumented)
input_size int - (undocumented)
h int - (undocumented)

Returns: jnp.ndarray Raises: ValueError

build_exog_windows

informer_training.build_exog_windows

Rolling windows of an exog array [T, F].

Parameter Type Default Description
arr jnp.ndarray - (undocumented)
input_size int - (undocumented)
h int - (undocumented)
n_windows int - (undocumented)
span str - span="input" -> [n, input_size, F] (encoder window); span="full" -> [n, input_size+h, F] (future-known spanning input + horizon).

Returns: jnp.ndarray

forward_loss

informer_training.forward_loss

Scale, forward, and reduce a point/quantile loss in scaled space.

Parameter Type Default Description
net - - (undocumented)
y_windows - - (undocumented)
h - - (undocumented)
input_size - - (undocumented)
scaler - - (undocumented)
loss_fn - - (undocumented)
futr_windows - None (undocumented)
sample_key - - (undocumented)
deterministic bool False (undocumented)

train

informer_training.train

Train net in place via one nnx.scan. Returns per-step losses.

Two independent RNG streams are split off seed: batch-index keys (NF's regime-dependent window sampling, below) and ProbSparse attn_keys (one per scan step, threaded through to every attention site inside InformerNet) -- so shuffling the training batches never perturbs which ProbSparse queries get sampled for a given step.

Parameter Type Default Description
net - - (undocumented)
y - - (undocumented)
h - - (undocumented)
input_size - - (undocumented)
max_steps - - (undocumented)
windows_batch_size - - (undocumented)
lr - - (undocumented)
seed - - (undocumented)
loss_fn - - (undocumented)
scaler - - (undocumented)
futr_exog - None (undocumented)

Raises: RuntimeError

predict_step

informer_training.predict_step

Forecast next h steps from the final input_size of the series.

Parameter Type Default Description
net - - (undocumented)
y_context - - (undocumented)
h - - (undocumented)
input_size - - (undocumented)
scaler - - (undocumented)
futr_full - None futr_full is the [input_size+h, F] future-known window (history + horizon).

Returns: jnp.ndarray (Returns [h, multiplier] in the original scale.)