Quick Start
Build an adaptive System 1 model, then choose how it decides, remembers, and adapts.
Build the System 1 contract
Wrap ARC 1, a trained classifier, or any score-producing callable in a grounded decision space.
from gpbacay_arcane import DecisionSpace, System1def route(text, labels): return { "billing": 0.72 if "charged" in text.lower() else 0.10, "shipping": 0.18, "other": 0.10, }model = System1( predictor=route, decisions=DecisionSpace( ["billing", "shipping", "other"], min_confidence=0.60, min_margin=0.15, ), memory_weight=0.65,)# Learn a decided example immediately, without fine-tuning.model.remember("my card was charged twice", "billing")decision = model.decide("why was I charged again?")print(decision.label) # billing, or None when ARCANE abstainsprint(decision.source) # model+memoryprint(decision.evidence) # recalled examples behind the decisionAdvanced Usage with Resonance
Refine a current batch with isolated per-example targets, then optionally evaluate bounded adaptation.
from gpbacay_arcane import HierarchicalResonanceFoundationModel# Create an advanced model with biological neural principlesmodel = HierarchicalResonanceFoundationModel( vocab_size=3000, seq_len=32, hidden_dim=128, num_resonance_levels=4)model.build_model()model.compile_model(learning_rate=3e-4)# Train normally, including an explicit feedback-alignment step when desiredmodel.model.fit(X_train, y_train)model.train_feedback_step(X_train[:32], labels=y_train[:32])# Resonance changes latent state for this batch without changing learned weightspredictions = model.predict_with_resonance(X_test, resonance_cycles=4)# Optional test-time learning uses an objective, bounded updates, and rollbackadapted = model.adapt_at_inference( X_test, variables="all", objective="entropy", steps=2, episodic=True,)Sequence Models with PredictiveResonantLayer
For sequence or image-as-sequence tasks (e.g. MNIST), use PredictiveResonantLayer for local predictive resonance without hierarchical wiring.
from gpbacay_arcane import PredictiveResonantLayer, SpatioTemporalSummarization, BioplasticDenseLayer# Sequence of 28 steps (e.g. MNIST rows), 128 unitsx = PredictiveResonantLayer( units=128, resonance_cycles=3, resonance_step_size=0.2, return_sequences=True, persist_alignment=False)(x)x = SpatioTemporalSummarization(d_model=128)(x)x = BioplasticDenseLayer(units=128, enable_inference_plasticity=True)(x)# then pool and classifyTune resonance for the task: each cycle adds compute. Compare the same checkpoint at 0/1/2/4/8 cycles, then select the best balance of accuracy, calibration, latency, forgetting, order sensitivity, batch-size sensitivity, and distribution shift. See Inference-Time Adaptation for the full protocol.