Skip to main content

JAX Field Neural Equations: a source-to-field neurophysiology engine for TFNE models.

Project description

jaxfne

PyPI version Docs License: MIT Release

JAX-based tools for TFNE source, field, probe, objective, and optimizer workflows.

Emitter -> Source -> Field -> Probe -> Objective -> Optimizer

jaxfne is built for compact computational biophysics tutorials and package-level experiments. Current tutorial readouts use simulated/proxy scales with JSON-safe reports and deterministic seeds.

Install

pip install -U jaxfne

Development checkout:

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

Minimal workflow

import jaxfne as jtfne

cfg = jtfne.Configuration()
cfg = cfg.runtime(seed=7, dtype="float32", duration_ms=1000.0, dt_ms=0.1)
cfg = cfg.column("single_neuron", layers=["L2/3"], n=1)
cfg = cfg.cell_types({"E": 1.0})
cfg = cfg.connectivity()
cfg = cfg.set_emitter("izhikevich", "cortical_eig")
cfg = cfg.probes(["MUA-proxy", "source-proxy", "LFP-proxy"])

model = jtfne.construct(cfg)
signals = jtfne.simulate(model, duration_ms=1000.0, dt_ms=0.1, seed=7)
print(signals.V_m.shape, signals.spikes.sum())

Multi-objective tuning

objectives = jtfne.rate_targets(
    groups={"first_half": range(24), "second_half": range(24, 48)},
    targets_hz={"first_half": 5.0, "second_half": 10.0},
)
optimizer = jtfne.agsdr(
    parameters={"drive_scale_a": (0.35, 2.25), "drive_scale_b": (0.35, 2.25)},
    generations=8,
    population_size=6,
    seed=42,
)
result = model.tune(objectives=objectives, optimizer=optimizer)
print(result.best_score, result.best_parameters)

Core readouts

Readout Role
SPK spike matrix or events
Vm emitter voltage/state trace
Source source/current proxy
LFP-proxy laminar field proxy
CSD-proxy spatial source/divergence proxy
EEG-proxy linear scalp-channel proxy
MEG-proxy linear magnetic-channel proxy
EMM-proxy normalized activity-cost proxy

Validate a checkout

python -m compileall -q jaxfne tests examples
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 PYTHONPATH=. python -m pytest tests/ -q --tb=line
mkdocs build --strict

Documentation

MIT License.

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

jaxfne-0.3.24.tar.gz (4.6 MB view details)

Uploaded Source

Built Distribution

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

jaxfne-0.3.24-py3-none-any.whl (178.9 kB view details)

Uploaded Python 3

File details

Details for the file jaxfne-0.3.24.tar.gz.

File metadata

  • Download URL: jaxfne-0.3.24.tar.gz
  • Upload date:
  • Size: 4.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for jaxfne-0.3.24.tar.gz
Algorithm Hash digest
SHA256 b4de96e225275a29937eafd6a076739d8b8a7e206bacecf3c5210021b631f6af
MD5 d76040fdab3bfd82ea41e1f1ae43f908
BLAKE2b-256 55407893d2c27e2147b2b88219960f15d65c5da4f9da54a6993ee600334d28bc

See more details on using hashes here.

File details

Details for the file jaxfne-0.3.24-py3-none-any.whl.

File metadata

  • Download URL: jaxfne-0.3.24-py3-none-any.whl
  • Upload date:
  • Size: 178.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for jaxfne-0.3.24-py3-none-any.whl
Algorithm Hash digest
SHA256 709bbc0c93366265017b9f46b7f12bb82c482fd5581d260e9a56b9e1cefa67f0
MD5 1d5f381e644ec27d7a5ce7e4eb6fb4c8
BLAKE2b-256 06db59b8eed9148a9e47d7787222b7c763045a713ae43fbccaa5dd70f1ac887b

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