- filenameThe name of the file which will be associated with the saved/loaded data.
C++ Type:FileName
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
Controllable:No
Description:The SurrogateTrainer object. If this is specified the trainer data is automatically gathered and available in this SurrogateModel object.
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:
where is the training point closest to the input point , is the array of sample points from the training data, and is the number of columns in the sampler. The evaluate
function then returns the full model result associated with .
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<<<{"href": "../../syntax/Surrogates/index.html"}>>>]
[surrogate]
type = NearestPointSurrogate<<<{"description": "Surrogate that evaluates the value from the nearest point from data in [NearestPointTrainer.md]", "href": "NearestPointSurrogate.html"}>>>
filename<<<{"description": "The name of the file which will be associated with the saved/loaded data."}>>> = '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<<<{"href": "../../syntax/Samplers/index.html"}>>>]
[test]
type = CartesianProduct<<<{"description": "Provides complete Cartesian product for the supplied variables.", "href": "../samplers/CartesianProductSampler.html"}>>>
linear_space_items<<<{"description": "A list of triplets, each item should include the min, step size, and number of steps."}>>> = '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<<<{"href": "../../syntax/Reporters/index.html"}>>>]
[results]
type = EvaluateSurrogate<<<{"description": "Tool for sampling surrogate models.", "href": "../reporters/EvaluateSurrogate.html"}>>>
model<<<{"description": "Name of surrogate models."}>>> = surrogate
sampler<<<{"description": "Sampler to use for evaluating surrogate models."}>>> = test
parallel_type<<<{"description": "This parameter will determine how the stochastic data is gathered. It is common for outputting purposes that this parameter be set to ROOT, otherwise, many files will be produced showing the values on each processor. However, if there are lot of samples, gathering on root may be memory restrictive."}>>> = ROOT
execute_on<<<{"description": "The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html."}>>> = final
[]
[]
(contrib/moose/modules/stochastic_tools/test/tests/surrogates/nearest_point/evaluate.i)Input Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
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
Controllable:No
Description:Set the enabled status of the MooseObject.