https://mooseframework.inl.gov
ProbabilityofImprovement.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 "Normal.h"
12 #include <cmath>
13 
14 registerMooseObject("StochasticToolsApp", ProbabilityofImprovement);
15 
18 {
20  params.addClassDescription("Probability of improvement acquisition function.");
21  return params;
22 }
23 
26 {
27 }
28 
29 void
31  std::vector<Real> & acq,
32  const std::vector<Real> & gp_mean,
33  const std::vector<Real> & gp_std,
34  const std::vector<std::vector<Real>> & /*test_inputs*/,
35  const std::vector<std::vector<Real>> & /*train_inputs*/,
36  const std::vector<Real> & generic) const
37 {
38  auto maxIt = std::max_element(generic.begin(), generic.end());
39  for (unsigned int i = 0; i < gp_mean.size(); ++i)
40  acq[i] = Normal::cdf(gp_mean[i] - *maxIt, 0.0, gp_std[i]);
41 }
registerMooseObject("StochasticToolsApp", ProbabilityofImprovement)
virtual Real cdf(const Real &x) const override
Definition: Normal.C:74
static InputParameters validParams()
All ParallelAcquisition functions should inherit from this class.
ProbabilityofImprovement(const InputParameters &parameters)
void addClassDescription(const std::string &doc_string)
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).