profit.al.active_learning
For computationally expensive simulations or experiments it is crucial to get the most information out of every training point. This is not the case in the standard procedure of randomly selecting the training points. In order to get the most out of the least number of training points, the next point is inferred by calculating an acquisition function like the minimization of local variance or expected improvement.
Module Contents
Classes
Active learning base class. |
- class profit.al.active_learning.ActiveLearning(runner, variables, ntrain, nwarmup=defaults['nwarmup'], batch_size=defaults['batch_size'], convergence_criterion=defaults['convergence_criterion'], nsearch=defaults['nsearch'], make_plot=defaults['make_plot'])[source]
Bases:
profit.util.base_class.CustomABC
Active learning base class.
- Parameters:
runner (profit.run.Runner) – Runner to dynamically start runs.
variables (profit.util.variable.VariableGroup) – Variables.
ntrain (int) – Total number of training points.
nwarmup (int) – Number of warmup (random) initialization points.
batch_size (int) – Number of training samples learned in parallel.
convergence_criterion (float) – AL is stopped when the loss of the acquisition function is lower than this criterion. Not implemented yet.
nsearch (int) – Number of possible candidate points in each dimension.
make_plot (bool) – Flat indicating if the AL progress is plotted.
- krun
Current training cycle.
- Type:
int
- labels
- abstract warmup(save_intermediate=defaults['save_intermediate'])[source]
Warmup cycle before the actual learning starts.
- abstract learn(resume_from=defaults['resume_from'], save_intermediate=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.
- abstract save(path)[source]
Save the AL model.
- Parameters:
path (str) – Path where the model is saved.
- 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: