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

ActiveLearning

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.

update_data()[source]

Update the variables with the runner data.

abstract save(path)[source]

Save the AL model.

Parameters:

path (str) – Path where the model is saved.

save_intermediate(model_path=None, input_path=None, output_path=None)[source]
abstract plot()[source]

Plot the progress of the AL learning.

classmethod from_config(runner, variables, config, base_config)[source]

Instantiates an ActiveLearning object from the configuration parameters.

Parameters:
Returns:

AL instance.

Return type:

profit.al.active_learning.ActiveLearning