https://mooseframework.inl.gov
LibtorchANNSurrogate.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 
10 #ifdef LIBTORCH_ENABLED
11 
12 #pragma once
13 
14 #include <torch/torch.h>
16 #include "SurrogateModel.h"
17 #include "Standardizer.h"
18 
20 {
21 public:
24 
26  virtual Real evaluate(const std::vector<Real> & x) const override;
27 
28 protected:
30  const std::shared_ptr<Moose::LibtorchArtificialNeuralNet> & _nn;
31 
34 
37 };
38 
39 #endif
const StochasticTools::Standardizer & _output_standardizer
Standardizer for use with output response (y)
LibtorchANNSurrogate(const InputParameters &parameters)
const StochasticTools::Standardizer & _input_standardizer
Standardizer for use with input (x)
const std::vector< double > x
virtual Real evaluate(const std::vector< Real > &x) const
Evaluate surrogate model given a row of parameters.
virtual Real evaluate(const std::vector< Real > &x) const override
Evaluate surrogate model given a row of parameters.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Class for standardizing data (centering and scaling)
Definition: Standardizer.h:21
const InputParameters & parameters() const
static InputParameters validParams()
const std::shared_ptr< Moose::LibtorchArtificialNeuralNet > & _nn
Pointer to the neural net object (initialized as null)