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_gpu-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_gpu-0.1.0-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bija_gpu-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_gpu-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6be0b40632903adf6221a2b960400bfb95ba38ebb6d6163c9f05287c6423c73c
MD5 4298010f7675d317646bc1498d42fc16
BLAKE2b-256 1a0514f5892c98b7e6e86c8f711e7c166a22a4521bbe7d41342fa73b70f3a449

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bija_gpu-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_gpu-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a1e529de94a3ea9e43cf339a4456b98f816b4fb1ae767c993eaf7cc95c47534e
MD5 46d0fa934052340981fa4bb7119326a5
BLAKE2b-256 1c0478a038b06ee5d2a65883fb681520c3467de40794704229dbe4000a3d82b7

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