Skip to content

Input Interface

Raul Montoya Cardenas edited this page Jul 29, 2026 · 2 revisions

Input Interface and Generic Signal Protocol

Wiki hero

Generated with Grok Build: Grok 4.5 · xAI Imagine (/imagine)

LiquidCortex accepts generic numeric tensors only. Domain decoders belong in application code.

SparseBrain / EnsembleBrain Contract

Signal Type Constraints
Input u CuVector{Float32} length(u) == n_in for the brain/ensemble
inhibition Real → Float32 Clamped to [0, MAX_INHIBITION] (3.0)
reflex_eta Real → Float32 Learning rate override (default ETA)
reflex_signal Real → Float32 Ensemble only; `

Defaults at construction: n_in=14, n_out=16 (SparseBrain / EnsembleBrain). Change both consistently when wiring a pipeline.

Constructing inputs

using CUDA

# zeros / ones / filled
u = CUDA.zeros(Float32, n_in)
u = CUDA.ones(Float32, n_in) .* 0.1f0

# from host
u = cu(Float32[0.1, 0.0, -0.2, ...])  # length must match n_in

# streaming: mutate in place each tick
u .= new_features  # still CuVector{Float32}
step!(brain, u; inhibition=stress)

Dimension errors

Mismatched length throws DimensionMismatch with expected vs actual sizes — fail fast rather than silent pad/truncate.

What Was Removed

Public API does not export:

  • MarketPulse
  • decode_market_pulse
  • pulse_to_input

Former market- or mining-specific feature packs should be rebuilt in the consumer (e.g. strategy service) as plain Vector{Float32} / CuVector{Float32} feature vectors.

Reference LSM Contract

Signal Type Notes
inputs_vec Vector{Float32} (host) Length sets n_in on first lazy init
inhibit_val Float32 Gain shrink: gain = 1 - 0.4 * inhibit_val
n_out Int Only applied on first lazy init

Returns host Vector{Float32} or CSV string via run_lsm_step_str.

Guidance for Arbitrary Time Series

  1. Choose fixed n_in / n_out for the experiment.
  2. Normalize features to a stable scale (package does not auto-scale).
  3. Map operational stress → inhibition ∈ [0, 1] (or up to 3 if intentional).
  4. Map discrete shocks → reflex_signal with magnitude > 0.1 when flash-learning is desired.
  5. Read get_output / get_ensemble_output each tick or on a schedule for control / logging.

Related


Last updated: July 28, 2026 Updated by: Grok Build: Grok 4.5 Package tip reference: 4e2698c (main)

Clone this wiki locally