Projector — module#

Deterministic Projectors#

Mappings from a compact present state S_t to a set of K candidate futures {S_{t+1}^{(k)}}.

This module defines:

  • Projector: protocol/contract for deterministic future projection.

  • LinearProjector: affine projector that generates evenly spaced perturbations around a base prediction, followed by tanh stabilization.

class qmlhc.predictors.projector.LinearProjector(weight=1.0, bias=0.0, span=0.2)[source]#

Bases: object

Affine projector with evenly spaced perturbations around the base prediction.

The projector computes a base prediction base = w * x + b and then generates K values by adding linearly spaced deltas in [-span, span]; each result is passed through tanh for numerical stability.

Parameters:
  • weight (float, optional) – Scalar weight w used in the affine base prediction, by default 1.0.

  • bias (float, optional) – Scalar bias b used in the affine base prediction, by default 0.0.

  • span (float, optional) – Half-width of the linear delta range, by default 0.2.

project(s_t, branches=2)[source]#

Generate K candidate futures via affine transform + evenly spaced deltas.

Parameters:
  • s_t (TensorLike) – Current compact state vector (D,).

  • branches (int, optional) – Number of candidate futures (K), by default 2 (clamped to >= 2).

Returns:

Matrix of candidate futures with shape (K, D).

Return type:

Array

Notes

The final futures are computed as: tanh(w * s_t + b + delta_k) for delta_k in evenly spaced values across [-span, span].

class qmlhc.predictors.projector.Projector(*args, **kwargs)[source]#

Bases: Protocol

Contract for deterministic future projection from a present compact state.

project(s_t, branches=2)[source]#

Produce K candidate futures from the current state.

Parameters:
  • s_t (TensorLike) – Current compact state vector (D,).

  • branches (int, optional) – Number of candidate futures (K), by default 2.

Returns:

Matrix of candidate futures with shape (K, D).

Return type:

Array