neurotools.stats.gridsearch module
Hill-climbing grid search
- neurotools.stats.gridsearch.grid_search(pargrid, evaluate)[source]
Grid search hyperparameter optimization
- Parameters:
pargrid (list of arrays) – A list; Each element is a list of values for a given parameter to search over
evaluate (function) –
- Arguments:
- Parameters: Tuple
Parameters taken from the parameter search grid
- State: List of arrays
Saves initial conditions (optional, default None)
- Returns:
- state: the inferred model fit, in the form of a list
of floating-point numpy arrays, to be re-used as initial conditions for subsequent parameters.
- likelihood: float
Scalar summary of fit quality, higher is better
- info: object
Anything else you’d like to save
- Returns:
best – best index into parameter grid
pars – values of best parameters
results[best] – (state, likelihood, info) at best parameters. info is determined by the third element in the 3-tuple return-value of the evaluate function, passed by the user. state is also user-defined.
allresults – all other results