https://mooseframework.inl.gov
Loading...
Searching...
No Matches
LMC.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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#ifdef MOOSE_LIBTORCH_ENABLED
10
11#pragma once
12
14
20{
21public:
24
25 void computeCovarianceMatrix(torch::Tensor & K,
26 const torch::Tensor & x,
27 const torch::Tensor & xp,
28 const bool is_self_covariance) const override;
29
30 bool computedKdhyper(torch::Tensor & dKdhp,
31 const torch::Tensor & x,
32 const std::string & hyper_param_name,
33 unsigned int ind) const override;
34
35protected:
43 void computeBMatrix(torch::Tensor & Bmat, const unsigned int exp_i) const;
44
52 void
53 computeAGradient(torch::Tensor & grad, const unsigned int exp_i, const unsigned int index) const;
54
62 void computeLambdaGradient(torch::Tensor & grad,
63 const unsigned int exp_i,
64 const unsigned int index) const;
65
67 const unsigned int _num_expansion_terms;
68
69private:
72 std::vector<const torch::Tensor *> _a_coeffs;
73 std::vector<const torch::Tensor *> _lambdas;
74};
75
76#endif
const std::vector< double > x
Base class for covariance functions that are used in Gaussian Processes.
Covariance function for multi-output Gaussian Processes based on the linear model of coregionalizatio...
Definition LMC.h:20
void computeAGradient(torch::Tensor &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 = \...
Definition LMC.C:168
std::vector< const torch::Tensor * > _a_coeffs
The vectors in the $B = \sum_i a_i a_i^T + diag(lambda_i)$ expansion.
Definition LMC.h:72
void computeBMatrix(torch::Tensor &Bmat, const unsigned int exp_i) const
Computes the covariance matrix for the outputs (using the latent coefficients) We use a $B = \sum_i a...
Definition LMC.C:160
static InputParameters validParams()
Definition LMC.C:18
std::vector< const torch::Tensor * > _lambdas
Definition LMC.h:73
bool computedKdhyper(torch::Tensor &dKdhp, const torch::Tensor &x, const std::string &hyper_param_name, unsigned int ind) const override
Redirect dK/dhp for hyperparameter "hp".
Definition LMC.C:86
const unsigned int _num_expansion_terms
The number of expansion terms in the output ovariance matrix.
Definition LMC.h:67
void computeCovarianceMatrix(torch::Tensor &K, const torch::Tensor &x, const torch::Tensor &xp, const bool is_self_covariance) const override
Generates the Covariance Matrix given two sets of points in the parameter space.
Definition LMC.C:63
void computeLambdaGradient(torch::Tensor &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: $...
Definition LMC.C:183
const InputParameters & parameters() const