https://mooseframework.inl.gov
DRLControlNeuralNetParameters.C
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 
14 
16 
19 {
21 
22  params.addClassDescription("Outputs the parameters of a LibtorchArtificialNeuralNetwork within a "
23  "LibtorchDRLControlTrainer.");
24 
25  params.addRequiredParam<UserObjectName>("trainer_name",
26  "The control object holding the neural network.");
27 
28  return params;
29 }
30 
33 {
34  auto & network =
35  declareValueByName<const Moose::LibtorchArtificialNeuralNet *>(name(), REPORTER_MODE_ROOT);
36  network = &getSurrogateTrainer<LibtorchDRLControlTrainer>("trainer_name").controlNeuralNet();
37 }
38 
39 #endif
const ReporterMode REPORTER_MODE_ROOT
A Reporter which can print the parameter values of a LibtorchArtificialNeuralNetwork from within a DR...
static InputParameters validParams()
virtual const std::string & name() const
void addRequiredParam(const std::string &name, const std::string &doc_string)
registerMooseObject("StochasticToolsApp", DRLControlNeuralNetParameters)
Interface for objects that need to use samplers.
void addClassDescription(const std::string &doc_string)
DRLControlNeuralNetParameters(const InputParameters &params)