Covariance function for multi-output Gaussian Processes based on the linear model of coregionalization (LMC) More...
#include <LMC.h>
Public Types | |
typedef DataFileName | DataFileParameterType |
Public Member Functions | |
LMC (const InputParameters ¶meters) | |
void | computeCovarianceMatrix (RealEigenMatrix &K, const RealEigenMatrix &x, const RealEigenMatrix &xp, const bool is_self_covariance) const override |
Generates the Covariance Matrix given two sets of points in the parameter space. More... | |
bool | computedKdhyper (RealEigenMatrix &dKdhp, const RealEigenMatrix &x, const std::string &hyper_param_name, unsigned int ind) const override |
Redirect dK/dhp for hyperparameter "hp". More... | |
void | loadHyperParamMap (const std::unordered_map< std::string, Real > &map, const std::unordered_map< std::string, std::vector< Real >> &vec_map) |
Load some hyperparameters into the local maps contained in this object. More... | |
void | buildHyperParamMap (std::unordered_map< std::string, Real > &map, std::unordered_map< std::string, std::vector< Real >> &vec_map) const |
Populates the input maps with the owned hyperparameters. More... | |
virtual bool | getTuningData (const std::string &name, unsigned int &size, Real &min, Real &max) const |
Get the default minimum and maximum and size of a hyperparameter. More... | |
void | dependentCovarianceTypes (std::map< UserObjectName, std::string > &name_type_map) const |
Populate a map with the names and types of the dependent covariance functions. More... | |
const std::vector< UserObjectName > & | dependentCovarianceNames () const |
Get the names of the dependent covariances. More... | |
virtual bool | isTunable (const std::string &name) const |
Check if a given parameter is tunable. More... | |
unsigned int | numOutputs () const |
Return the number of outputs assumed for this covariance function. More... | |
std::unordered_map< std::string, Real > & | hyperParamMapReal () |
Get the map of scalar parameters. More... | |
std::unordered_map< std::string, std::vector< Real > > & | hyperParamMapVectorReal () |
Get the map of vector parameters. More... | |
virtual bool | enabled () const |
std::shared_ptr< MooseObject > | getSharedPtr () |
std::shared_ptr< const MooseObject > | getSharedPtr () const |
MooseApp & | getMooseApp () const |
const std::string & | type () const |
virtual const std::string & | name () const |
std::string | typeAndName () const |
std::string | errorPrefix (const std::string &error_type) const |
void | callMooseError (std::string msg, const bool with_prefix) const |
MooseObjectParameterName | uniqueParameterName (const std::string ¶meter_name) const |
const InputParameters & | parameters () const |
MooseObjectName | uniqueName () const |
const T & | getParam (const std::string &name) const |
std::vector< std::pair< T1, T2 > > | getParam (const std::string ¶m1, const std::string ¶m2) const |
const T * | queryParam (const std::string &name) const |
const T & | getRenamedParam (const std::string &old_name, const std::string &new_name) const |
T | getCheckedPointerParam (const std::string &name, const std::string &error_string="") const |
bool | isParamValid (const std::string &name) const |
bool | isParamSetByUser (const std::string &nm) const |
void | paramError (const std::string ¶m, Args... args) const |
void | paramWarning (const std::string ¶m, Args... args) const |
void | paramInfo (const std::string ¶m, Args... args) const |
void | connectControllableParams (const std::string ¶meter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const |
void | mooseError (Args &&... args) const |
void | mooseErrorNonPrefixed (Args &&... args) const |
void | mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const |
void | mooseWarning (Args &&... args) const |
void | mooseWarningNonPrefixed (Args &&... args) const |
void | mooseDeprecated (Args &&... args) const |
void | mooseInfo (Args &&... args) const |
std::string | getDataFileName (const std::string ¶m) const |
std::string | getDataFileNameByName (const std::string &relative_path) const |
std::string | getDataFilePath (const std::string &relative_path) const |
const Parallel::Communicator & | comm () const |
processor_id_type | n_processors () const |
processor_id_type | processor_id () const |
Static Public Member Functions | |
static InputParameters | validParams () |
Public Attributes | |
const ConsoleStream | _console |
Protected Member Functions | |
void | computeBMatrix (RealEigenMatrix &Bmat, const unsigned int exp_i) const |
Computes the covariance matrix for the outputs (using the latent coefficients) We use a $B = a_i a_i^T + diag(lambda_i)$ expansion here where $a_i$ and $lambda_i$ are vectors. More... | |
void | computeAGradient (RealEigenMatrix &grad, const unsigned int exp_i, const unsigned int index) const |
Computes the gradient of $B$ with respect to the entries in $a_i$ in the following expression: $B = a_i a_i^T + diag(lambda_i)$. More... | |
void | computeLambdaGradient (RealEigenMatrix &grad, const unsigned int exp_i, const unsigned int index) const |
Computes the gradient of $B$ with respect to the entries in $lambda_i$ in the following expression: $B = a_i a_i^T + diag(lambda_i)$. More... | |
const Real & | addRealHyperParameter (const std::string &name, const Real value, const bool is_tunable) |
Register a scalar hyperparameter to this covariance function. More... | |
const std::vector< Real > & | addVectorRealHyperParameter (const std::string &name, const std::vector< Real > value, const bool is_tunable) |
Register a vector hyperparameter to this covariance function. More... | |
CovarianceFunctionBase * | getCovarianceFunctionByName (const UserObjectName &name) const |
Lookup a CovarianceFunction object by name and return pointer. More... | |
Protected Attributes | |
const unsigned int | _num_expansion_terms |
The number of expansion terms in the output ovariance matrix. More... | |
std::unordered_map< std::string, Real > | _hp_map_real |
Map of real-valued hyperparameters. More... | |
std::unordered_map< std::string, std::vector< Real > > | _hp_map_vector_real |
Map of vector-valued hyperparameters. More... | |
std::unordered_set< std::string > | _tunable_hp |
list of tunable hyper-parameters More... | |
const unsigned int | _num_outputs |
The number of outputs this covariance function is used to describe. More... | |
const std::vector< UserObjectName > | _dependent_covariance_names |
The names of the dependent covariance functions. More... | |
std::vector< std::string > | _dependent_covariance_types |
The types of the dependent covariance functions. More... | |
std::vector< CovarianceFunctionBase * > | _covariance_functions |
Vector of pointers to the dependent covariance functions. More... | |
const bool & | _enabled |
MooseApp & | _app |
const std::string | _type |
const std::string | _name |
const InputParameters & | _pars |
Factory & | _factory |
ActionFactory & | _action_factory |
const Parallel::Communicator & | _communicator |
Private Attributes | |
std::vector< const std::vector< Real > * > | _a_coeffs |
The vectors in the $B = a_i a_i^T + diag(lambda_i)$ expansion. More... | |
std::vector< const std::vector< Real > * > | _lambdas |
Covariance function for multi-output Gaussian Processes based on the linear model of coregionalization (LMC)
LMC::LMC | ( | const InputParameters & | parameters | ) |
Definition at line 29 of file LMC.C.
|
protectedinherited |
Register a scalar hyperparameter to this covariance function.
name | The name of the parameter |
value | The initial value of the parameter |
is_tunable | If the parameter is tunable during optimization |
Definition at line 52 of file CovarianceFunctionBase.C.
|
protectedinherited |
Register a vector hyperparameter to this covariance function.
name | The name of the parameter |
value | The initial value of the parameter |
is_tunable | If the parameter is tunable during optimization |
Definition at line 63 of file CovarianceFunctionBase.C.
Referenced by LMC().
|
inherited |
Populates the input maps with the owned hyperparameters.
map | Map of scalar hyperparameters that should be populated |
vec_map | Map of vector hyperparameters that should be populated |
Definition at line 115 of file CovarianceFunctionBase.C.
Referenced by StochasticTools::GaussianProcess::setupCovarianceMatrix(), and StochasticTools::GaussianProcess::tuneHyperParamsAdam().
|
protected |
Computes the gradient of $B$ with respect to the entries in $a_i$ in the following expression: $B = a_i a_i^T + diag(lambda_i)$.
grad | The gradient matrix that should be populated |
exp_i | The index of the expansion of B |
index | The index within the vector $a_i$ |
Definition at line 176 of file LMC.C.
Referenced by computedKdhyper().
|
protected |
Computes the covariance matrix for the outputs (using the latent coefficients) We use a $B = a_i a_i^T + diag(lambda_i)$ expansion here where $a_i$ and $lambda_i$ are vectors.
Bmat | The matrix which should be populated by the covariance values |
exp_i | The expansion index in the latent space |
Definition at line 161 of file LMC.C.
Referenced by computeCovarianceMatrix(), and computedKdhyper().
|
overridevirtual |
Generates the Covariance Matrix given two sets of points in the parameter space.
K | Reference to a matrix which should be populated by the covariance entries |
x | Reference to the first set of points |
xp | Reference to the second set of points |
is_self_covariance | Switch to enable adding the noise variance to the diagonal of the covariance matrix |
Implements CovarianceFunctionBase.
Definition at line 66 of file LMC.C.
|
overridevirtual |
Redirect dK/dhp for hyperparameter "hp".
Returns false is the parameter has not been found in this covariance object.
dKdhp | The matrix which should be populated with the derivatives |
x | The input vector for which the derivatives of the covariance matrix is computed |
hyper_param_name | The name of the hyperparameter |
ind | The index within the hyperparameter. 0 if it is a scalar parameter. If it is a vector parameter, it should be the index within the vector. |
Reimplemented from CovarianceFunctionBase.
Definition at line 89 of file LMC.C.
|
protected |
Computes the gradient of $B$ with respect to the entries in $lambda_i$ in the following expression: $B = a_i a_i^T + diag(lambda_i)$.
grad | The gradient matrix that should be populated |
exp_i | The index of the expansion of B |
index | The index within the vector $lambda_i$ |
Definition at line 190 of file LMC.C.
Referenced by computedKdhyper().
|
inlineinherited |
Get the names of the dependent covariances.
Definition at line 62 of file CovarianceFunctionBase.h.
Referenced by StochasticTools::GaussianProcess::linkCovarianceFunction().
|
inherited |
Populate a map with the names and types of the dependent covariance functions.
name_type_map | Reference to the map which should be populated |
Definition at line 163 of file CovarianceFunctionBase.C.
Referenced by StochasticTools::GaussianProcess::linkCovarianceFunction().
|
protectedinherited |
Lookup a CovarianceFunction object by name and return pointer.
Definition at line 25 of file CovarianceInterface.C.
Referenced by ActiveLearningGaussianProcess::ActiveLearningGaussianProcess(), CovarianceFunctionBase::CovarianceFunctionBase(), GaussianProcessTrainer::GaussianProcessTrainer(), and GaussianProcessSurrogate::setupCovariance().
|
virtualinherited |
Get the default minimum and maximum and size of a hyperparameter.
Returns false is the parameter has not been found in this covariance object.
name | The name of the hyperparameter |
size | Reference to an unsigned int that will contain the size of the hyperparameter (will be populated with 1 if it is scalar) |
min | Reference to a number which will be populated by the maximum allowed value of the hyperparameter |
max | Reference to a number which will be populated by the minimum allowed value of the hyperparameter |
Definition at line 131 of file CovarianceFunctionBase.C.
Referenced by StochasticTools::GaussianProcess::generateTuningMap().
|
inlineinherited |
Get the map of scalar parameters.
Definition at line 88 of file CovarianceFunctionBase.h.
|
inlineinherited |
Get the map of vector parameters.
Definition at line 91 of file CovarianceFunctionBase.h.
|
virtualinherited |
Check if a given parameter is tunable.
The | name of the hyperparameter |
Definition at line 74 of file CovarianceFunctionBase.C.
Referenced by StochasticTools::GaussianProcess::generateTuningMap().
|
inherited |
Load some hyperparameters into the local maps contained in this object.
map | Input map of scalar hyperparameters |
vec_map | Input map of vector hyperparameters |
Definition at line 91 of file CovarianceFunctionBase.C.
Referenced by LoadCovarianceDataAction::load(), and StochasticTools::GaussianProcess::tuneHyperParamsAdam().
|
inlineinherited |
Return the number of outputs assumed for this covariance function.
Definition at line 85 of file CovarianceFunctionBase.h.
Referenced by GaussianProcessSurrogate::evaluate(), GaussianProcessTrainer::GaussianProcessTrainer(), and StochasticTools::GaussianProcess::linkCovarianceFunction().
|
static |
Definition at line 17 of file LMC.C.
|
private |
The vectors in the $B = a_i a_i^T + diag(lambda_i)$ expansion.
Definition at line 72 of file LMC.h.
Referenced by computeAGradient(), computeBMatrix(), and LMC().
|
protectedinherited |
Vector of pointers to the dependent covariance functions.
Definition at line 131 of file CovarianceFunctionBase.h.
Referenced by CovarianceFunctionBase::buildHyperParamMap(), computeCovarianceMatrix(), computedKdhyper(), CovarianceFunctionBase::CovarianceFunctionBase(), CovarianceFunctionBase::dependentCovarianceTypes(), CovarianceFunctionBase::getTuningData(), CovarianceFunctionBase::isTunable(), and CovarianceFunctionBase::loadHyperParamMap().
|
protectedinherited |
The names of the dependent covariance functions.
Definition at line 125 of file CovarianceFunctionBase.h.
Referenced by CovarianceFunctionBase::CovarianceFunctionBase(), and CovarianceFunctionBase::dependentCovarianceNames().
|
protectedinherited |
The types of the dependent covariance functions.
Definition at line 128 of file CovarianceFunctionBase.h.
Referenced by CovarianceFunctionBase::CovarianceFunctionBase().
|
protectedinherited |
Map of real-valued hyperparameters.
Definition at line 113 of file CovarianceFunctionBase.h.
Referenced by CovarianceFunctionBase::addRealHyperParameter(), CovarianceFunctionBase::buildHyperParamMap(), CovarianceFunctionBase::getTuningData(), CovarianceFunctionBase::hyperParamMapReal(), CovarianceFunctionBase::isTunable(), and CovarianceFunctionBase::loadHyperParamMap().
|
protectedinherited |
Map of vector-valued hyperparameters.
Definition at line 116 of file CovarianceFunctionBase.h.
Referenced by CovarianceFunctionBase::addVectorRealHyperParameter(), CovarianceFunctionBase::buildHyperParamMap(), CovarianceFunctionBase::getTuningData(), CovarianceFunctionBase::hyperParamMapVectorReal(), CovarianceFunctionBase::isTunable(), LMC(), and CovarianceFunctionBase::loadHyperParamMap().
|
private |
Definition at line 73 of file LMC.h.
Referenced by computeBMatrix(), and LMC().
|
protected |
The number of expansion terms in the output ovariance matrix.
Definition at line 67 of file LMC.h.
Referenced by computeCovarianceMatrix(), computedKdhyper(), and LMC().
|
protectedinherited |
The number of outputs this covariance function is used to describe.
Definition at line 122 of file CovarianceFunctionBase.h.
Referenced by computeAGradient(), computeBMatrix(), computeCovarianceMatrix(), computedKdhyper(), LMC(), and CovarianceFunctionBase::numOutputs().
|
protectedinherited |
list of tunable hyper-parameters
Definition at line 119 of file CovarianceFunctionBase.h.
Referenced by CovarianceFunctionBase::addRealHyperParameter(), CovarianceFunctionBase::addVectorRealHyperParameter(), computedKdhyper(), and CovarianceFunctionBase::isTunable().