https://mooseframework.inl.gov
UpperConfidenceBound.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "UpperConfidenceBound.h"
11 #include <cmath>
12 
13 registerMooseObject("StochasticToolsApp", UpperConfidenceBound);
14 
17 {
19  params.addClassDescription("Upper Confidence Bound acquisition function.");
20  params.addRangeCheckedParam<Real>(
21  "tuning", 1.0, "tuning > 0", "Tuning parameter to control exploration vs exploitation.");
22  return params;
23 }
24 
26  : ParallelAcquisitionFunctionBase(parameters), _tuning(getParam<Real>("tuning"))
27 {
28 }
29 
30 void
32  std::vector<Real> & acq,
33  const std::vector<Real> & gp_mean,
34  const std::vector<Real> & gp_std,
35  const std::vector<std::vector<Real>> & /*test_inputs*/,
36  const std::vector<std::vector<Real>> & /*train_inputs*/,
37  const std::vector<Real> & /*generic*/) const
38 {
39  for (unsigned int i = 0; i < gp_mean.size(); ++i)
40  acq[i] = gp_mean[i] + _tuning * gp_std[i];
41 }
static InputParameters validParams()
const Real & _tuning
Tuning parameter to control exploration vs exploitation.
All ParallelAcquisition functions should inherit from this class.
void computeAcquisitionInternal(std::vector< Real > &acq, const std::vector< Real > &gp_mean, const std::vector< Real > &gp_std, const std::vector< std::vector< Real >> &test_inputs, const std::vector< std::vector< Real >> &train_inputs, const std::vector< Real > &generic) const override
Implementation hook for derived classes (no size checks here).
UpperConfidenceBound(const InputParameters &parameters)
registerMooseObject("StochasticToolsApp", UpperConfidenceBound)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)