10 #ifdef LIBTORCH_ENABLED 23 params.
addClassDescription(
"Copies a neural network from a trainer object on the main app to a " 24 "LibtorchNeuralNetControl object on the subapp.");
31 "Trainer object that contains the neural networks." 32 " for different samples.");
33 params.
addRequiredParam<std::string>(
"control_name",
"Controller object name.");
41 _control_name(getParam<
std::string>(
"control_name")),
43 getParam<UserObjectName>(
"trainer_name")))
61 paramError(
"control_name",
"The given gontrol is not a LibtorchNeuralNetrControl!");
const LibtorchDRLControlTrainer & _trainer
The trainer object which will contains the control neural net.
static InputParameters validParams()
virtual void execute() override
std::shared_ptr< MultiApp > _multi_app
registerMooseObject("StochasticToolsApp", LibtorchNeuralNetControlTransfer)
std::shared_ptr< Control > getActiveObject(const std::string &name, THREAD_ID tid=0) const
const Moose::LibtorchArtificialNeuralNet & controlNeuralNet() const
const std::string _control_name
The name of the control object on the other app where we want to copy our neural net.
void paramError(const std::string ¶m, Args... args) const
static InputParameters validParams()
Interface for objects that need to use samplers.
This trainer is responsible for training neural networks that efficiently control different processes...
LibtorchNeuralNetControlTransfer(const InputParameters ¶meters)
virtual void execute() override
ExecuteMooseObjectWarehouse< Control > & getControlWarehouse()
static InputParameters validParams()
void loadControlNeuralNet(const Moose::LibtorchArtificialNeuralNet &input_nn)