Skip to main content

Cadence: a continuing brain with local state, memory and repair

Cadence

Website · Documentation · Application demos · Paper · PyPI

CI License: GPL v3

One continuing equilibrium brain: learn a world, act in it, repair what fails.

Cadence is not a feed-forward deep neural network. Its primary application is one acquired brain continuing through experience.

Cadence aims to build a simulated human-like brain from simplified biological mechanisms. Its default System 1 is a continuing animal-like brain with perception, plastic connections, memory and action. Optional System 2 adds recursive feedback through observing cortical regions in the same neural graph. The base can already be deep and modular. Biological names describe functional software roles.

Bounded, observer-like regions carry local neural state. The composition declares sensory and motor indices, exposes activity for readback and retains working traces and cue/outcome associations. Reciprocal regions constrain one another as the neural graph settles; actions require its full equations to qualify. Actual observations and consequences guide local plasticity and memory writes. The aim is to bootstrap a useful interpretation, use it in an ongoing life, and repair witnessed failures while retaining the same acquired brain.

Learned parameters and memories support a family of equilibria under changing evidence and context. They do not hold the brain at one frozen state. An internally consistent answer can still be wrong about the world: numerical settlement and useful understanding need separate evidence.

Start with one continuing equilibrium brain, the canonical guide to this lifecycle and its current implementation boundaries. Brain.compose already supplies continuing action, local learning and memory. Integrated learned world prediction and automatic failure-triggered repair with cheap stable operation remain development goals. Cadence is alpha research software.

The examples and guides use Cadence 0.72.0, including action diagnostics through Brain.last_settlement.

How a Cadence brain differs from a feed-forward network

Brain.compose(inputs=4, actions=2, modules=(64, 32, 16)) builds reciprocal processing regions whose activity settles together. Later regions can shape earlier ones while an answer forms. Working and associative memory contribute to the current drive; the selected motor action comes from the qualified neural state. An external trained readout would be a separate answer-producing model.

The graph learner compares local activities in free and nudged phases, without a backward differentiation pass through those phases. Default teaching and reward eligibility are finite; LearnerConfig(qualified=True, ...) explicitly requires supervised phases to qualify before updating. Other Cadence model families have their own learning contracts, including explicit adjoints in record and belief models.

Independent classification and calibration remain useful mechanism tests. They do not exercise the complete continuing brain. Recurrent networks trained by backpropagation can also learn online and use memory: the relevant comparison is acquired behavior and total work on the same task and information, not an architectural label. See the update mechanisms.

Why Cadence

The library makes continuing state, reciprocal interpretation, local plasticity and memory available in one small interface. A saved brain can resume an action awaiting its actual outcome. Private imagination can inspect responses without rewriting live experience. These are mechanisms for testing acquisition, retention and recovery through a life.

The target includes full-sentence language and reusable world understanding. A small fixed-label task is a control, not that destination. Greater capability, scalability and efficiency than transformers must be established with matched comparisons. A small numerical residual does not measure low physical energy or guarantee a correct answer.

Start with System 1

Python 3.11+ and NumPy are required. Install the published release for this basic example:

python -m pip install cadence-net==0.72.0

Its released documentation describes the APIs included in that package.

import numpy as np
from cadence import Brain

brain = Brain.compose(inputs=4, actions=2, modules=(16, 8), seed=7)
observation = np.array([[1.0, 0.0, 0.0, 0.0]])
action = brain.step(observation)

# A tiny environment rewards action 0 and supplies the next observation.
reward = (action == 0).astype(float)
next_observation = np.array([[0.0, 1.0, 0.0, 0.0]])
action = brain.step(next_observation, reward=reward, done=np.array([False]))
assert action.shape == (1,)

step learns from the preceding action's measured reward, then chooses the next action. teacher= can label the current observation. Keep each batch row attached to the same life. There is no training/inference mode switch. Continuous interaction covers teaching, resets and saved continuation. The continuing brain example keeps the same brain through bootstrap, unchanged conditions, disruption and correction, then checks a checkpoint awaiting feedback. It records task outcomes and free-answer work separately, and teaches a repeated cue only after a witnessed mistake. Real reward learning and associative writes still process every observed outcome.

