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.3

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.3
File Size Uploaded
jaxfne-0.4.3.tar.gz 9.8 MB Details

Built distribution (wheel)

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

Total release size: 10.1 MB

Release files / jaxfne-0.4.3.tar.gz

Download URL jaxfne-0.4.3.tar.gz
Size 9.8 MB
Tags Source
SHA-256 checksum
How to use checksums
d0d2d5ef0be48bf57f35122201db01b3393ba908000defd2f3f7d0268f82db11
BLAKE2b-256 checksum
How to use checksums
ee51ae1c54fd9193af99cc733cef305b2d6ff6d8d63f71751a91799bd309ffe3
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.3-py3-none-any.whl

Download URL jaxfne-0.4.3-py3-none-any.whl
Size 280.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
413f5d743fe21911178318651adaed49ec612c1f752d983ca511af38276e547b
BLAKE2b-256 checksum
How to use checksums
8f1c5b28f4caf6fc797a22c76a2c6a18afbe4cfb9feec0f7f7a648c874ca848d
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

0.4.4

2 release files

This release

0.4.3 This release

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