elicit.initialization module

elicit.initialization module#

elicit.initialization.init_method(seed, hyppar, n_samples, method, mean, radius, parameters)[source]#

Initialize multivariate normal prior over hyperparameter values

Parameters:
n_hypparamint

Number of hyperparameters.

n_samplesint

number of warmup iterations.

Returns:
mvdisttf.tensor

samples from the multivariate prior (shape=(n_warm_up, n_hyperparameters).

elicit.initialization.initialization_phase(expert_elicited_statistics, initializer, parameters, trainer, model, targets, network, expert)[source]#

For the method “parametric_prior” it might be helpful to run different initializations before the actual training starts in order to find a ‘good’ set of initial values. For this purpose the burnin phase can be used. It rans multiple initializations and computes for each the respective loss value. At the end that set of initial values is chosen which leads to the smallest loss.

Parameters:
expert_elicited_statisticsdict

dictionary with expert elicited statistics.

one_forward_simulationcallable

one forward simulation from prior samples to model-simulated elicited statistics.

compute_losscallable

wrapper for loss computation from loss components to (weighted) total loss.

global_dictdict

global dictionary with all user input specifications.

Returns:
loss_listlist

list containing the loss values for each set of initial values.

init_var_listlist

set of initial values for each run.

elicit.initialization.pre_training(expert_elicited_statistics, initializer, parameters, trainer, model, targets, network, expert)[source]#
elicit.initialization.uniform(radius: list = 1.0, mean: list = 0.0, hyper: list = None)[source]#

Specification of uniform distribution used for drawing initial values for each hyperparameter. Initial values are drawn from a uniform distribution ranging from mean-radius to mean+radius.

Parameters:
radiusfloat or list

Initial values are drawn from a uniform distribution ranging from mean-radius to mean+radius. If a float is provided the same setting will be used for all hyperparameters. If different settings per hyperparameter are required a list of length equal to the number of hyperparameters should be provided. The order of values should be equivalent to the order of hyperparameter names provided in hyper. The default is 1..

meanfloat or list

Initial values are drawn from a uniform distribution ranging from mean-radius to mean+radius. If a float is provided the same setting will be used for all hyperparameters. If different settings per hyperparameter are required a list of length equal to the number of hyperparameters should be provided. The order of values should be equivalent to the order of hyperparameter names provided in hyper. The default is 0..

hyperNone or list, optional

List of hyperparameter names as specified in hyper(). The values provided in radius and mean should follow the order of hyperparameters indicated in this list. If a float is passed to radius and mean this argument is not necessary. The default is None.

Returns:
init_dictdict

Dictionary with all seetings of the uniform distribution used for initializing the hyperparameter values.