- responseReporter value of response results, can be vpp with
/ or sampler column with 'sampler/col_ '. C++ Type:ReporterName
Controllable:No
Description:Reporter value of response results, can be vpp with
/ or sampler column with 'sampler/col_ '. - samplerSampler used to create predictor and response data.
C++ Type:SamplerName
Controllable:No
Description:Sampler used to create predictor and response data.
NearestPointTrainer
Loops over and saves sample values for NearestPointSurrogate.
Overview
This trainer is meant to produce training data to be used with NearestPointSurrogate. The data saved (_sample_points
) is an array of the sample points and the results from the full model:
where is the point from the sampler at column and sample , is the result of the full model at sample , is the number of training samples, and is the number of sampler columns. NearestPointSurrogate then uses this array to find the closest point to the given input point and outputs the full model result.
Example Input File Syntax
A sampler is created to produce points for the training data:
[Samplers<<<{"href": "../../syntax/Samplers/index.html"}>>>]
[sample]
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 1 10
0 1 10
0 1 10'
[]
[]
(modules/stochastic_tools/test/tests/surrogates/nearest_point/train.i)The example full model is the GFunction
vector postprocessor, see SobolStatistics for more details. This vector postprocessor takes in the sampler and evaluates the function at the training points.
[VectorPostprocessors<<<{"href": "../../syntax/VectorPostprocessors/index.html"}>>>]
[values]
type = GFunction
sampler = sample
q_vector = '0 0 0'
execute_on = INITIAL
outputs = none
[]
[]
(modules/stochastic_tools/test/tests/surrogates/nearest_point/train.i)The trainer then takes in the data from the sampler and the results from the vector postprocessor to create the _sample_points
array:
[Trainers<<<{"href": "../../syntax/Trainers/index.html"}>>>]
[train]
type = NearestPointTrainer<<<{"description": "Loops over and saves sample values for [NearestPointSurrogate.md].", "href": "NearestPointTrainer.html"}>>>
sampler<<<{"description": "Sampler used to create predictor and response data."}>>> = sample
response<<<{"description": "Reporter value of response results, can be vpp with <vpp_name>/<vector_name> or sampler column with 'sampler/col_<index>'."}>>> = values/g_values
[]
[]
(modules/stochastic_tools/test/tests/surrogates/nearest_point/train.i)We then output the training data to file:
[Outputs<<<{"href": "../../syntax/Outputs/index.html"}>>>]
[out]
type = SurrogateTrainerOutput<<<{"description": "Output for trained surrogate model data.", "href": "../outputs/SurrogateTrainerOutput.html"}>>>
trainers<<<{"description": "A list of SurrogateTrainer objects to output."}>>> = 'train'
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
[]
[]
(modules/stochastic_tools/test/tests/surrogates/nearest_point/train.i)Input Parameters
- converged_reporterReporter value used to determine if a sample's multiapp solve converged.
C++ Type:ReporterName
Controllable:No
Description:Reporter value used to determine if a sample's multiapp solve converged.
- cv_n_trials1Number of repeated trials of cross-validation to perform.
Default:1
C++ Type:unsigned int
Controllable:No
Description:Number of repeated trials of cross-validation to perform.
- cv_seed4294967295Seed used to initialize random number generator for data splitting during cross validation.
Default:4294967295
C++ Type:unsigned int
Controllable:No
Description:Seed used to initialize random number generator for data splitting during cross validation.
- cv_splits10Number of splits (k) to use in k-fold cross-validation.
Default:10
C++ Type:unsigned int
Controllable:No
Description:Number of splits (k) to use in k-fold cross-validation.
- cv_surrogateName of Surrogate object used for model cross-validation.
C++ Type:UserObjectName
Controllable:No
Description:Name of Surrogate object used for model cross-validation.
- cv_typenoneCross-validation method to use for dataset. Options are 'none' or 'k_fold'.
Default:none
C++ Type:MooseEnum
Controllable:No
Description:Cross-validation method to use for dataset. Options are 'none' or 'k_fold'.
- 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.
- predictor_colsSampler columns used as the independent random variables, If 'predictors' and 'predictor_cols' are both empty, all sampler columns are used.
C++ Type:std::vector<unsigned int>
Controllable:No
Description:Sampler columns used as the independent random variables, If 'predictors' and 'predictor_cols' are both empty, all sampler columns are used.
- predictorsReporter values used as the independent random variables, If 'predictors' and 'predictor_cols' are both empty, all sampler columns are used.
C++ Type:std::vector<ReporterName>
Controllable:No
Description:Reporter values used as the independent random variables, If 'predictors' and 'predictor_cols' are both empty, all sampler columns are used.
- response_typerealResponse data type.
Default:real
C++ Type:MooseEnum
Controllable:No
Description:Response data type.
- skip_unconverged_samplesFalseTrue to skip samples where the multiapp did not converge, 'stochastic_reporter' is required to do this.
Default:False
C++ Type:bool
Controllable:No
Description:True to skip samples where the multiapp did not converge, 'stochastic_reporter' is required to do this.
Optional Parameters
- allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
Default:False
C++ Type:bool
Controllable:No
Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
- execute_onTIMESTEP_ENDThe 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.
Default:TIMESTEP_END
C++ Type:ExecFlagEnum
Controllable:No
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.
- execution_order_group0Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
Default:0
C++ Type:int
Controllable:No
Description:Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
- force_postauxFalseForces the UserObject to be executed in POSTAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in POSTAUX
- force_preauxFalseForces the UserObject to be executed in PREAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREAUX
- force_preicFalseForces the UserObject to be executed in PREIC during initial setup
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREIC during initial setup
Execution Scheduling 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:Yes
Description:Set the enabled status of the MooseObject.
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Unit:(no unit assumed)
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Material Property Retrieval Parameters
Input Files
- (modules/stochastic_tools/examples/surrogates/cross_validation/all_trainers_uniform_cv.i)
- (modules/stochastic_tools/examples/surrogates/nearest_point_training.i)
- (modules/stochastic_tools/test/tests/surrogates/nearest_point/train.i)
- (modules/stochastic_tools/examples/surrogates/combined/trans_diff_2d/trans_diff_trainer.i)
- (modules/stochastic_tools/test/tests/surrogates/nearest_point/predictor_response.i)
- (modules/stochastic_tools/test/tests/surrogates/nearest_point/np_vec.i)
- (modules/stochastic_tools/test/tests/surrogates/nearest_point/cartesian.i)