- length_factorLength Factor to use for Covariance Kernel
C++ Type:std::vector<double>
Controllable:No
Description:Length Factor to use for Covariance Kernel
- noise_variance0Noise Variance ($\sigma_n^2$) to use for kernel calculation.
Default:0
C++ Type:double
Controllable:No
Description:Noise Variance ($\sigma_n^2$) to use for kernel calculation.
- signal_varianceSignal Variance ($\sigma_f^2$) to use for kernel calculation.
C++ Type:double
Controllable:No
Description:Signal Variance ($\sigma_f^2$) to use for kernel calculation.
SquaredExponentialCovariance
Squared Exponential covariance function.
Overview
A widely used, general purpose isotropic covariance function is
is a scaled distance based on the length factor , defined as
Hyperparameters
Variable | Domain | Description |
---|---|---|
Length factors corresponding to input parameters* | ||
Signal variance* | ||
Noise variance* |
*See the Gaussian Process Trainer documentation for more in depth explanation of , , and hyperparameters.
Example Input File Syntax
[Covariance]
[covar]
type = SquaredExponentialCovariance
signal_variance = 1 #Use a signal variance of 1 in the kernel
noise_variance = 1e-6 #A small amount of noise can help with numerical stability
length_factor = '0.38971 0.38971' #Select a length factor for each parameter (k and q)
[]
[]
(modules/stochastic_tools/test/tests/surrogates/gaussian_process/GP_squared_exponential.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.
Advanced Parameters
Input Files
- (modules/stochastic_tools/examples/surrogates/gaussian_process/GP_normal_mc.i)
- (modules/stochastic_tools/examples/surrogates/cross_validation/all_trainers_uniform_cv.i)
- (modules/stochastic_tools/test/tests/surrogates/gaussian_process/GP_squared_exponential_tuned.i)
- (modules/stochastic_tools/examples/surrogates/gaussian_process/gaussian_process_uniform_2D_tuned.i)
- (modules/stochastic_tools/test/tests/reporters/ActiveLearningGP/main_tao.i)
- (modules/stochastic_tools/test/tests/surrogates/gaussian_process/GP_squared_exponential_tuned_adam.i)
- (modules/stochastic_tools/test/tests/reporters/BFActiveLearning/main_adam.i)
- (modules/stochastic_tools/test/tests/reporters/ActiveLearningGP/main_adam.i)
- (modules/stochastic_tools/examples/surrogates/gaussian_process/gaussian_process_uniform_1D.i)
- (modules/stochastic_tools/examples/surrogates/gaussian_process/gaussian_process_uniform_2D.i)
- (modules/stochastic_tools/test/tests/reporters/AISActiveLearning/ais_al.i)
- (modules/stochastic_tools/test/tests/surrogates/gaussian_process/GP_squared_exponential_training.i)
- (modules/stochastic_tools/examples/surrogates/gaussian_process/gaussian_process_uniform_1D_tuned.i)
- (modules/stochastic_tools/test/tests/surrogates/gaussian_process/GP_squared_exponential.i)
(modules/stochastic_tools/test/tests/surrogates/gaussian_process/GP_squared_exponential.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Uniform
lower_bound = 1
upper_bound = 10
[]
[q_dist]
type = Uniform
lower_bound = 9000
upper_bound = 11000
[]
[]
[Samplers]
[train_sample]
type = MonteCarlo
num_rows = 10
distributions = 'k_dist q_dist'
execute_on = PRE_MULTIAPP_SETUP
[]
[test_sample]
type = MonteCarlo
num_rows = 100
distributions = 'k_dist q_dist'
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = train_sample
[]
[]
[Controls]
[cmdline]
type = MultiAppSamplerControl
multi_app = sub
sampler = train_sample
param_names = 'Materials/conductivity/prop_values Kernels/source/value'
[]
[]
[Transfers]
[data]
type = SamplerReporterTransfer
from_multi_app = sub
sampler = train_sample
stochastic_reporter = results
from_reporter = 'avg/value'
[]
[]
[Reporters]
[results]
type = StochasticReporter
parallel_type = ROOT
[]
[samp_avg]
type = EvaluateSurrogate
model = GP_avg
sampler = test_sample
evaluate_std = 'true'
parallel_type = ROOT
execute_on = final
[]
[train_avg]
type = EvaluateSurrogate
model = GP_avg
sampler = train_sample
evaluate_std = 'true'
parallel_type = ROOT
execute_on = final
[]
[]
[VectorPostprocessors]
[hyperparams]
type = GaussianProcessData
gp_name = 'GP_avg'
execute_on = final
[]
[]
[Trainers]
[GP_avg_trainer]
type = GaussianProcessTrainer
execute_on = timestep_end
covariance_function = 'covar' #Choose a squared exponential for the kernel
standardize_params = 'true' #Center and scale the training params
standardize_data = 'true' #Center and scale the training data
sampler = train_sample
response = results/data:avg:value
[]
[]
[Surrogates]
[GP_avg]
type = GaussianProcess
trainer = GP_avg_trainer
[]
[]
[Covariance]
[covar]
type=SquaredExponentialCovariance
signal_variance = 1 #Use a signal variance of 1 in the kernel
noise_variance = 1e-6 #A small amount of noise can help with numerical stability
length_factor = '0.38971 0.38971' #Select a length factor for each parameter (k and q)
[]
[]
[Outputs]
[out]
type = CSV
execute_on = FINAL
[]
[]
(modules/stochastic_tools/examples/surrogates/gaussian_process/GP_normal_mc.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Uniform
lower_bound = 0
upper_bound = 20
[]
[q_dist]
type = Uniform
lower_bound = 7000
upper_bound = 13000
[]
[L_dist]
type = Uniform
lower_bound = 0.0
upper_bound = 0.1
[]
[Tinf_dist]
type = Uniform
lower_bound = 270
upper_bound = 330
[]
[]
[Samplers]
[sample]
type = MonteCarlo
num_rows = 500
distributions = 'k_dist q_dist L_dist Tinf_dist'
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = sample
[]
[]
[Controls]
[cmdline]
type = MultiAppSamplerControl
multi_app = sub
sampler = sample
param_names = 'Materials/conductivity/prop_values Kernels/source/value Mesh/xmax BCs/right/value'
[]
[]
[Transfers]
[data]
type = SamplerReporterTransfer
from_multi_app = sub
sampler = sample
stochastic_reporter = results
from_reporter = 'avg/value'
[]
[]
[Reporters]
[results]
type = StochasticReporter
[]
[]
[Trainers]
[GP_avg]
type = GaussianProcessTrainer
execute_on = timestep_end
covariance_function = 'rbf'
standardize_params = 'true' #Center and scale the training params
standardize_data = 'true' #Center and scale the training data
sampler = sample
response = results/data:avg:value
tune_parameters = ' signal_variance length_factor'
tuning_algorithm = 'adam'
tuning_min = ' 1e-9 1e-3'
tuning_max = ' 100 100'
iter_adam = 200
learning_rate_adam = 0.005
[]
[]
[Covariance]
[rbf]
type=SquaredExponentialCovariance
noise_variance = 1e-3 #A small amount of noise can help with numerical stability
signal_variance = 1
length_factor = '0.038971 0.038971 0.038971 0.038971' #Select a length factor for each parameter
[]
[]
[Outputs]
file_base = GP_training_normal
[out]
type = SurrogateTrainerOutput
trainers = 'GP_avg'
execute_on = FINAL
[]
[]
(modules/stochastic_tools/examples/surrogates/cross_validation/all_trainers_uniform_cv.i)
[StochasticTools]
[]
[GlobalParams]
sampler = cv_sampler
response = results/response_data:max:value
cv_type = "k_fold"
cv_splits = 5
cv_n_trials = 100
[]
[Distributions]
[k_dist]
type = Uniform
lower_bound = 1
upper_bound = 10
[]
[q_dist]
type = Uniform
lower_bound = 9000
upper_bound = 11000
[]
[L_dist]
type = Uniform
lower_bound = 0.01
upper_bound = 0.05
[]
[Tinf_dist]
type = Uniform
lower_bound = 290
upper_bound = 310
[]
[]
[Samplers]
[cv_sampler]
type = LatinHypercube
distributions = 'k_dist q_dist L_dist Tinf_dist'
num_rows = 1000
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[MultiApps]
[cv_sub]
type = SamplerFullSolveMultiApp
input_files = all_sub.i
mode = batch-reset
[]
[]
[Controls]
[pr_cmdline]
type = MultiAppSamplerControl
multi_app = cv_sub
param_names = 'Materials/conductivity/prop_values Kernels/source/value Mesh/xmax BCs/right/value'
[]
[]
[Transfers]
[response_data]
type = SamplerReporterTransfer
from_multi_app = cv_sub
stochastic_reporter = results
from_reporter = 'max/value'
[]
[]
[Reporters]
[results]
type = StochasticReporter
outputs = none
[]
[cv_scores]
type = CrossValidationScores
models = 'pr_surr pc_surr np_surr gp_surr ann_surr'
execute_on = FINAL
[]
[]
[Trainers]
[pr_max]
type = PolynomialRegressionTrainer
regression_type = "ols"
max_degree = 3
cv_surrogate = "pr_surr"
execute_on = timestep_end
[]
[pc_max]
type = PolynomialChaosTrainer
order = 3
distributions = "k_dist q_dist L_dist Tinf_dist"
cv_surrogate = "pc_surr"
execute_on = timestep_end
[]
[np_max]
type = NearestPointTrainer
cv_surrogate = "np_surr"
execute_on = timestep_end
[]
[gp_max]
type = GaussianProcessTrainer
covariance_function = 'rbf'
standardize_params = 'true'
standardize_data = 'true'
cv_surrogate = "gp_surr"
execute_on = timestep_end
[]
[ann_max]
type = LibtorchANNTrainer
num_epochs = 100
num_batches = 5
num_neurons_per_layer = '64'
learning_rate = 1e-2
rel_loss_tol = 1e-4
filename = mynet.pt
read_from_file = false
print_epoch_loss = 0
activation_function = 'relu'
cv_surrogate = "ann_surr"
standardize_input = false
standardize_output = false
[]
[]
[Covariance]
[rbf]
type = SquaredExponentialCovariance
noise_variance = 3.79e-6
signal_variance = 1 #Use a signal variance of 1 in the kernel
length_factor = '5.34471 1.41191 5.90721 2.83723' #Select a length factor for each parameter
[]
[]
[Surrogates]
[pr_surr]
type = PolynomialRegressionSurrogate
trainer = pr_max
[]
[pc_surr]
type = PolynomialChaos
trainer = pc_max
[]
[np_surr]
type = NearestPointSurrogate
trainer = np_max
[]
[gp_surr]
type = GaussianProcess
trainer = gp_max
[]
[ann_surr]
type = LibtorchANNSurrogate
trainer = ann_max
[]
[]
[Outputs]
[out]
type = JSON
execute_on = FINAL
[]
[]
(modules/stochastic_tools/test/tests/surrogates/gaussian_process/GP_squared_exponential_tuned.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Uniform
lower_bound = 1
upper_bound = 10
[]
[q_dist]
type = Uniform
lower_bound = 9000
upper_bound = 11000
[]
[]
[Samplers]
[train_sample]
type = MonteCarlo
num_rows = 10
distributions = 'k_dist q_dist'
execute_on = PRE_MULTIAPP_SETUP
[]
[test_sample]
type = MonteCarlo
num_rows = 100
distributions = 'k_dist q_dist'
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = train_sample
[]
[]
[Controls]
[cmdline]
type = MultiAppSamplerControl
multi_app = sub
sampler = train_sample
param_names = 'Materials/conductivity/prop_values Kernels/source/value'
[]
[]
[Transfers]
[data]
type = SamplerReporterTransfer
from_multi_app = sub
sampler = train_sample
stochastic_reporter = results
from_reporter = 'avg/value'
[]
[]
[Reporters]
[results]
type = StochasticReporter
parallel_type = ROOT
[]
[samp_avg]
type = EvaluateSurrogate
model = GP_avg
sampler = test_sample
evaluate_std = 'true'
parallel_type = ROOT
execute_on = final
[]
[train_avg]
type = EvaluateSurrogate
model = GP_avg
sampler = train_sample
evaluate_std = 'true'
parallel_type = ROOT
execute_on = final
[]
[]
[VectorPostprocessors]
[hyperparams]
type = GaussianProcessData
gp_name = 'GP_avg'
execute_on = final
[]
[]
[Trainers]
[GP_avg_trainer]
type = GaussianProcessTrainer
execute_on = timestep_end
covariance_function = 'covar' #Choose a squared exponential for the kernel
standardize_params = 'true' #Center and scale the training params
standardize_data = 'true' #Center and scale the training data
sampler = train_sample
response = results/data:avg:value
tao_options = '-tao_bncg_type ssml_bfgs'
tune_parameters = ' signal_variance length_factor'
tuning_min = ' 1e-9 1e-9'
tuning_max = ' 1e16 1e16'
tuning_algorithm = 'tao'
show_optimization_details = true
[]
[]
[Surrogates]
[GP_avg]
type = GaussianProcess
trainer = GP_avg_trainer
[]
[]
[Covariance]
[covar]
type=SquaredExponentialCovariance
signal_variance = 1 #Use a signal variance of 1 in the kernel
noise_variance = 1e-3 #A small amount of noise can help with numerical stability
length_factor = '0.38971 0.38971' #Select a length factor for each parameter (k and q)
[]
[]
[Outputs]
[out]
type = CSV
execute_on = FINAL
[]
[]
(modules/stochastic_tools/examples/surrogates/gaussian_process/gaussian_process_uniform_2D_tuned.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Uniform
lower_bound = 1
upper_bound = 10
[]
[q_dist]
type = Uniform
lower_bound = 9000
upper_bound = 11000
[]
[]
[Samplers]
[train_sample]
type = MonteCarlo
num_rows = 50
distributions = 'k_dist q_dist'
execute_on = PRE_MULTIAPP_SETUP
[]
[cart_sample]
type = CartesianProduct
linear_space_items = '1 0.09 100
9000 20 100 '
execute_on = initial
[]
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = train_sample
[]
[]
[Controls]
[cmdline]
type = MultiAppSamplerControl
multi_app = sub
sampler = train_sample
param_names = 'Materials/conductivity/prop_values Kernels/source/value'
[]
[]
[Transfers]
[data]
type = SamplerReporterTransfer
from_multi_app = sub
sampler = train_sample
stochastic_reporter = results
from_reporter = 'avg/value'
[]
[]
[Reporters]
[results]
type = StochasticReporter
[]
[]
[Trainers]
[GP_avg_trainer]
type = GaussianProcessTrainer
execute_on = timestep_end
covariance_function = 'rbf'
standardize_params = 'true' #Center and scale the training params
standardize_data = 'true' #Center and scale the training data
tao_options = '-tao_bncg_type kd'
sampler = train_sample
response = results/data:avg:value
tune_parameters = ' signal_variance length_factor'
tuning_min = ' 1e-9 1e-9'
tuning_max = ' 1e16 1e16'
tuning_algorithm = 'tao'
[]
[]
[Covariance]
[rbf]
type=SquaredExponentialCovariance
signal_variance = 1 #Use a signal variance of 1 in the kernel
noise_variance = 1e-3 #A small amount of noise can help with numerical stability
length_factor = '0.38971 0.38971' #Select a length factor for each parameter (k and q)
[]
[]
[Surrogates]
[GP_avg]
type = GaussianProcess
trainer = 'GP_avg_trainer'
[]
[]
[Reporters]
[train_avg]
type = EvaluateSurrogate
model = GP_avg
sampler = train_sample
evaluate_std = 'true'
parallel_type = ROOT
execute_on = final
[]
[cart_avg]
type = EvaluateSurrogate
model = GP_avg
sampler = cart_sample
evaluate_std = 'true'
parallel_type = ROOT
execute_on = final
[]
[]
[VectorPostprocessors]
[hyperparams]
type = GaussianProcessData
gp_name = 'GP_avg'
execute_on = final
[]
[]
[Outputs]
[out]
type = CSV
execute_on = FINAL
[]
[]
(modules/stochastic_tools/test/tests/reporters/ActiveLearningGP/main_tao.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Uniform
lower_bound = 5
upper_bound = 20
[]
[q_dist]
type = Uniform
lower_bound = 7000
upper_bound = 13000
[]
[Tinf_dist]
type = Uniform
lower_bound = 250
upper_bound = 350
[]
[]
[Samplers]
[mc]
type = ActiveLearningMonteCarloSampler
num_batch = 1
distributions = 'k_dist q_dist Tinf_dist'
flag_sample = 'conditional/flag_sample'
seed = 12
num_samples = 20
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
sampler = mc
input_files = 'sub.i'
mode = batch-reset
should_run_reporter = conditional/need_sample
execute_on = TIMESTEP_END
[]
[]
[Transfers]
[sub]
type = SamplerParameterTransfer
to_multi_app = sub
sampler = mc
parameters = 'Materials/conductivity/prop_values Kernels/source/value BCs/right/value'
to_control = 'stochastic'
check_multiapp_execute_on = false
[]
[reporter_transfer]
type = SamplerReporterTransfer
from_reporter = 'avg/value'
stochastic_reporter = 'conditional'
from_multi_app = sub
sampler = mc
[]
[]
[Reporters]
[conditional]
type = ActiveLearningGPDecision
sampler = mc
parallel_type = ROOT
execute_on = 'initial timestep_begin'
flag_sample = 'flag_sample'
inputs = 'inputs'
gp_mean = 'gp_mean'
gp_std = 'gp_std'
n_train = 6
al_gp = GP_al_trainer
gp_evaluator = GP_eval
learning_function = 'Ufunction'
learning_function_parameter = 349.345
learning_function_threshold = 2.0
[]
[]
[Trainers]
[GP_al_trainer]
type = ActiveLearningGaussianProcess
covariance_function = 'covar'
standardize_params = 'true'
standardize_data = 'true'
tune_parameters = 'signal_variance length_factor'
tao_options = '-tao_bncg_type ssml_bfgs'
tuning_min = ' 1e-9 1e-9'
tuning_max = ' 1e16 1e16'
tuning_algorithm = 'tao'
# show_optimization_details = true
[]
[]
[Surrogates]
[GP_eval]
type = GaussianProcess
trainer = GP_al_trainer
[]
[]
[Covariance]
[covar]
type = SquaredExponentialCovariance
signal_variance = 1.0
noise_variance = 1e-3
length_factor = '1.0 1.0 1.0'
[]
[]
[Executioner]
type = Transient
[]
[Outputs]
# perf_graph = true
file_base = 'ufunction_tao'
[out]
type = JSON
execute_system_information_on = none
[]
[]
(modules/stochastic_tools/test/tests/surrogates/gaussian_process/GP_squared_exponential_tuned_adam.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Uniform
lower_bound = 1
upper_bound = 10
[]
[q_dist]
type = Uniform
lower_bound = 9000
upper_bound = 11000
[]
[]
[Samplers]
[train_sample]
type = MonteCarlo
num_rows = 20
distributions = 'k_dist q_dist'
execute_on = PRE_MULTIAPP_SETUP
seed = 100
[]
[test_sample]
type = MonteCarlo
num_rows = 100
distributions = 'k_dist q_dist'
execute_on = PRE_MULTIAPP_SETUP
seed = 100
[]
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = train_sample
[]
[]
[Controls]
[cmdline]
type = MultiAppSamplerControl
multi_app = sub
sampler = train_sample
param_names = 'Materials/conductivity/prop_values Kernels/source/value'
[]
[]
[Transfers]
[data]
type = SamplerReporterTransfer
from_multi_app = sub
sampler = train_sample
stochastic_reporter = results
from_reporter = 'avg/value'
[]
[]
[Reporters]
[results]
type = StochasticReporter
parallel_type = ROOT
[]
[samp_avg]
type = EvaluateSurrogate
model = GP_avg
sampler = test_sample
evaluate_std = 'true'
parallel_type = ROOT
execute_on = final
[]
[train_avg]
type = EvaluateSurrogate
model = GP_avg
sampler = train_sample
evaluate_std = 'true'
parallel_type = ROOT
execute_on = final
[]
[]
[VectorPostprocessors]
[hyperparams]
type = GaussianProcessData
gp_name = 'GP_avg'
execute_on = final
[]
[data]
type = SamplerData
sampler = test_sample
execute_on = 'initial timestep_end'
[]
[]
[Trainers]
[GP_avg_trainer]
type = GaussianProcessTrainer
execute_on = timestep_end
covariance_function = 'covar' #Choose a squared exponential for the kernel
standardize_params = 'true' #Center and scale the training params
standardize_data = 'true' #Center and scale the training data
sampler = train_sample
response = results/data:avg:value
tune_parameters = 'signal_variance length_factor'
tuning_algorithm = 'adam'
iter_adam = 1000
batch_size = 20
learning_rate_adam = 0.005
[]
[]
[Surrogates]
[GP_avg]
type = GaussianProcess
trainer = GP_avg_trainer
[]
[]
[Covariance]
[covar]
type=SquaredExponentialCovariance
signal_variance = 1.0 #Use a signal variance of 1 in the kernel
noise_variance = 1e-6 #A small amount of noise can help with numerical stability
length_factor = '1.0 1.0' #Select a length factor for each parameter (k and q)
[]
[]
[Outputs]
[out]
type = CSV
execute_on = FINAL
[]
[]
(modules/stochastic_tools/test/tests/reporters/BFActiveLearning/main_adam.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Uniform
lower_bound = 5
upper_bound = 20
[]
[q_dist]
type = Uniform
lower_bound = 7000
upper_bound = 13000
[]
[Tinf_dist]
type = Uniform
lower_bound = 250
upper_bound = 350
[]
[]
[Samplers]
[mc]
type = ActiveLearningMonteCarloSampler
num_batch = 1
distributions = 'k_dist q_dist Tinf_dist'
flag_sample = 'conditional/flag_sample'
seed = 5
num_samples = 10
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[MultiApps]
[sub_lf]
type = SamplerFullSolveMultiApp
sampler = mc
input_files = 'sub_lf.i'
[]
[sub]
type = SamplerFullSolveMultiApp
sampler = mc
input_files = 'sub.i'
mode = batch-reset
should_run_reporter = conditional/need_sample
execute_on = TIMESTEP_END
[]
[]
[Transfers]
[sub]
type = SamplerParameterTransfer
to_multi_app = sub
sampler = mc
parameters = 'Materials/conductivity/prop_values Kernels/source/value BCs/right/value'
check_multiapp_execute_on = false
[]
[sub_lf]
type = SamplerParameterTransfer
to_multi_app = sub_lf
sampler = mc
parameters = 'Materials/conductivity/prop_values Kernels/source/value BCs/right/value'
check_multiapp_execute_on = false
[]
[reporter_transfer_lf]
type = SamplerReporterTransfer
from_reporter = 'avg/value'
stochastic_reporter = 'constant'
from_multi_app = sub_lf
sampler = mc
[]
[reporter_transfer]
type = SamplerReporterTransfer
from_reporter = 'avg/value'
stochastic_reporter = 'conditional'
from_multi_app = sub
sampler = mc
[]
[]
[Reporters]
[constant]
type = StochasticReporter
[]
[conditional]
type = BiFidelityActiveLearningGPDecision
sampler = mc
parallel_type = ROOT
execute_on = 'timestep_begin'
flag_sample = 'flag_sample'
inputs = 'inputs'
gp_mean = 'gp_mean'
gp_std = 'gp_std'
n_train = 8
al_gp = GP_al_trainer
gp_evaluator = GP_eval
learning_function='Ufunction'
learning_function_parameter = 349.345
learning_function_threshold=2.0
outputs_lf = constant/reporter_transfer_lf:avg:value
[]
[]
[Trainers]
[GP_al_trainer]
type = ActiveLearningGaussianProcess
covariance_function = 'covar'
standardize_params = 'true'
standardize_data = 'true'
tune_parameters = 'signal_variance length_factor'
tuning_algorithm = 'adam'
iter_adam = 5000
learning_rate_adam = 0.001
show_optimization_details = true
batch_size = 200
[]
[]
[Surrogates]
[GP_eval]
type = GaussianProcess
trainer = GP_al_trainer
[]
[]
[Covariance]
[covar]
type= SquaredExponentialCovariance
signal_variance = 1.0
noise_variance = 1e-8
length_factor = '1.0 1.0 1.0'
[]
[]
[Executioner]
type = Transient
[]
[Outputs]
file_base = 'single_proc_single_row_ufunction'
[out]
type = JSON
execute_system_information_on = none
[]
[]
(modules/stochastic_tools/test/tests/reporters/ActiveLearningGP/main_adam.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Uniform
lower_bound = 5
upper_bound = 20
[]
[q_dist]
type = Uniform
lower_bound = 7000
upper_bound = 13000
[]
[Tinf_dist]
type = Uniform
lower_bound = 250
upper_bound = 350
[]
[]
[Samplers]
[mc]
type = ActiveLearningMonteCarloSampler
num_batch = 1
distributions = 'k_dist q_dist Tinf_dist'
flag_sample = 'conditional/flag_sample'
seed = 5
num_samples = 20
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
sampler = mc
input_files = 'sub.i'
mode = batch-reset
should_run_reporter = conditional/need_sample
execute_on = TIMESTEP_END
[]
[]
[Transfers]
[sub]
type = SamplerParameterTransfer
to_multi_app = sub
sampler = mc
parameters = 'Materials/conductivity/prop_values Kernels/source/value BCs/right/value'
to_control = 'stochastic'
check_multiapp_execute_on = false
[]
[reporter_transfer]
type = SamplerReporterTransfer
from_reporter = 'avg/value'
stochastic_reporter = 'conditional'
from_multi_app = sub
sampler = mc
[]
[]
[Reporters]
[conditional]
type = ActiveLearningGPDecision
sampler = mc
parallel_type = ROOT
execute_on = 'timestep_begin'
flag_sample = 'flag_sample'
inputs = 'inputs'
gp_mean = 'gp_mean'
gp_std = 'gp_std'
n_train = 6
al_gp = GP_al_trainer
gp_evaluator = GP_eval
learning_function = 'Ufunction'
learning_function_parameter = 349.345
learning_function_threshold = 2.0
[]
[]
[Trainers]
[GP_al_trainer]
type = ActiveLearningGaussianProcess
covariance_function = 'covar'
standardize_params = 'true'
standardize_data = 'true'
tune_parameters = 'signal_variance length_factor'
tuning_algorithm = 'adam'
iter_adam = 1000
learning_rate_adam = 0.005
# show_optimization_details = true
[]
[]
[Surrogates]
[GP_eval]
type = GaussianProcess
trainer = GP_al_trainer
[]
[]
[Covariance]
[covar]
type = SquaredExponentialCovariance
signal_variance = 1.0
noise_variance = 1e-4
length_factor = '1.0 1.0 1.0'
[]
[]
[Executioner]
type = Transient
[]
[Outputs]
file_base = 'single_proc_single_row_ufunction'
[out]
type = JSON
execute_system_information_on = none
[]
[]
(modules/stochastic_tools/examples/surrogates/gaussian_process/gaussian_process_uniform_1D.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Uniform
lower_bound = 1
upper_bound = 10
[]
[q_dist]
type = Uniform
lower_bound = 9000
upper_bound = 11000
[]
[L_dist]
type = Uniform
lower_bound = 0.01
upper_bound = 0.05
[]
[Tinf_dist]
type = Uniform
lower_bound = 290
upper_bound = 310
[]
[]
[Samplers]
[train_sample]
type = MonteCarlo
num_rows = 6
distributions = 'q_dist'
execute_on = PRE_MULTIAPP_SETUP
[]
[cart_sample]
type = CartesianProduct
linear_space_items = '9000 20 100'
execute_on = initial
[]
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = train_sample
[]
[]
[Controls]
[cmdline]
type = MultiAppSamplerControl
multi_app = sub
sampler = train_sample
param_names = 'Kernels/source/value'
[]
[]
[Transfers]
[data]
type = SamplerReporterTransfer
from_multi_app = sub
sampler = train_sample
stochastic_reporter = results
from_reporter = 'avg/value'
[]
[]
[Reporters]
[results]
type = StochasticReporter
[]
[cart_avg]
type = EvaluateSurrogate
model = gauss_process_avg
sampler = cart_sample
evaluate_std = 'true'
parallel_type = ROOT
execute_on = final
[]
[train_avg]
type = EvaluateSurrogate
model = gauss_process_avg
sampler = train_sample
evaluate_std = 'true'
parallel_type = ROOT
execute_on = final
[]
[]
[Trainers]
[GP_avg_trainer]
type = GaussianProcessTrainer
execute_on = timestep_end
sampler = train_sample
response = results/data:avg:value
covariance_function = 'rbf'
standardize_params = 'true' #Center and scale the training params
standardize_data = 'true' #Center and scale the training data
[]
[]
[Covariance]
[rbf]
type=SquaredExponentialCovariance
signal_variance = 1 #Use a signal variance of 1 in the kernel
noise_variance = 1e-3 #A small amount of noise can help with numerical stability
length_factor = '0.38971' #Select a length factor for each parameter (k and q)
[]
[]
[Surrogates]
[gauss_process_avg]
type = GaussianProcess
trainer = 'GP_avg_trainer'
[]
[]
[Outputs]
csv = true
execute_on = FINAL
[]
(modules/stochastic_tools/examples/surrogates/gaussian_process/gaussian_process_uniform_2D.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Uniform
lower_bound = 1
upper_bound = 10
[]
[q_dist]
type = Uniform
lower_bound = 9000
upper_bound = 11000
[]
[]
[Samplers]
[train_sample]
type = MonteCarlo
num_rows = 50
distributions = 'k_dist q_dist'
execute_on = PRE_MULTIAPP_SETUP
[]
[cart_sample]
type = CartesianProduct
linear_space_items = '1 0.09 100
9000 20 100 '
execute_on = initial
[]
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = train_sample
[]
[]
[Controls]
[cmdline]
type = MultiAppSamplerControl
multi_app = sub
sampler = train_sample
param_names = 'Materials/conductivity/prop_values Kernels/source/value'
[]
[]
[Transfers]
[data]
type = SamplerReporterTransfer
from_multi_app = sub
sampler = train_sample
stochastic_reporter = results
from_reporter = 'avg/value'
[]
[]
[Reporters]
[results]
type = StochasticReporter
[]
[train_avg]
type = EvaluateSurrogate
model = GP_avg
sampler = train_sample
evaluate_std = 'true'
parallel_type = ROOT
execute_on = final
[]
[cart_avg]
type = EvaluateSurrogate
model = GP_avg
sampler = cart_sample
evaluate_std = 'true'
parallel_type = ROOT
execute_on = final
[]
[]
[Trainers]
[GP_avg_trainer]
type = GaussianProcessTrainer
execute_on = timestep_end
covariance_function = 'rbf'
standardize_params = 'true' #Center and scale the training params
standardize_data = 'true' #Center and scale the training data
sampler = train_sample
response = results/data:avg:value
[]
[]
[Covariance]
[rbf]
type=SquaredExponentialCovariance
signal_variance = 1 #Use a signal variance of 1 in the kernel
noise_variance = 1e-6 #A small amount of noise can help with numerical stability
length_factor = '0.38971 0.38971' #Select a length factor for each parameter (k and q)
[]
[]
[Surrogates]
[GP_avg]
type = GaussianProcess
trainer = 'GP_avg_trainer'
[]
[]
[VectorPostprocessors]
[hyperparams]
type = GaussianProcessData
gp_name = 'GP_avg'
execute_on = final
[]
[]
[Outputs]
[out]
type = CSV
execute_on = FINAL
[]
[]
(modules/stochastic_tools/test/tests/reporters/AISActiveLearning/ais_al.i)
[StochasticTools]
[]
[Distributions]
[mu1]
type = Normal
mean = 0.0
standard_deviation = 0.5
[]
[mu2]
type = Normal
mean = 1
standard_deviation = 0.5
[]
[]
[Samplers]
[sample]
type = AISActiveLearning
distributions = 'mu1 mu2'
proposal_std = '1.0 1.0'
output_limit = 0.65
num_samples_train = 15
num_importance_sampling_steps = 5
std_factor = 0.9
initial_values = '-0.103 1.239'
inputs_reporter = 'adaptive_MC/inputs'
use_absolute_value = true
flag_sample = 'conditional/flag_sample'
seed = 9874
[]
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = sample
mode = batch-reset
should_run_reporter = conditional/need_sample
execute_on = TIMESTEP_END
[]
[]
[Transfers]
[param]
type = SamplerParameterTransfer
to_multi_app = sub
sampler = sample
parameters = 'BCs/left/value BCs/right/value'
to_control = 'stochastic'
[]
[reporter_transfer]
type = SamplerReporterTransfer
from_reporter = 'average/value'
stochastic_reporter = 'conditional'
from_multi_app = sub
sampler = sample
[]
[]
[Reporters]
[conditional]
type = ActiveLearningGPDecision
sampler = sample
parallel_type = ROOT
execute_on = 'initial timestep_begin'
flag_sample = 'flag_sample'
inputs = 'inputs'
gp_mean = 'gp_mean'
gp_std = 'gp_std'
n_train = 5
al_gp = GP_al_trainer
gp_evaluator = GP_eval
learning_function='Ufunction'
learning_function_parameter = 0.65
learning_function_threshold = 2.0
[]
[adaptive_MC]
type = AdaptiveMonteCarloDecision
output_value = conditional/gp_mean
inputs = 'inputs'
sampler = sample
gp_decision = conditional
[]
[ais_stats]
type = AdaptiveImportanceStats
output_value = conditional/gp_mean
sampler = sample
flag_sample = 'conditional/flag_sample'
[]
[]
[Trainers]
[GP_al_trainer]
type = ActiveLearningGaussianProcess
covariance_function = 'covar'
standardize_params = 'true'
standardize_data = 'true'
tune_parameters = 'signal_variance length_factor'
tuning_algorithm = 'adam'
iter_adam = 2000
learning_rate_adam = 0.005
# show_optimization_details = true
[]
[]
[Surrogates]
[GP_eval]
type = GaussianProcess
trainer = GP_al_trainer
[]
[]
[Covariance]
[covar]
type= SquaredExponentialCovariance
signal_variance = 1.0
noise_variance = 1e-8
length_factor = '1.0 1.0'
[]
[]
[Executioner]
type = Transient
[]
[Outputs]
file_base = 'ais_al'
[out]
type = JSON
execute_system_information_on = NONE
[]
[]
(modules/stochastic_tools/test/tests/surrogates/gaussian_process/GP_squared_exponential_training.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Uniform
lower_bound = 1
upper_bound = 10
[]
[q_dist]
type = Uniform
lower_bound = 9000
upper_bound = 11000
[]
[]
[Samplers]
[train_sample]
type = MonteCarlo
num_rows = 10
distributions = 'k_dist q_dist'
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = train_sample
[]
[]
[Controls]
[cmdline]
type = MultiAppSamplerControl
multi_app = sub
sampler = train_sample
param_names = 'Materials/conductivity/prop_values Kernels/source/value'
[]
[]
[Transfers]
[data]
type = SamplerReporterTransfer
from_multi_app = sub
sampler = train_sample
stochastic_reporter = results
from_reporter = 'avg/value'
[]
[]
[Reporters]
[results]
type = StochasticReporter
parallel_type = ROOT
[]
[]
[Trainers]
[GP_avg_trainer]
type = GaussianProcessTrainer
execute_on = timestep_end
covariance_function = 'covar' #Choose a squared exponential for the kernel
standardize_params = 'true' #Center and scale the training params
standardize_data = 'true' #Center and scale the training data
sampler = train_sample
response = results/data:avg:value
[]
[]
[Covariance]
[covar]
type=SquaredExponentialCovariance
signal_variance = 1 #Use a signal variance of 1 in the kernel
noise_variance = 1e-6 #A small amount of noise can help with numerical stability
length_factor = '0.38971 0.38971' #Select a length factor for each parameter (k and q)
[]
[]
[Outputs]
file_base = gauss_process_training
[out]
type = SurrogateTrainerOutput
trainers = 'GP_avg_trainer'
execute_on = FINAL
[]
[]
(modules/stochastic_tools/examples/surrogates/gaussian_process/gaussian_process_uniform_1D_tuned.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Uniform
lower_bound = 1
upper_bound = 10
[]
[q_dist]
type = Uniform
lower_bound = 9000
upper_bound = 11000
[]
[L_dist]
type = Uniform
lower_bound = 0.01
upper_bound = 0.05
[]
[Tinf_dist]
type = Uniform
lower_bound = 290
upper_bound = 310
[]
[]
[Samplers]
[train_sample]
type = MonteCarlo
num_rows = 6
distributions = 'q_dist'
execute_on = PRE_MULTIAPP_SETUP
[]
[cart_sample]
type = CartesianProduct
linear_space_items = '9000 20 100'
execute_on = initial
[]
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = train_sample
[]
[]
[Controls]
[cmdline]
type = MultiAppSamplerControl
multi_app = sub
sampler = train_sample
param_names = 'Kernels/source/value'
[]
[]
[Transfers]
[data]
type = SamplerReporterTransfer
from_multi_app = sub
sampler = train_sample
stochastic_reporter = results
from_reporter = 'avg/value'
[]
[]
[Reporters]
[results]
type = StochasticReporter
[]
[]
[Trainers]
[GP_avg_trainer]
type = GaussianProcessTrainer
execute_on = timestep_end
covariance_function = 'rbf'
standardize_params = 'true' #Center and scale the training params
standardize_data = 'true' #Center and scale the training data
sampler = train_sample
response = results/data:avg:value
tao_options = '-tao_bncg_type kd'
tune_parameters = ' signal_variance length_factor'
tuning_min = ' 1e-9 1e-9'
tuning_max = ' 1e16 1e16'
tuning_algorithm = 'tao'
[]
[]
[Covariance]
[rbf]
type=SquaredExponentialCovariance
signal_variance = 1 #Use a signal variance of 1 in the kernel
noise_variance = 1e-3 #A small amount of noise can help with numerical stability
length_factor = '0.38971' #Select a length factor for each parameter (k and q)
[]
[]
[Surrogates]
[gauss_process_avg]
type = GaussianProcess
trainer = 'GP_avg_trainer'
[]
[]
# # Computing statistics
[VectorPostprocessors]
[hyperparams]
type = GaussianProcessData
gp_name = 'gauss_process_avg'
execute_on = final
[]
[]
[Reporters]
[cart_avg]
type = EvaluateSurrogate
model = gauss_process_avg
sampler = cart_sample
evaluate_std = 'true'
parallel_type = ROOT
execute_on = final
[]
[train_avg]
type = EvaluateSurrogate
model = gauss_process_avg
sampler = train_sample
evaluate_std = 'true'
parallel_type = ROOT
execute_on = final
[]
[]
[Outputs]
csv = true
execute_on = FINAL
[]
(modules/stochastic_tools/test/tests/surrogates/gaussian_process/GP_squared_exponential.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Uniform
lower_bound = 1
upper_bound = 10
[]
[q_dist]
type = Uniform
lower_bound = 9000
upper_bound = 11000
[]
[]
[Samplers]
[train_sample]
type = MonteCarlo
num_rows = 10
distributions = 'k_dist q_dist'
execute_on = PRE_MULTIAPP_SETUP
[]
[test_sample]
type = MonteCarlo
num_rows = 100
distributions = 'k_dist q_dist'
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = train_sample
[]
[]
[Controls]
[cmdline]
type = MultiAppSamplerControl
multi_app = sub
sampler = train_sample
param_names = 'Materials/conductivity/prop_values Kernels/source/value'
[]
[]
[Transfers]
[data]
type = SamplerReporterTransfer
from_multi_app = sub
sampler = train_sample
stochastic_reporter = results
from_reporter = 'avg/value'
[]
[]
[Reporters]
[results]
type = StochasticReporter
parallel_type = ROOT
[]
[samp_avg]
type = EvaluateSurrogate
model = GP_avg
sampler = test_sample
evaluate_std = 'true'
parallel_type = ROOT
execute_on = final
[]
[train_avg]
type = EvaluateSurrogate
model = GP_avg
sampler = train_sample
evaluate_std = 'true'
parallel_type = ROOT
execute_on = final
[]
[]
[VectorPostprocessors]
[hyperparams]
type = GaussianProcessData
gp_name = 'GP_avg'
execute_on = final
[]
[]
[Trainers]
[GP_avg_trainer]
type = GaussianProcessTrainer
execute_on = timestep_end
covariance_function = 'covar' #Choose a squared exponential for the kernel
standardize_params = 'true' #Center and scale the training params
standardize_data = 'true' #Center and scale the training data
sampler = train_sample
response = results/data:avg:value
[]
[]
[Surrogates]
[GP_avg]
type = GaussianProcess
trainer = GP_avg_trainer
[]
[]
[Covariance]
[covar]
type=SquaredExponentialCovariance
signal_variance = 1 #Use a signal variance of 1 in the kernel
noise_variance = 1e-6 #A small amount of noise can help with numerical stability
length_factor = '0.38971 0.38971' #Select a length factor for each parameter (k and q)
[]
[]
[Outputs]
[out]
type = CSV
execute_on = FINAL
[]
[]