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 bytanhstabilization.
- class qmlhc.predictors.projector.LinearProjector(weight=1.0, bias=0.0, span=0.2)[source]#
Bases:
objectAffine projector with evenly spaced perturbations around the base prediction.
The projector computes a base prediction
base = w * x + band then generatesKvalues by adding linearly spaced deltas in[-span, span]; each result is passed throughtanhfor numerical stability.- Parameters:
- 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)fordelta_kin evenly spaced values across[-span, span].
- class qmlhc.predictors.projector.Projector(*args, **kwargs)[source]#
Bases:
ProtocolContract 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