Skip to content

Getting Started

Raul Montoya Cardenas edited this page Jul 29, 2026 · 2 revisions

Getting Started

Wiki hero

Generated with Grok Build: Grok 4.5 · xAI Imagine (/imagine)

Installation

Registry (when published):

using Pkg
Pkg.add("TemporalFocus")

From the GitHub repo (current practice for unreleased work):

using Pkg
Pkg.add(url="https://github.com/Limen-Neural/NeuroPulse.jl")

From a local clone:

cd NeuroPulse.jl
julia --project=. -e 'using Pkg; Pkg.instantiate()'
julia --project=. -e 'using Pkg; Pkg.test()'

Do not Pkg.add("NeuroPulse") or using NeuroPulse for new code. The package name is TemporalFocus.

Minimal four-region example

using TemporalFocus

router = RegionRouter(
    n_regions = 4,
    n_out = 8,
    region_names = ["sensor", "reservoir", "memory", "decoder"],
)

regions = [
    ActivityRegion(0.82f0, Float32[0.9, 0.7, 0.2, 0.1, 0.0, 0.1, 0.3, 0.5]),
    ActivityRegion(0.28f0, Float32[0.3, 0.2, 0.1, 0.0, 0.0, 0.0, 0.2, 0.2]),
    ActivityRegion(0.41f0, Float32[0.4, 0.6, 0.5, 0.2, 0.1, 0.1, 0.0, 0.1]),
    ActivityRegion(0.12f0, Float32[0.1, 0.1, 0.0, 0.0, 0.4, 0.6, 0.8, 0.9]),
]

update_routing!(router, regions)
@show router.routing_weights
@show routing_diagnostics(router)

ActivityRegion is an immutable struct — construct each tick with concrete rates and readouts (or replace vector entries wholesale). Field mutation after construction is not supported.

Worked examples (repo)

File Focus
examples/three_region.jl Minimal 3-region layout
examples/six_region.jl Larger layout + custom names
examples/reservoir_integration.jl Feeding compact reservoir readouts
julia --project=. examples/three_region.jl
julia --project=. examples/six_region.jl
julia --project=. examples/reservoir_integration.jl

Optional helpers

# Stress-aware leak (not required for routing)
leak = Ref(0.05f0)
adapt_leak!(leak, 40.0)                    # default: percent-scale [0, 100]
adapt_leak!(leak, 0.4; stress_adapter = x -> Float32(x))  # unit adapter

# Checkpoint
snap = save_state(router)
load_state!(router, snap)

Documenter (local)

julia --project=docs -e 'using Pkg; Pkg.develop(path="."); Pkg.instantiate()'
julia --project=docs docs/make.jl

Published: limen-neural.github.io/NeuroPulse.jl/dev

Next


Last updated: July 29, 2026 Updated by: Grok Build: Grok 4.5 Package tip reference: c9ff99c (main)

Clone this wiki locally