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