The constructor includes a working trace and fast/persistent associative memory. The trace carries recent activity; learned graph parameters and consolidated associations retain changes across resets. A current teacher changes graph parameters. Actual chosen-action outcomes write associative memory. act reads both memory pathways; independent predict and accuracy read neither, so they measure the graph's learned response. Capacity is finite; overlapping associations and further plasticity can interfere with recall.

phases = brain.imagine([observation, next_observation])
assert phases  # Inspect phase.converged before using an imagined response.

Imagination carries a private trace without changing live memory, random state or pending feedback. It evaluates responses to the observations you supply. For learned environmental consequences and action planning, use the separate temporal model.

To work from source, install from the library repository root:

python -m pip install -e .

This installs the local source as an editable package.

The API keeps each completed action solve's residual, qualification, sweeps and check counts in read-only brain.last_settlement, including refused attempts. These diagnostics exclude learning, reward eligibility and memory work. The quickstart shows how to inspect them; the continuing example also records other settling phases. Cheap routine operation and a useful response to surprise must be measured, not inferred from a small residual.

Add optional System 2

recursive = Brain.compose(
    inputs=4, actions=2, modules=(16, 8), observers=(8,), seed=7,
)

Observer regions read and return influence to the base, motor regions and earlier observers. They join the same settlement and use the same interaction interface. This makes recursive feedback available; learning when it helps remains a task for experience and evaluation.

Actions and independent predictions require the full neural equation residual to meet the configured tolerance. Exhausting the budget refuses an action without changing its live state, memory or pending feedback. If step has learned a real outcome before the next action refuses, retry act without submitting that reward again. Numerical damping stays within the total budget and checks the original equations. It does not change the teaching rule. See contracts.

Go further

Build a brain for custom wiring, memory for traces and associations, and the memory/planning example for a bounded demonstration with actual toy-body outcomes. Record patches provide event records and consolidation. The advanced population solver provides exact state-and-error readback under its own numerical contract.

cadence-demos contains the active application demos. cadence-examples preserves research examples and viewer tools with their own declared library pins.

Documentation · API · Contributing · Changelog · Research tasks

Licensed under GPL-3.0.

Metadata

Release files for cadence-net 0.72.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 cadence-net 0.72.0
File Size Uploaded
cadence_net-0.72.0.tar.gz 4.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for cadence-net 0.72.0
File Interpreter ABI Platform
cadence_net-0.72.0-py3-none-any.whl Python 3 none any Details

Total release size: 4.5 MB

Release files / cadence_net-0.72.0.tar.gz

Download URL cadence_net-0.72.0.tar.gz
Size 4.2 MB
Tags Source
SHA-256 checksum
How to use checksums
80a2a47056735cf8b7c4cd6f33bc675bdb6dbf380eac83647b94e09c963926d4
BLAKE2b-256 checksum
How to use checksums
3ccfce022267eb09ff25770c5a4c4d3adc4b853673a9b25a96f3f2372101fd77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.0

Release files / cadence_net-0.72.0-py3-none-any.whl

Download URL cadence_net-0.72.0-py3-none-any.whl
Size 324.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
207c6a822223112d02a725bc99a2364e00643b98f4ca16b69c37264d90438775
BLAKE2b-256 checksum
How to use checksums
59a522941ec3157b4e2e2cf833ddf82bb38dfee15bab714d6231a967d21524d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.0

Release history Release notifications | RSS feed

0.83.0

2 release files

0.82.0

2 release files

0.81.0

2 release files

This release

0.72.0 This release

2 release files

0.50.0

2 release files

0.49.0

2 release files

0.48.0

2 release files

0.47.0

2 release files

0.46.0

2 release files

0.45.0

2 release files

0.44.0

2 release files

0.43.0

2 release files

0.42.0

2 release files

0.20.1

2 release files

0.19.0

2 release files

0.18.0

2 release files

0.17.0

2 release files

0.16.0

2 release files

0.15.0

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.1.0

2 release files

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