profit.al.simple_al
Module Contents
Classes
Simple active learning algorithm based on a surrogate model and an acquisition function to find next candidates. |
- class profit.al.simple_al.SimpleAL(runner, variables, surrogate, ntrain, nwarmup=base_defaults['nwarmup'], batch_size=base_defaults['batch_size'], acquisition_function=defaults['acquisition_function'], convergence_criterion=base_defaults['convergence_criterion'], nsearch=base_defaults['nsearch'], make_plot=base_defaults['make_plot'], searchtype=defaults['searchtype'])[source]
Bases:
profit.al.ActiveLearning
Simple active learning algorithm based on a surrogate model and an acquisition function to find next candidates.
- Parameters:
surrogate (profit.sur.Surrogate) – Surrogate used for fitting.
acquisition_function (str/profit.al.acquisition_functions.AcquisitionFunction) – Acquisition function used for selecting the next candidates.
- search_space
np.linspace for each AL input variable.
- Type:
dict[str, np.array]
- Xpred
Matrix of the candidate points built with np.meshgrid.
- Type:
np.array
- labels
- warmup(save_intermediate=base_defaults['save_intermediate'])[source]
To get data for active learning, sample initial points randomly.
- learn(resume_from=base_defaults['resume_from'], save_intermediate=base_defaults['save_intermediate'])[source]
Main loop for active learning.
- find_next_candidates()[source]
Find the next candidates using the acquisition function’s method find_next_candidates.
- Returns:
Next training points.
- Return type:
np.array
- 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: