https://mooseframework.inl.gov
Loading...
Searching...
No Matches
SquaredExponentialCovariance.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
16{
17public:
20
22 void computeCovarianceMatrix(torch::Tensor & K,
23 const torch::Tensor & x,
24 const torch::Tensor & xp,
25 const bool is_self_covariance) const override;
26
27 static void SquaredExponentialFunction(torch::Tensor & K,
28 const torch::Tensor & x,
29 const torch::Tensor & xp,
30 const torch::Tensor & length_factor,
31 const torch::Tensor & sigma_f_squared,
32 const torch::Tensor & sigma_n_squared,
33 const bool is_self_covariance);
34
36 bool computedKdhyper(torch::Tensor & dKdhp,
37 const torch::Tensor & x,
38 const std::string & hyper_param_name,
39 unsigned int ind) const override;
40
42 static void computedKdlf(torch::Tensor & K,
43 const torch::Tensor & x,
44 const torch::Tensor & length_factor,
45 const torch::Tensor & sigma_f_squared,
46 const int ind);
47
48protected:
50 const torch::Tensor & _length_factor;
51
53 const torch::Tensor & _sigma_f_squared;
54
56 const torch::Tensor & _sigma_n_squared;
57};
58
59#endif
const std::vector< double > x
Base class for covariance functions that are used in Gaussian Processes.
const InputParameters & parameters() const
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".
const torch::Tensor & _sigma_f_squared
signal variance (\sigma_f^2)
const torch::Tensor & _length_factor
lengh factor (\ell) for the kernel, in vector form for multiple parameters
const torch::Tensor & _sigma_n_squared
noise variance (\sigma_n^2)
static void SquaredExponentialFunction(torch::Tensor &K, const torch::Tensor &x, const torch::Tensor &xp, const torch::Tensor &length_factor, const torch::Tensor &sigma_f_squared, const torch::Tensor &sigma_n_squared, const bool is_self_covariance)
static void computedKdlf(torch::Tensor &K, const torch::Tensor &x, const torch::Tensor &length_factor, const torch::Tensor &sigma_f_squared, const int ind)
Computes dK/dlf for individual length factors.
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 points in the parameter space.