profit.al.mcmc_al
Module Contents
Classes
Markov-chain Monte-Carlo active learning algorithm. |
Attributes
- profit.al.mcmc_al.two = False
- class profit.al.mcmc_al.McmcAL(runner, variables, reference_data, ntrain, warmup_cycles=defaults['warmup_cycles'], nwarmup=base_defaults['nwarmup'], batch_size=base_defaults['batch_size'], target_acceptance_rate=defaults['target_acceptance_rate'], convergence_criterion=base_defaults['convergence_criterion'], nsearch=base_defaults['nsearch'], sigma_n=defaults['sigma_n'], make_plot=base_defaults['make_plot'], initial_points=defaults['initial_points'], save=defaults['save'], last_percent=defaults['last_percent'], delayed_acceptance=defaults['delayed_acceptance'])[source]
Bases:
profit.al.ActiveLearning
Markov-chain Monte-Carlo active learning algorithm.
- Parameters:
reference_data (np.ndarray) – Observed experimental data points. This is not the simulated model data!
warmup_cycles (int) – Number of warmup cycles with nwarmup iterations each.
target_acceptance_rate (float) – Target rate with which probability new points are accepted.
sigma_n (float) – Estimated standard deviation of the experimental data.
initial_points (list of float) – Starting points for the MCMC.
delayed_acceptancd (bool) – Whether to use delayed acceptance with a surrogate model for the likelihood.
- Xpred
Matrix of the candidate points built with np.meshgrid.
- Type:
np.ndarray
- dx
Distance between iterations in parameter space.
- Type:
np.ndarray
- ndim
Dimension of input parameters.
- Type:
int
- Xtrain
Array of sampled MCMC points.
- Type:
np.ndarray
- log_likelihood
Array of the log likelihood during training.
- Type:
np.ndarray
- accepted
Boolean array of accepted/rejected sample MCMC points.
- Type:
np.ndarray[bool]
- labels
- learn(resume_from=base_defaults['resume_from'], save_intermediate=base_defaults['save_intermediate'])[source]
Main loop for active learning.
- update_run(candidates)[source]
Run a batch of simulations with the new candidates.
- Parameters:
candidates (np.array) – Input points to run the simulation on.
- classmethod from_config(runner, variables, config, base_config)[source]
Instantiates an ActiveLearning object from the configuration parameters.
- Parameters:
runner (profit.run.runner.Runner) – Runner instance.
variables (profit.util.variable.VariableGroup) – Variables.
config (dict) – Only the ‘active_learning’ part of the base_config.
base_config (dict) – The whole configuration parameters.
- Returns:
AL instance.
- Return type: