10#ifdef MOOSE_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!");
registerMooseObject("StochasticToolsApp", LibtorchNeuralNetControlTransfer)
ExecuteMooseObjectWarehouse< Control > & getControlWarehouse()
This trainer is responsible for training neural networks that efficiently control different processes...
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.
static InputParameters validParams()
virtual void execute() override
LibtorchNeuralNetControlTransfer(const InputParameters ¶meters)
const LibtorchDRLControlTrainer & _trainer
The trainer object which will contains the control neural net.
virtual void execute() override
void loadControlNeuralNet(const Moose::LibtorchArtificialNeuralNet &input_nn)
void paramError(const std::string ¶m, Args... args) const
std::shared_ptr< T > getActiveObject(const std::string &name, THREAD_ID tid=0) const
static InputParameters validParams()
std::shared_ptr< MultiApp > _multi_app
Interface for objects that need to use samplers.
static InputParameters validParams()