LibtorchANNSurrogate
Overview
The details of a simple feedforward neural network is discussed in LibtorchArtificialNeuralNet. This class is dedicated to evaluating the following function:
(1)which describes a neural network of layers. In this context, denotes an activation function, while and are the input and output arguments. respectively. The weight matrices () and bias vectors () are optimized by LibtorchANNTrainer and are fixed in the evaluation phase.
Example Input File Syntax
Let us consider an example where we evaluate the neural network trained here. For this, prepare another set of samples of from the same parameter space:
(contrib/moose/modules/stochastic_tools/test/tests/surrogates/libtorch_nn/evaluate.i)Following this, we load the surrogate from a file saved by the trainer:
(contrib/moose/modules/stochastic_tools/test/tests/surrogates/libtorch_nn/evaluate.i)And evaluate it using a reporter which uses the samples and the surrogate to compute the approximate values of the target function at the new sample points:
(contrib/moose/modules/stochastic_tools/test/tests/surrogates/libtorch_nn/evaluate.i)The detailed documentation of this object is only available when Moose is compiled with Libtorch. For instructions on how to compile Moose with Libtorch, visit the general installation webpage or click here.