Skip to main content

Antara: a feedback-driven PyTorch wrapper

Antara(model) adds explicit online learning, bounded experience replay, and continual-learning memory to an existing torch.nn.Module.

The model still needs a learning signal: labels, a custom objective, or a loss returned by the model. Inference alone cannot establish whether a prediction was correct.

One-line wrapping

from airborne_antara import Antara

model = Antara(your_pytorch_model)
output = model(inputs)                   # original forward output and structure
metrics = model.learn(inputs, targets=labels)
prediction = model.predict(inputs)       # eval + no_grad; restores previous modes

Complete example:

import torch
from airborne_antara import Antara

model = Antara(torch.nn.Linear(8, 3))
x = torch.randn(16, 8)
y = torch.randint(3, (16,))
model.learn(x, targets=y)
model.on_task_complete(0)                # optional explicit task boundary
model.save_checkpoint("antara.pt")

restored = Antara(torch.nn.Linear(8, 3))
restored.load_checkpoint("antara.pt")

Install with pip install -e . from this checkout; development tools use pip install -e '.[dev]'. Requires Python 3.10+ and PyTorch 2.3+. The root requirements.txt includes historical demo dependencies and is not required for the wrapper.

Inputs, outputs, and objectives

  • Positional and keyword inputs are forwarded. Forward preserves the original output structure. Learning supports tensor, tuple, dictionary, and objects exposing logits or loss.
  • Class-index targets use cross entropy; same-shape floating targets use mean squared error. Unambiguous token-last and channels-first classification layouts are supported.
  • Other tasks use loss_fn(output, target), returning one finite scalar tensor. Without targets, learning requires that callback or an output containing a scalar loss.
  • Replay requires batch-first tensors with consistent batch sizes. It stores individual examples as detached CPU copies without resizing them. Set feedback_buffer_size=0 for other layouts and supply a suitable objective.
  • Ordinary model(...) follows PyTorch mode/autograd semantics. Use predict for evaluation. Custom model randomness and stateful behavior remain the model's responsibility.
model = Antara(backbone, loss_fn=my_loss, feedback_buffer_size=1024)
model.learn(images, attention_mask=mask, targets=labels, task_id=0)

Defaults use AdamW, uniform reservoir replay, and Synaptic Intelligence. Each learning call takes one update on new feedback and, when memory is available, one replay update. Task IDs group replay and consolidation; predict does not require them.

Replay stores actual input examples: choose capacity for their size and sensitivity. No universal memory or speed multiplier is claimed.

Experimental components

AdaptiveFramework and presets remain for research compatibility. Its historical forward returns diagnostics alongside model output; use Antara for the model-preserving interface.

MoE copies, adapters, introspection, world prediction, Reptile, Lookahead, gradient noise, and cognitive telemetry are optional and disabled by default in Antara(model). Presets can enable them and substantially change compute and behavior.

OGD currently projects Linear weight gradients using observed input subspaces. Adam's coordinate scaling and momentum prevent this from guaranteeing orthogonal parameter updates or zero forgetting. Protected-coordinate restoration preserves selected parameters, not every prediction.

World prediction requires (predictions, features) outputs. Three-dimensional features mean [batch, time, feature]. Two-dimensional cross-batch prediction requires temporal_world_model=True and aligned trajectories; shuffled batches are not temporal data.

The module named “consciousness” remains experimental telemetry. Its workspace has no validated task-learning objective in this wrapper. It is not evidence of consciousness, reasoning ability, or AGI.

Checkpoints

Version 2 checkpoints are atomic, self-contained files containing model/auxiliary weights, optimizer/scaler state, replay, importance/anchors/masks, supported controller state, counters, and RNG state. Reconstruct the same model/configuration before loading. Supply custom loss callbacks again with the same semantics.

Tests verify an identical next CPU update after reload, including replay and protected coordinates. Cross-device or nondeterministic GPU execution need not be bitwise identical.

Exact resume currently rejects MoE, cognitive telemetry, perception, graph memory, health/performance editing, learned optimizers, and compiled models because their extra state lacks a complete resume contract. Legacy checkpoints support explicit weights-only migration, not exact training continuation. Only load files you trust.

Evidence and limits

python -m examples.continual_learning --output results/continual_smoke.json

This experiment uses separate train/test examples, a global four-class head, three fixed seeds, and no task ID at inference. It compares fine-tuning, replay, and replay plus SI. Replay takes additional optimizer steps. This is a synthetic correctness check, not a compute-matched or state-of-the-art benchmark.

Historical outputs do not certify this revision. Earlier headline accuracy and overhead claims have been removed because this checkout does not establish them. Split-CIFAR-100, multiple seeds, matched budgets, ablations, and held-out real data are still required before a competitive claim.

See repair notes and the architecture contract.

Verification

pytest -v
black --check airborne_antara tests
ruff check airborne_antara tests
python -m build --sdist --wheel

CI enforces tests, formatting, and linting. Security scanning is explicitly advisory. Research submodules are pinned separately and retain historical protocols.

Metadata

Release files for airborne-antara 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for airborne-antara 0.2.0
File Size Uploaded Provenance Actions
airborne_antara-0.2.0.tar.gz 111.7 kB Without provenance Details for airborne_antara-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for airborne-antara 0.2.0
File Interpreter ABI Platform Actions
airborne_antara-0.2.0-py3-none-any.whl Python 3 none any Details for airborne_antara-0.2.0-py3-none-any.whl

Total release size: 224.5 kB

Release files / airborne_antara-0.2.0.tar.gz

Download URL airborne_antara-0.2.0.tar.gz
Size 111.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d42e77d25412735bed3f49009c04ecad5e4e078890b80241d06e43128cbf9962
BLAKE2b-256 checksum
How to use checksums
34e20b680dcc6b1ba37fc5509860ac2feb632f2c6cc53dd7028921cc8e3b9323
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / airborne_antara-0.2.0-py3-none-any.whl

Download URL airborne_antara-0.2.0-py3-none-any.whl
Size 112.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
490c9a3ccb9406fd9517aac76d0d0324694fb96bfec3c28499f5ce4cd8d6f887
BLAKE2b-256 checksum
How to use checksums
c1625677fe27270343def5f5d992f2afb6fc483bae38f83e711465e283081e45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for airborne-antara 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page