Simulation
integrate(module, params=[], *, param_state=None, data_stimuli=None, t_max=None, delta_t=0.025, solver='bwd_euler', voltage_solver='jaxley.stone', checkpoint_lengths=None, all_states=None, return_states=False)
¶
Solves ODE and simulates neuron model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
params |
List[Dict[str, ndarray]]
|
Trainable parameters returned by |
[]
|
param_state |
Optional[List[Dict]]
|
Parameters returned by |
None
|
data_stimuli |
Optional[Tuple[ndarray, DataFrame]]
|
Outputs of |
None
|
t_max |
Optional[float]
|
Duration of the simulation in milliseconds. If |
None
|
delta_t |
float
|
Time step of the solver in milliseconds. |
0.025
|
solver |
str
|
Which ODE solver to use. Either of [“fwd_euler”, “bwd_euler”, “cranck”]. |
'bwd_euler'
|
tridiag_solver |
Algorithm to solve tridiagonal systems. The different options
only affect |
required | |
checkpoint_lengths |
Optional[List[int]]
|
Number of timesteps at every level of checkpointing. The
|
None
|
all_states |
Optional[Dict]
|
An optional initial state that was returned by a previous
|
None
|
return_states |
bool
|
If True, it returns all states such that the current state of
the |
False
|
Source code in jaxley/integrate.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
|
exponential_euler(x, dt, x_inf, x_tau)
¶
An exact solver for the linear dynamical system dx = -(x - x_inf) / x_tau
.
Source code in jaxley/solver_gate.py
36 37 38 39 40 41 42 43 44 |
|
save_exp(x, max_value=20.0)
¶
Clip the input to a maximum value and return its exponential.
Source code in jaxley/solver_gate.py
7 8 9 10 |
|
solve_inf_gate_exponential(x, dt, s_inf, tau_s)
¶
solves dx/dt = (s_inf - x) / tau_s via exponential Euler
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
ndarray
|
gate variable |
required |
dt |
float
|
time_delta |
required |
s_inf |
ndarray
|
description |
required |
tau_s |
ndarray
|
description |
required |
Returns:
Name | Type | Description |
---|---|---|
_type_ |
updated gate |
Source code in jaxley/solver_gate.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
step_voltage_explicit(voltages, voltage_terms, constant_terms, coupling_conds_bwd, coupling_conds_fwd, branch_cond_fwd, branch_cond_bwd, nbranches, parents, delta_t)
¶
Solve one timestep of branched nerve equations with explicit (forward) Euler.
Source code in jaxley/solver_voltage.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
|
step_voltage_implicit(voltages, voltage_terms, constant_terms, coupling_conds_upper, coupling_conds_lower, summed_coupling_conds, branchpoint_conds_children, branchpoint_conds_parents, branchpoint_weights_children, branchpoint_weights_parents, par_inds, child_inds, nbranches, solver, delta_t, children_in_level, parents_in_level, root_inds, branchpoint_group_inds, debug_states)
¶
Solve one timestep of branched nerve equations with implicit (backward) Euler.
Source code in jaxley/solver_voltage.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
|
voltage_vectorfield(parents, voltages, voltage_terms, constant_terms, coupling_conds_bwd, coupling_conds_fwd, branch_cond_fwd, branch_cond_bwd)
¶
Evaluate the vectorfield of the nerve equation.
Source code in jaxley/solver_voltage.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
|