hnn_core.optimization.optimize_evoked¶
- hnn_core.optimization.optimize_evoked(net, tstop, n_trials, target_dpl, initial_dpl, maxiter=50, timing_range_multiplier=3.0, sigma_range_multiplier=50.0, synweight_range_multiplier=500.0, decay_multiplier=1.6, scale_factor=1.0, smooth_window_len=None, dt=0.025, which_drives='all', return_rmse=False)[source]¶
Optimize drives to generate evoked response.
- Parameters
- netNetwork instance
An instance of the Network object with attached evoked drives. Timing and synaptic weight parameters will be optimized for each attached evoked drive. Note that no new drives will be created or old drives destroyed.
- tstopfloat
The simulation stop time (ms).
- n_trialsint
The number of trials to simulate.
- target_dplinstance of Dipole
The target experimental dipole.
- initial_dplinstance of Dipole
The initial dipole to start the optimization.
- maxiterint
The maximum number of simulations to run for optimizing one “chunk”.
- timing_range_multiplierfloat
The scale of timing values to sweep over.
- sigma_range_multiplierfloat
The scale of sigma values to sweep over.
- synweight_range_multiplierfloat
The scale of input synaptic weights to sweep over.
- decay_multiplierfloat
The decay multiplier.
- scale_factorfloat
Scales the simulated dipoles by scale_factor to match target_dpl.
- smooth_window_lenint
The length of the hamming window (in samples) to smooth the simulated dipole waveform in each optimization step.
- dtfloat
The integration time step (ms) of h.CVode during simulation.
- which_drives: ‘all’ or list
Evoked drives to optimize. If ‘all’, will opimize all evoked drives. If a subset list of evoked drives, will optimize only the evoked drives in the list.
- return_rmsebool
Returns list of unweighted RMSEs between the simulated and experimental dipole waveforms for each optimization step
- Returns
- netNetwork instance
An instance of the Network object with the optimized configuration of attached drives.
- iter_avg_rmselist of float
Unweighted RMSE between data in dpl and exp_dpl for each iteration. Returned only if return_rmse is True
Notes
This optimization protocol utilizes the Constrained Optimization By Linear Approximation (COBYLA) method: https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.fmin_cobyla.html # noqa