10#ifdef MOOSE_LIBTORCH_ENABLED
34 virtual void execute()
override;
41 Real
getSignal(
const unsigned int signal_index)
const;
68 const std::vector<std::string> & conditional_param,
69 bool should_be_defined =
true);
109 std::shared_ptr<Moose::LibtorchNeuralNetBase>
_nn;
Base class for Control objects.
A time-dependent, neural network-based control of multiple input parameters.
const std::vector< Real > _action_scaling_factors
Multipliers for the actions.
virtual void execute() override
Execute neural network to determine the controllable parameter values.
void conditionalParameterError(const std::string ¶m_name, const std::vector< std::string > &conditional_param, bool should_be_defined=true)
Function responsible for checking for potential user errors in the input file.
bool hasControlNeuralNet() const
Return true if the object already has a neural netwok.
const unsigned int _input_timesteps
Number of timesteps to use as input data from the reporters (this influences how many past results ar...
void loadControlNeuralNet(const Moose::LibtorchArtificialNeuralNet &input_nn)
Function responsible for loading the neural network for the controller.
Real getSignal(const unsigned int signal_index) const
Get the (signal_index)-th signal of the control neural net.
unsigned int numberOfControlSignals() const
Get the number of controls this object is computing.
const std::vector< Real > _response_scaling_factors
Scaling constants (multipliers) for the responses.
std::vector< Real > _current_response
The values of the current observed postprocessor values.
const std::vector< PostprocessorName > & _response_names
Names of the postprocessors which contain the observations of the system.
std::vector< std::vector< Real > > & _old_responses
This variable is populated if the controller needs acess to older values of the observed postprocesso...
static InputParameters validParams()
std::vector< Real > _current_control_signals
The control signals from the last evaluation of the controller.
const std::vector< Real > _response_shift_factors
Shifting constants for the responses.
const std::vector< std::string > & _control_names
The names of the controllable parameters.
torch::Tensor prepareInputTensor()
Function that prepares the input tensor for the controller neural network.
std::vector< const Real * > _response_values
Links to the current response postprocessor values.
std::shared_ptr< Moose::LibtorchNeuralNetBase > _nn
Pointer to the neural net object which is supposed to be used to control the parameter values.
void updateCurrentResponse()
Function that updates the values of the current response.
const Moose::LibtorchNeuralNetBase & controlNeuralNet() const
Return a reference to the stored neural network.
const InputParameters & parameters() const
Get the parameters of the object.
This base class is meant to gather the functions and members common in every neural network based on ...