Skip to main content

jaxfne

PyPI package Python versions Documentation Status Tests contributions welcome License: MIT

jaxfne

jaxfne is a compact JAX package for Tensor-Field Neural Equations (TFNE): a typed computational chain from neural emitters to source tensors, field-proxy operators, probe readouts, objective reports, optimizers, and run manifests.

Install

pip install jaxfne

Visualization extras:

pip install "jaxfne[viz]"

Development checkout:

git clone https://github.com/HNXJ/jaxfne.git
cd jaxfne
pip install -e ".[dev,viz]"

Canonical import:

import jaxfne as jtfne

Object grammar

Every jaxfne program is the same linear chain. Each step returns the input to the next, so the whole pipeline reads as one fluent sequence:

setup  ->  config  ->  construct  ->  simulate  ->  visualize  ->  tune/objective  ->  optimize  ->  export
enable_x64   Configuration   Model       Signals     vis.*           Objective         Model.tune   manifest / save_*

The full typed chain underneath that sequence:

Config
  -> Runtime(seed, dtype, backend, jit, vmap, duration_ms, dt_ms)
  -> Identity(area, layer, cell_type, unit_id, position)
  -> Emitter(theta_e, state_0, drive, noise, key)
  -> SourceMap(source_mode, source_calibration_status, support, normalization)
  -> FieldProxy(kernel, geometry_metadata, field_solver_status, field_claim_level)
  -> Probe(kind, selector, channel_geometry, units_status, method)
  -> Signals(spk, vm, source, lfp_proxy, csd_proxy, eeg_proxy, meg_proxy, spectrolaminar_proxy, emm_proxy)
  -> Objective(metrics, targets, gates, nulls, rejection_reasons)
  -> Optimizer(search_space, budget, key, constraints)
  -> Manifest(run_id, version, repo_sha, runtime_report, artifact_paths, asset_hashes, truth_gates)
  -> Validation(finite_outputs, strict_json, png_assets, notebook_receipts, optional_dependency_laziness)

Minimal workflow

import jaxfne as jtfne

jtfne.enable_x64()                                   # setup: x64 before arrays

cfg = jtfne.build_laminar_column()                   # config: V1, n=1000, flat E:I (legacy default)
cfg = (cfg.set_emitter("izhikevich", "cortical_eig")
          .probes(["spikes", "V_m", "LFP", "CSD"], n_contacts=16)
          .field(domain="laminar_column", conductivity="proxy", boundary="mean_zero_neumann"))

model   = jtfne.construct(cfg)                        # construct: Configuration -> Model
signals = jtfne.simulate(model, duration_ms=1000.0, dt_ms=0.5, seed=0)  # simulate -> Signals
spk = signals.get("spk")                             # (n_steps, n_neurons) spike raster
vm_e = signals.get("vm", cell_type="E")              # membrane voltage for E cells

Canonical cortex (default prior)

The verified ground-truth laminar prior is a first-class API surface — no source editing required. Excitatory fraction rises with depth (L6 ≈90% E), inhibition peaks superficially (L1 50% I, no PV), PV concentrates at L4; overall ≈77E:23I.

# Canonical laminar cortex: real per-layer composition + laminar placement.
cfg = jtfne.build_laminar_column(n=1000, ei_profile="canonical")

# Multi-area hierarchy with the canonical prior in each area:
cfg = jtfne.build_multi_area_columns(["V1", "V4", "PFC"], ei_profile="canonical")

ei_profile="flat" (the default) preserves the legacy depth-invariant composition and uniform3d placement unchanged; ei_profile="canonical" auto-routes to laminar placement so each neuron keeps its layer label and the per-layer E:I gradient is expressed. The exported constants jtfne.CANONICAL_LAYER_CELL_TYPE_FRACTIONS, jtfne.CANONICAL_Z_BANDS, and jtfne.DEFAULT_LAYERS document the prior directly.

Tune toward a target

obj = jtfne.rate_synchrony_targets()                 # defaults: 10 Hz, kappa 0 (async-irregular)
result = model.tune(obj, optimizer="AGSDR", steps=50)
tuned = result.model

manifest = jtfne.manifest(cfg, signals=signals)      # export: strict JSON-safe run manifest

Checkout validation

python -m compileall -q jaxfne tests examples scripts
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 PYTHONPATH=. python -m pytest tests -q --tb=short
PYTHONPATH=. python scripts/audit_notebooks_and_assets.py --check
PYTHONPATH=. python scripts/audit_notebook_grammar.py --check
mkdocs build --strict

Release files for jaxfne 0.4.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jaxfne 0.4.4
File Size Uploaded
jaxfne-0.4.4.tar.gz 12.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for jaxfne 0.4.4
File Interpreter ABI Platform
jaxfne-0.4.4-py3-none-any.whl Python 3 none any Details

Total release size: 12.5 MB

Release files / jaxfne-0.4.4.tar.gz

Download URL jaxfne-0.4.4.tar.gz
Size 12.2 MB
Tags Source
SHA-256 checksum
How to use checksums
ffa62eec8d417f2776b073bb6b5ee741bcb61f9c4c2cce43090bcd73ddac6dd0
BLAKE2b-256 checksum
How to use checksums
dec4af00efe3e6690edbdfc39610b931873045dae5416c71d27b091860df6178
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 21, 2026.

Transparency log

Release files / jaxfne-0.4.4-py3-none-any.whl

Download URL jaxfne-0.4.4-py3-none-any.whl
Size 281.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4851ad15cef8443bbe40693cb85c4411abe684b2092da9bb5d14cd91fc37c1bc
BLAKE2b-256 checksum
How to use checksums
d359406faced81d34c89568a7f5a8ebc03a2baddd20a828bd6fb84bb1d882a67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 21, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.25

2 release files

0.4.24

2 release files

0.4.23

2 release files

0.4.22

2 release files

0.4.18

2 release files

0.4.17

2 release files

0.4.16

2 release files

0.4.15

2 release files

0.4.14

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.5

2 release files

This release

0.4.4 This release

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.42

2 release files

0.3.41

2 release files

0.3.40

2 release files

0.3.39

2 release files

0.3.37

2 release files

0.3.31

2 release files

0.3.22

2 release files

0.3.21

2 release files

0.3.14

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.2.30

2 release files

0.2.28

2 release files

0.2.18

2 release files

0.2.10

2 release files

0.2.3

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

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