Coming from tvboptim

How TVBO and the tvboptim JAX backend divide the work

If you already know tvboptim, this page explains where TVBO fits. If instead you want to fit a model to data, go straight to the Fitting, inference & optimization topic, which is where the workflows live.

The division of labour

tvboptim is a JAX framework for simulating and optimizing brain network models: it provides the solver, the prepare machinery, JIT compilation, automatic differentiation, and GPU execution.

TVBO does not reimplement any of that. It supplies the declarative specification (a YAML model, network, loss, and optimization schedule) and generates the concrete tvboptim code from it. The backend stays the runtime; TVBO stays the spec layer:

Concern Owned by
Model, network, losses, optimization schedule TVBO (YAML + schema)
Code generation from that spec TVBO (Mako templates, sympy printers)
Solver, JIT, autodiff, GPU execution tvboptim
Result container and observation pipeline TVBO

A practical consequence: TVBO-generated runs are checked to be numerically identical to the equivalent hand-written tvboptim workflow, so moving a model into TVBO does not change its numbers.

What this buys you

  • One spec, several backends. The same YAML also renders to TVB, PyRates, NeuroML, and the Julia backends; see the interoperability overview.
  • Declarative optimization. Losses, free parameters, staged schedules and algorithms are data, not code.
  • Reproducibility. The experiment is a file you can version, share, and re-run.

Where the workflows went

The optimization workflows that used to sit on this page are now organized by goal rather than by backend, in Fitting, inference & optimization:

Quick start

from tvbo import SimulationExperiment

exp = SimulationExperiment.from_db("JR_MEG_FrequencyGradient_Optimization")
results = exp.run()
print(results)

Result objects follow the YAML structure (integration, algorithms, optimization); see the experiment result for the full container.