https://mooseframework.inl.gov
BayesianPosteriorTargeted.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 
11 #include <cmath>
12 
13 registerMooseObject("StochasticToolsApp", BayesianPosteriorTargeted);
14 
17 {
19  params.addClassDescription("Bayesian posterior targeted from El Gammal et al. 2023.");
20  return params;
21 }
22 
25 {
26 }
27 
28 void
30  std::vector<Real> & acq,
31  const std::vector<Real> & gp_mean,
32  const std::vector<Real> & gp_std,
33  const std::vector<std::vector<Real>> & test_inputs,
34  const std::vector<std::vector<Real>> & /*train_inputs*/,
35  const std::vector<Real> & /*generic*/) const
36 {
37  Real psi = std::pow(test_inputs[0].size(), -0.85);
38  for (unsigned int i = 0; i < test_inputs.size(); ++i)
39  {
40  acq[i] = std::exp(2.0 * psi * gp_mean[i]) * (std::exp(gp_std[i]) - 1.0);
41  if (std::isinf(acq[i]))
42  acq[i] = std::numeric_limits<Real>::max();
43  }
44 }
BayesianPosteriorTargeted(const InputParameters &parameters)
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).
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
MooseUnits pow(const MooseUnits &, int)
registerMooseObject("StochasticToolsApp", BayesianPosteriorTargeted)