Skip to main content

Bija — Artificial Brain Computation Kernel. A PyTorch-like framework for event-causal plastic graph simulation.

Project description

Bija (बीज) — Artificial Brain Computation Kernel

Bija (Sanskrit for "seed") is a PyTorch-like computation kernel for artificial brain simulation. It provides device-agnostic primitives, a composable module system, and CPU/CUDA backends for event-causal plastic graph computation.

Install

pip install bija-cpu          # CPU only (NumPy)
pip install bija-gpu          # GPU support (Numba CUDA)
pip install bija-tpu          # TPU support (JAX/XLA - coming soon)

Quick Start

import bija
from bija import nn

# 1. Choose device
dev = bija.device("cuda")  # or "cpu"

# 2. Build a brain model (user-level code)
brain = nn.Brain(
    neurons   = nn.AdExNeuron(10_000, branches=2),
    synapses  = [nn.PlasticSynapse(10_000, 10_000, 1_280_000)],
    regions   = nn.RegionMap(10_000, 8),
    stability = nn.HomeostasisController(target_rate=0.05),
    safety    = nn.Watchdog(),
).to(dev)

# 3. Run
for t in range(1000):
    result = brain.step(sensory=[...], body=bija.BodyContext(novelty_delta=0.1))
    print(f"t={t} spikes={result.spike_count}")

# 4. Save / Load
bija.save(brain, "my_brain.bija")
bija.load(brain, "my_brain.bija")

Architecture

User Model (10k brain, cortical column, custom architecture)
     |
bija.nn       Module system: Brain, AdExNeuron, PlasticSynapse, RegionMap
     |
bija.ops      Primitives: integrate, spike, trace, plasticity (auto-dispatch)
     |
bija.core     Data structures: Device, StateVector, SparseGraph
     |
Backend       CPU (NumPy) / CUDA (Numba)

Key Principles

  • No global loss. All plasticity is local (pre/post/neuromodulator).
  • Event-sparse. Cost per tick ~ O(active_neurons + spikes × fanout).
  • Device-agnostic. Same model code runs on CPU or GPU.
  • Composable. Build arbitrary brain architectures from modules.
  • Safe. External actions gated by an immutable Watchdog.

Examples

# Run 10k test model on CPU
python examples/model_10k.py

# Run on GPU
python examples/model_10k.py --cuda

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bija_tpu-0.1.0.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bija_tpu-0.1.0-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file bija_tpu-0.1.0.tar.gz.

File metadata

  • Download URL: bija_tpu-0.1.0.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for bija_tpu-0.1.0.tar.gz
Algorithm Hash digest
SHA256 defb1d7ebfd603bf8e8e9341f492e7c081e052729104b4c453ec09f7982224ea
MD5 bbf277d5b0283a9a997ee182897510cb
BLAKE2b-256 f81b301a7c40033f7c5abd67a09312e1190f7eff400fa497ad9422994354d98c

See more details on using hashes here.

File details

Details for the file bija_tpu-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bija_tpu-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for bija_tpu-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74bbb3ce35242611036ad3bc2031c8717f053fc2e9d37cabb042c3007b33669e
MD5 ffe864fbbab574ff41f269af3f83c1db
BLAKE2b-256 8747c44a9b71af6c1c46bb7850c24049e8b757417be966e8e319c1423fa8a3d5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page