Skip to content

Commit

Permalink
fix inits & add todos to dopa
Browse files Browse the repository at this point in the history
  • Loading branch information
Marmaduke Woodman committed Mar 29, 2024
1 parent 896d5f7 commit 735f1d3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
14 changes: 12 additions & 2 deletions examples/dopa-sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,27 @@
)

# initial conditions
y0 = jp.array([0., -2.0, 0.0, 0.0, 0.0, 0.0])
y0 = jp.array([0.1, -60.0, 0.0, 0.0, 0.0, 0.0])

# run sweep
end_time = 256.0
pkeys, ys = sweep_node(y0, params, T=end_time, cores=4)

# for large sweeps, ys may not yet be filled with outputs
ys.block_until_ready()

# pkeys provides the names for the extra dims of ys result
print(pkeys, ys.shape)

# now similar for network sweep
n_nodes = 8
Ci, Ce, Cd = jp.zeros((3, n_nodes))
Ci, Ce, Cd = vb.randn(3, n_nodes, n_nodes)
pkeys, ys = sweep_network(y0, params, Ci, Ce, Cd, T=end_time, cores=4)
ys.block_until_ready()
print(pkeys, ys.shape)

# plot some of it
import matplotlib.pyplot as pl

pl.plot(ys[0,0,:,0], 'k')
pl.show()
13 changes: 13 additions & 0 deletions vbjax/app/dopa/sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@
import vbjax as vb


# TODO can't continue simulations b/c init doesn't vmap w/ params
# TODO need to run long time tavg and bold
# TODO allow predefined set of params for e.g. random sample
# TODO regional parameters?
# TODO abstract over simulation configuration e.g. noise
# TODO ISPC impl for benchmark comparison
# TODO use delays if available
# TODO implement memory limits & test them
# TODO memmap raw/tavg/bold direct to file
# TODO automate inner vs outer loop over parameters



def sweep_node(init, params, T=10.0, dt=0.01, sigma=1e-3, seed=42, cores=4):
"Run sweep for single dopa node on params matrix"

Expand Down

0 comments on commit 735f1d3

Please sign in to comment.