hnn_core.optimization.Optimizer

class hnn_core.optimization.Optimizer(initial_net, tstop, constraints, set_params, solver='bayesian', obj_fun='dipole_rmse', max_iter=200)[source]

Methods

fit(**obj_fun_kwargs)

Runs optimization routine.

plot_convergence([ax, show])

Convergence plot.

__repr__()[source]

Return repr(self).

fit(**obj_fun_kwargs)[source]

Runs optimization routine.

Parameters:
targetinstance of Dipole (if obj_fun=’dipole_rmse’)

A dipole object with experimental data.

f_bandslist of tuples (if obj_fun=’maximize_psd’)

Lower and higher limit for each frequency band.

relative_bandpowertuple (if obj_fun=’maximize_psd’)

Weight for each frequency band.

scale_factorfloat, optional

The dipole scale factor.

smooth_window_lenfloat, optional

The smooth window length.

plot_convergence(ax=None, show=True)[source]

Convergence plot.

Parameters:
axinstance of matplotlib figure, optional

The matplotlib axis. The default is None.

showbool

If True, show the figure. The default is True.

Returns:
figinstance of plt.fig

The matplotlib figure handle.

Examples using hnn_core.optimization.Optimizer

05. Optimize simulated evoked response parameters

05. Optimize simulated evoked response parameters

08. Optimize simulated rhythmic responses

08. Optimize simulated rhythmic responses