Cadence
Website · Demos · Documentation · Paper · PyPI
An experimental brain that learns, remembers, imagines and acts.
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.
Bounded, observer-like regions carry local state, communicate through ports, read back activity and retain records. They repair disagreement to find a coherent state; actual observations and consequences guide learning. A settled answer can still be wrong about the world, so capability is measured through free behavior. Cadence is alpha research software, not a claim of human-level intelligence.
Start with System 1
Python 3.11+ and NumPy are required.
python -m pip install cadence-net==0.70.0
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 constructor includes a working trace and fast/persistent associative memory. Earlier activity can affect later answers, and actual outcomes change associations. Capacity is finite; correlated memories can interfere.
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.
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 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.
Documentation · API · Contributing · Changelog · Research tasks
Licensed under GPL-3.0.
Metadata
Release files for cadence-net 0.70.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cadence_net-0.70.0.tar.gz | 4.0 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cadence_net-0.70.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 4.3 MB
Release files / cadence_net-0.70.0.tar.gz
| Download URL | cadence_net-0.70.0.tar.gz |
|---|---|
| Size | 4.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8f4671b748ad7057697842b4862cb3adf9ea096ed3a8455ccf103f01c2531417
|
|
BLAKE2b-256 checksum How to use checksums |
aadd88284c1ba1328b87ed7b1a2efc1bf00af76ba0812da612dea54da816f68d
|
| 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.70.0-py3-none-any.whl
| Download URL | cadence_net-0.70.0-py3-none-any.whl |
|---|---|
| Size | 314.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
03e82a9ba21a694d85777234eef33f957560c27ec890c4655212d50648c41207
|
|
BLAKE2b-256 checksum How to use checksums |
5df8861e8d0a5c9f6c9d1faebec19ef6a8815e15b77c1e6d5026921ae6919ca1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.0
|