TensorCode documentation#
TensorCode separates callable operations, owned trainable models, application runtime state and durable training experience. Start with the quickstart for a complete offline model lifecycle.
| Guide | Contents |
|---|---|
| Pretrained checkpoints | Hosted tool catalog, pinned loading, scope and publication |
| Quickstart | Install, initialize, collect feedback, train, save and reload |
| Operations | Vector/message contracts, encoders, decoders and symbolic graph interfaces |
| Pretrained vector models | Transformer encoding, text/diffusion decoding, training, canonical imports and owned configuration |
| Tools | Owned models, shared workspace, pretrained artifacts and sessions |
| Cognition | Sourced evidence, generated proposals, verification, revision and action feedback |
| Training | Tool objectives, tracing, replay and resumable checkpoints |
| Examples | Learning agents and applications with explicit inputs |
| Validation | Measured behavior, pretrained provenance and remaining gaps |
| Evaluation records | Machine-readable measurements |
| Troubleshooting | Loading, gradients, replay and session errors |
| Updating development code | New public imports, tool factories and saved-data continuity |
Public boundaries#
tensorcode.ops.{vec,text,graph} contains callable operations. Developers assign
names for cognitive roles; the same transform can participate in interpretation,
revision or response formulation. Representation contracts matter: equal tensor
shapes do not make independently trained encoders interchangeable. Concrete vector
encoders live in tensorcode.ops.vec.encode, and decoders in
tensorcode.ops.vec.decode; root exports are conveniences. Backend modules are
private. See the operation API and
owned operation contracts.
Learned operation constructors accept JSON configuration and own their model
parameters. Explicit from_foundation factories initialize supported pretrained
architectures; save_pretrained/from_pretrained persist owned artifacts.
Advanced vector from_module and text from_model factories integrate supplied
implementations with explicit reconstruction limits. Weightless operations accept
optional configuration; graph calls still raise NotImplementedError.
tensorcode.tools contains owned PyTorch models: Chatbot, Investigator, Planner,
Decision and Scene. Scene combines image patches and text through the shared
workspace to rank supplied descriptions or, with an owned language foundation,
produce explicitly unverified image interpretations. Neither mode constructs
symbolic scene graphs. Constructors initialize all
parameters; from_pretrained loads complete model artifacts from a local directory
or the Hugging Face Hub. Tool configurations accept only their documented
fields: an unknown or obsolete field, whether passed to a constructor or saved
in an artifact, raises a ValueError naming it and listing the valid fields.
An external foundation model can bootstrap training, but its inherited
competence does not establish that a new workspace has learned.
Tools construct their sessions and execution helpers. tools.cognition exposes
evidence and interpretation records; tools.actions exposes action callback
records and an explicit bounded-loop factory. Planner exposes structured plan
contracts and new_executor(...). Evidence, policies and action implementations
remain explicit, while memory storage and state transitions stay internal.
Generated hypotheses are not source evidence; generated plans are not executable
action code. The general core supplies no domain ontology or implicit authority.
Root tensorcode.trace() and tensorcode.training capture operation dependencies and
train supported local tensor paths independently of an agent harness. Tracing does
not make arbitrary Python, remote model calls or discrete choices differentiable.
Graph operations currently declare symbolic interfaces without implementations.
Choose training.Trainer.from_tool(model) for a declared model objective, or
training.Trainer.from_ops(operations, losses=...) for a composed program. Load
saved experience through training.load_experience(...); save optimization state
through the trainer's checkpoint methods. Root Trace, InputRef and OutputRef
provide public trace types without exposing the implementation modules.