bayesvalidrox.surrogate_models.engine.Engine

class bayesvalidrox.surrogate_models.engine.Engine(MetaMod, Model, ExpDes)

Bases: object

__init__(MetaMod, Model, ExpDes)

Methods

__init__(MetaMod, Model, ExpDes)

eval_metamodel([samples, nsamples, ...])

Evaluates metamodel at the requested samples.

start_engine()

Do all the preparations that need to be run before the actual training

train_normal([parallel, verbose, save])

Trains surrogate on static samples only.

train_seq_design([parallel, verbose])

Starts the adaptive sequential design for refining the surrogate model by selecting training points in a sequential manner.

train_sequential([parallel, verbose])

Train the surrogate in a sequential manner.

eval_metamodel(samples=None, nsamples=None, sampling_method='random', return_samples=False, parallel=False)

Evaluates metamodel at the requested samples. One can also generate nsamples.

Parameters

samplesarray of shape (n_samples, n_params), optional

Samples to evaluate metamodel at. The default is None.

nsamplesint, optional

Number of samples to generate, if no samples is provided. The default is None.

sampling_methodstr, optional

Type of sampling, if no samples is provided. The default is ‘random’.

return_samplesbool, optional

Retun samples, if no samples is provided. The default is False.

parallelbool, optional

Set to true if the evaluations should be done in parallel. The default is False.

Returns

mean_preddict

Mean of the predictions.

std_preddict

Standard deviatioon of the predictions.

start_engine() None

Do all the preparations that need to be run before the actual training

Returns

None

train_normal(parallel=False, verbose=False, save=False) None

Trains surrogate on static samples only. Samples are taken from the experimental design and the specified model is run on them. Alternatively the samples can be read in from a provided hdf5 file.

Returns

None

train_seq_design(parallel=False, verbose=False)

Starts the adaptive sequential design for refining the surrogate model by selecting training points in a sequential manner.

Returns

MetaModelobject

Meta model object.

train_sequential(parallel=False, verbose=False) None

Train the surrogate in a sequential manner. First build and train evereything on the static samples, then iterate choosing more samples and refitting the surrogate on them.

Returns

None