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