NearestPointSurrogate

Surrogate that evaluates the value from the nearest point from data in NearestPointTrainer

Overview

The NearestPointSurrogate is arguably the simplest surrogate model that can be implemented. First, the surrogate is trained by collecting sample points and results from the full model. The surrogate's evaluate function then takes in a point and finds the training point that has the minimum Euclidean distance:

xmin=arg minxX(d=1D(xdxin,d)2)\vec{x}_{\min} = \argmin_{\vec{x}\in\mathbf{X}}\left(\sum_{d=1}^{D}(x_d - x_{\mathrm{in},d})^2\right)

where xmin\vec{x}_{\min} is the training point closest to the input point xin\vec{x}_{\mathrm{in}}, X\mathbf{X} is the array of sample points from the training data, and DD is the number of columns in the sampler. The evaluate function then returns the full model result associated with xmin\vec{x}_{\min}.

Example Input File Syntax

See NearestPointTrainer for details regarding the training phase of the surrogate. The surrogate model first loads the data from the training run:

[Surrogates]
  [surrogate]
    type = NearestPointSurrogate
    filename = 'train_out_train.rd'
  []
[]
(contrib/moose/modules/stochastic_tools/test/tests/surrogates/nearest_point/evaluate.i)

A sampler is created to create sample points:

[Samplers]
  [test]
    type = CartesianProduct
    linear_space_items = '0.25 1 10
                          0.25 1 10
                          0.25 1 10'
  []
[]
(contrib/moose/modules/stochastic_tools/test/tests/surrogates/nearest_point/evaluate.i)

A reporter is then used to evaluate the surrogate model with the points taken from the sampler:

[Reporters]
  [results]
    type = EvaluateSurrogate
    model = surrogate
    sampler = test
    parallel_type = ROOT
    execute_on = final
  []
[]
(contrib/moose/modules/stochastic_tools/test/tests/surrogates/nearest_point/evaluate.i)

Input Parameters

  • filenameThe name of the file which will be associated with the saved/loaded data.

    C++ Type:FileName

    Unit:(no unit assumed)

    Controllable:No

    Description:The name of the file which will be associated with the saved/loaded data.

  • trainerThe SurrogateTrainer object. If this is specified the trainer data is automatically gathered and available in this SurrogateModel object.

    C++ Type:UserObjectName

    Unit:(no unit assumed)

    Controllable:No

    Description:The SurrogateTrainer object. If this is specified the trainer data is automatically gathered and available in this SurrogateModel object.

Optional Parameters

  • control_tagsAdds user-defined labels for accessing object parameters via control logic.

    C++ Type:std::vector<std::string>

    Unit:(no unit assumed)

    Controllable:No

    Description:Adds user-defined labels for accessing object parameters via control logic.

  • enableTrueSet the enabled status of the MooseObject.

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Set the enabled status of the MooseObject.

Advanced Parameters