Fixed-horizon actor-critic trainer that collects trajectories from MOOSE reporters and runs a PPO update on top of reusable RL-core components (observation history, trajectory buffer, mini-batch sampler, value estimator, and PPO loss). More...
#include <LibtorchDRLControlTrainer.h>
Public Types | |
| typedef DataFileName | DataFileParameterType |
Public Member Functions | |
| LibtorchDRLControlTrainer (const InputParameters ¶meters) | |
| Build the PPO-based DRL trainer. | |
| virtual void | execute () override |
| Pull fresh rollout data from the reporters and trigger training when ready. | |
| Real | averageEpisodeReward () |
| Return the current average episodic reward. | |
| Real | stdEpisodeReward () |
| Return the current episodic reward standard deviation. | |
| std::vector< Real > | sampleAverageEpsiodeRewards () |
| Return per-sample mean episodic rewards from the latest update window. | |
| std::vector< Real > | sampleStdEpsiodeRewards () |
| Return per-sample episodic reward standard deviations from the latest update window. | |
| void | trainController (const LibtorchRLTrajectoryBuffer::TensorBatch &batch) |
| Run the PPO update on a flattened on-policy batch. | |
| const Moose::LibtorchActorNeuralNet & | controlNeuralNet () const |
| Return the current actor network. | |
| unsigned int | seed () const |
| Return the trainer seed used for sampling and shuffling. | |
| unsigned int | timestepWindow () const |
| Return the number of raw reporter entries per training transition. | |
| unsigned int | inputTimesteps () const |
| Return the number of observation time levels stacked into the network inputs. | |
| unsigned int | numberOfObservations () const |
| Return the number of observation reporters read at each time level. | |
| unsigned int | numberOfControlSignals () const |
| Return the number of control signals produced by the actor. | |
| virtual void | initialize () |
| virtual void | finalize () |
| virtual void | threadJoin (const UserObject &) final |
| virtual Real | spatialValue (const Point &) const |
| virtual const std::vector< Point > | spatialPoints () const |
| void | setPrimaryThreadCopy (UserObject *primary) |
| UserObject * | primaryThreadCopy () |
| SubProblem & | getSubProblem () const |
| bool | shouldDuplicateInitialExecution () const |
| void | gatherSum (T &value) |
| void | gatherMax (T &value) |
| void | gatherMin (T &value) |
| void | gatherProxyValueMax (T1 &proxy, T2 &value) |
| void | gatherProxyValueMin (T1 &proxy, T2 &value) |
| std::set< UserObjectName > | getDependObjects () const |
| const std::set< std::string > & | getRequestedItems () override |
| const std::set< std::string > & | getSuppliedItems () override |
| unsigned int | systemNumber () const |
| virtual bool | needThreadedCopy () const |
| virtual bool | enabled () const |
| std::shared_ptr< MooseObject > | getSharedPtr () |
| std::shared_ptr< const MooseObject > | getSharedPtr () const |
| bool | isKokkosObject () const |
| MooseApp & | getMooseApp () const |
| const std::string & | type () const |
| const std::string & | name () const |
| std::string | typeAndName () const |
| MooseObjectParameterName | uniqueParameterName (const std::string ¶meter_name) const |
| MooseObjectName | uniqueName () const |
| const InputParameters & | parameters () const |
| const hit::Node * | getHitNode () const |
| bool | hasBase () const |
| const std::string & | getBase () const |
| const T & | getParam (const std::string &name) const |
| std::vector< std::pair< T1, T2 > > | getParam (const std::string ¶m1, const std::string ¶m2) const |
| const T * | queryParam (const std::string &name) const |
| const T & | getRenamedParam (const std::string &old_name, const std::string &new_name) const |
| T | getCheckedPointerParam (const std::string &name, const std::string &error_string="") const |
| bool | isParamValid (const std::string &name) const |
| bool | isParamSetByUser (const std::string &name) const |
| void | connectControllableParams (const std::string ¶meter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const |
| void | paramError (const std::string ¶m, Args... args) const |
| void | paramWarning (const std::string ¶m, Args... args) const |
| void | paramWarning (const std::string ¶m, Args... args) const |
| void | paramInfo (const std::string ¶m, Args... args) const |
| std::string | messagePrefix (const bool hit_prefix=true) const |
| std::string | errorPrefix (const std::string &) const |
| void | mooseError (Args &&... args) const |
| void | mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const |
| void | mooseErrorNonPrefixed (Args &&... args) const |
| void | mooseWarning (Args &&... args) const |
| void | mooseWarning (Args &&... args) const |
| void | mooseWarningNonPrefixed (Args &&... args) const |
| void | mooseWarningNonPrefixed (Args &&... args) const |
| void | mooseDeprecated (Args &&... args) const |
| void | mooseDeprecated (Args &&... args) const |
| void | mooseDeprecatedNoTrace (Args &&... args) const |
| void | mooseInfo (Args &&... args) const |
| void | callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr, const bool show_trace=true) const |
| std::string | getDataFileName (const std::string ¶m) const |
| std::string | getDataFileNameByName (const std::string &relative_path) const |
| std::string | getDataFilePath (const std::string &relative_path) const |
| virtual void | initialSetup () |
| virtual void | timestepSetup () |
| virtual void | jacobianSetup () |
| virtual void | residualSetup () |
| virtual void | customSetup (const ExecFlagType &) |
| const ExecFlagEnum & | getExecuteOnEnum () const |
| UserObjectName | getUserObjectName (const std::string ¶m_name) const |
| const T & | getUserObject (const std::string ¶m_name, bool is_dependency=true) const |
| const T & | getUserObjectByName (const UserObjectName &object_name, bool is_dependency=true) const |
| const UserObjectBase & | getUserObjectBase (const std::string ¶m_name, bool is_dependency=true) const |
| const UserObjectBase & | getUserObjectBaseByName (const UserObjectName &object_name, bool is_dependency=true) const |
| const std::vector< MooseVariableScalar * > & | getCoupledMooseScalarVars () |
| const std::set< TagID > & | getScalarVariableCoupleableVectorTags () const |
| const std::set< TagID > & | getScalarVariableCoupleableMatrixTags () const |
| const GenericMaterialProperty< T, is_ad > & | getGenericMaterialProperty (const std::string &name, MaterialData &material_data, const unsigned int state=0) |
| const GenericMaterialProperty< T, is_ad > & | getGenericMaterialProperty (const std::string &name, const unsigned int state=0) |
| const GenericMaterialProperty< T, is_ad > & | getGenericMaterialProperty (const std::string &name, const unsigned int state=0) |
| const MaterialProperty< T > & | getMaterialProperty (const std::string &name, MaterialData &material_data, const unsigned int state=0) |
| const MaterialProperty< T > & | getMaterialProperty (const std::string &name, const unsigned int state=0) |
| const MaterialProperty< T > & | getMaterialProperty (const std::string &name, const unsigned int state=0) |
| const ADMaterialProperty< T > & | getADMaterialProperty (const std::string &name, MaterialData &material_data) |
| const ADMaterialProperty< T > & | getADMaterialProperty (const std::string &name) |
| const ADMaterialProperty< T > & | getADMaterialProperty (const std::string &name) |
| const MaterialProperty< T > & | getMaterialPropertyOld (const std::string &name, MaterialData &material_data) |
| const MaterialProperty< T > & | getMaterialPropertyOld (const std::string &name) |
| const MaterialProperty< T > & | getMaterialPropertyOld (const std::string &name) |
| const MaterialProperty< T > & | getMaterialPropertyOlder (const std::string &name, MaterialData &material_data) |
| const MaterialProperty< T > & | getMaterialPropertyOlder (const std::string &name) |
| const MaterialProperty< T > & | getMaterialPropertyOlder (const std::string &name) |
| const GenericMaterialProperty< T, is_ad > & | getGenericMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data, const unsigned int state) |
| const GenericMaterialProperty< T, is_ad > & | getGenericMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0) |
| const GenericMaterialProperty< T, is_ad > & | getGenericMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0) |
| const MaterialProperty< T > & | getMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data, const unsigned int state=0) |
| const MaterialProperty< T > & | getMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0) |
| const MaterialProperty< T > & | getMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0) |
| const ADMaterialProperty< T > & | getADMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data) |
| const ADMaterialProperty< T > & | getADMaterialPropertyByName (const MaterialPropertyName &name) |
| const ADMaterialProperty< T > & | getADMaterialPropertyByName (const MaterialPropertyName &name) |
| const MaterialProperty< T > & | getMaterialPropertyOldByName (const MaterialPropertyName &name, MaterialData &material_data) |
| const MaterialProperty< T > & | getMaterialPropertyOldByName (const MaterialPropertyName &name) |
| const MaterialProperty< T > & | getMaterialPropertyOldByName (const MaterialPropertyName &name) |
| const MaterialProperty< T > & | getMaterialPropertyOlderByName (const MaterialPropertyName &name, MaterialData &material_data) |
| const MaterialProperty< T > & | getMaterialPropertyOlderByName (const MaterialPropertyName &name) |
| const MaterialProperty< T > & | getMaterialPropertyOlderByName (const MaterialPropertyName &name) |
| Moose::Kokkos::MaterialProperty< T, dimension > | getKokkosMaterialPropertyByName (const std::string &prop_name_in) |
| Moose::Kokkos::MaterialProperty< T, dimension > | getKokkosMaterialPropertyOldByName (const std::string &prop_name) |
| Moose::Kokkos::MaterialProperty< T, dimension > | getKokkosMaterialPropertyOlderByName (const std::string &prop_name) |
| Moose::Kokkos::MaterialProperty< T, dimension > | getKokkosMaterialProperty (const std::string &name) |
| Moose::Kokkos::MaterialProperty< T, dimension > | getKokkosMaterialPropertyOld (const std::string &name) |
| Moose::Kokkos::MaterialProperty< T, dimension > | getKokkosMaterialPropertyOlder (const std::string &name) |
| std::pair< const MaterialProperty< T > *, std::set< SubdomainID > > | getBlockMaterialProperty (const MaterialPropertyName &name) |
| std::pair< Moose::Kokkos::MaterialProperty< T, dimension >, std::set< SubdomainID > > | getKokkosBlockMaterialProperty (const MaterialPropertyName &name) |
| const GenericMaterialProperty< T, is_ad > & | getGenericZeroMaterialProperty (const std::string &name) |
| const GenericMaterialProperty< T, is_ad > & | getGenericZeroMaterialProperty () |
| const GenericMaterialProperty< T, is_ad > & | getGenericZeroMaterialPropertyByName (const std::string &prop_name) |
| const MaterialProperty< T > & | getZeroMaterialProperty (Ts... args) |
| std::set< SubdomainID > | getMaterialPropertyBlocks (const std::string &name) |
| std::vector< SubdomainName > | getMaterialPropertyBlockNames (const std::string &name) |
| std::set< BoundaryID > | getMaterialPropertyBoundaryIDs (const std::string &name) |
| std::vector< BoundaryName > | getMaterialPropertyBoundaryNames (const std::string &name) |
| void | checkBlockAndBoundaryCompatibility (std::shared_ptr< MaterialBase > discrete) |
| std::unordered_map< SubdomainID, std::vector< MaterialBase * > > | buildRequiredMaterials (bool allow_stateful=true) |
| void | statefulPropertiesAllowed (bool) |
| virtual bool | getMaterialPropertyCalled () const |
| virtual const std::unordered_set< unsigned int > & | getMatPropDependencies () const |
| virtual void | resolveOptionalProperties () |
| const GenericMaterialProperty< T, is_ad > & | getPossiblyConstantGenericMaterialPropertyByName (const MaterialPropertyName &prop_name, MaterialData &material_data, const unsigned int state) |
| bool | isImplicit () |
| Moose::StateArg | determineState () const |
| virtual void | subdomainSetup () override |
| virtual void | subdomainSetup () override |
| bool | hasUserObject (const std::string ¶m_name) const |
| bool | hasUserObject (const std::string ¶m_name) const |
| bool | hasUserObject (const std::string ¶m_name) const |
| bool | hasUserObject (const std::string ¶m_name) const |
| bool | hasUserObjectByName (const UserObjectName &object_name) const |
| bool | hasUserObjectByName (const UserObjectName &object_name) const |
| bool | hasUserObjectByName (const UserObjectName &object_name) const |
| bool | hasUserObjectByName (const UserObjectName &object_name) const |
| const GenericOptionalMaterialProperty< T, is_ad > & | getGenericOptionalMaterialProperty (const std::string &name, const unsigned int state=0) |
| const GenericOptionalMaterialProperty< T, is_ad > & | getGenericOptionalMaterialProperty (const std::string &name, const unsigned int state=0) |
| const OptionalMaterialProperty< T > & | getOptionalMaterialProperty (const std::string &name, const unsigned int state=0) |
| const OptionalMaterialProperty< T > & | getOptionalMaterialProperty (const std::string &name, const unsigned int state=0) |
| const OptionalADMaterialProperty< T > & | getOptionalADMaterialProperty (const std::string &name) |
| const OptionalADMaterialProperty< T > & | getOptionalADMaterialProperty (const std::string &name) |
| const OptionalMaterialProperty< T > & | getOptionalMaterialPropertyOld (const std::string &name) |
| const OptionalMaterialProperty< T > & | getOptionalMaterialPropertyOld (const std::string &name) |
| const OptionalMaterialProperty< T > & | getOptionalMaterialPropertyOlder (const std::string &name) |
| const OptionalMaterialProperty< T > & | getOptionalMaterialPropertyOlder (const std::string &name) |
| MaterialBase & | getMaterial (const std::string &name) |
| MaterialBase & | getMaterial (const std::string &name) |
| MaterialBase & | getMaterialByName (const std::string &name, bool no_warn=false) |
| MaterialBase & | getMaterialByName (const std::string &name, bool no_warn=false) |
| bool | hasMaterialProperty (const std::string &name) |
| bool | hasMaterialProperty (const std::string &name) |
| bool | hasMaterialPropertyByName (const std::string &name) |
| bool | hasMaterialPropertyByName (const std::string &name) |
| bool | hasADMaterialProperty (const std::string &name) |
| bool | hasADMaterialProperty (const std::string &name) |
| bool | hasADMaterialPropertyByName (const std::string &name) |
| bool | hasADMaterialPropertyByName (const std::string &name) |
| bool | hasKokkosMaterialProperty (const std::string &name) |
| bool | hasKokkosMaterialProperty (const std::string &name) |
| bool | hasKokkosMaterialPropertyByName (const std::string &name) |
| bool | hasKokkosMaterialPropertyByName (const std::string &name) |
| bool | hasGenericMaterialProperty (const std::string &name) |
| bool | hasGenericMaterialProperty (const std::string &name) |
| bool | hasGenericMaterialPropertyByName (const std::string &name) |
| bool | hasGenericMaterialPropertyByName (const std::string &name) |
| const Function & | getFunction (const std::string &name) const |
| const Function & | getFunctionByName (const FunctionName &name) const |
| bool | hasFunction (const std::string ¶m_name) const |
| bool | hasFunctionByName (const FunctionName &name) const |
| Moose::Kokkos::Function | getKokkosFunction (const std::string &name) const |
| const T & | getKokkosFunction (const std::string &name) const |
| Moose::Kokkos::Function | getKokkosFunctionByName (const FunctionName &name) const |
| const T & | getKokkosFunctionByName (const FunctionName &name) const |
| bool | hasKokkosFunction (const std::string ¶m_name) const |
| bool | hasKokkosFunctionByName (const FunctionName &name) const |
| bool | isDefaultPostprocessorValue (const std::string ¶m_name, const unsigned int index=0) const |
| bool | hasPostprocessor (const std::string ¶m_name, const unsigned int index=0) const |
| bool | hasPostprocessorByName (const PostprocessorName &name) const |
| std::size_t | coupledPostprocessors (const std::string ¶m_name) const |
| const PostprocessorName & | getPostprocessorName (const std::string ¶m_name, const unsigned int index=0) const |
| const VectorPostprocessorValue & | getVectorPostprocessorValue (const std::string ¶m_name, const std::string &vector_name) const |
| const VectorPostprocessorValue & | getVectorPostprocessorValue (const std::string ¶m_name, const std::string &vector_name, bool needs_broadcast) const |
| const VectorPostprocessorValue & | getVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const |
| const VectorPostprocessorValue & | getVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const |
| const VectorPostprocessorValue & | getVectorPostprocessorValueOld (const std::string ¶m_name, const std::string &vector_name) const |
| const VectorPostprocessorValue & | getVectorPostprocessorValueOld (const std::string ¶m_name, const std::string &vector_name, bool needs_broadcast) const |
| const VectorPostprocessorValue & | getVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const |
| const VectorPostprocessorValue & | getVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const |
| const ScatterVectorPostprocessorValue & | getScatterVectorPostprocessorValue (const std::string ¶m_name, const std::string &vector_name) const |
| const ScatterVectorPostprocessorValue & | getScatterVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const |
| const ScatterVectorPostprocessorValue & | getScatterVectorPostprocessorValueOld (const std::string ¶m_name, const std::string &vector_name) const |
| const ScatterVectorPostprocessorValue & | getScatterVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const |
| bool | hasVectorPostprocessor (const std::string ¶m_name, const std::string &vector_name) const |
| bool | hasVectorPostprocessor (const std::string ¶m_name) const |
| bool | hasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const |
| bool | hasVectorPostprocessorByName (const VectorPostprocessorName &name) const |
| const VectorPostprocessorName & | getVectorPostprocessorName (const std::string ¶m_name) const |
| T & | getSampler (const std::string &name) |
| Sampler & | getSampler (const std::string &name) |
| T & | getSamplerByName (const SamplerName &name) |
| Sampler & | getSamplerByName (const SamplerName &name) |
| virtual void | meshChanged () |
| virtual void | meshDisplaced () |
| PerfGraph & | perfGraph () |
| const PostprocessorValue & | getPostprocessorValue (const std::string ¶m_name, const unsigned int index=0) const |
| const PostprocessorValue & | getPostprocessorValue (const std::string ¶m_name, const unsigned int index=0) const |
| const PostprocessorValue & | getPostprocessorValueOld (const std::string ¶m_name, const unsigned int index=0) const |
| const PostprocessorValue & | getPostprocessorValueOld (const std::string ¶m_name, const unsigned int index=0) const |
| const PostprocessorValue & | getPostprocessorValueOlder (const std::string ¶m_name, const unsigned int index=0) const |
| const PostprocessorValue & | getPostprocessorValueOlder (const std::string ¶m_name, const unsigned int index=0) const |
| virtual const PostprocessorValue & | getPostprocessorValueByName (const PostprocessorName &name) const |
| virtual const PostprocessorValue & | getPostprocessorValueByName (const PostprocessorName &name) const |
| const PostprocessorValue & | getPostprocessorValueOldByName (const PostprocessorName &name) const |
| const PostprocessorValue & | getPostprocessorValueOldByName (const PostprocessorName &name) const |
| const PostprocessorValue & | getPostprocessorValueOlderByName (const PostprocessorName &name) const |
| const PostprocessorValue & | getPostprocessorValueOlderByName (const PostprocessorName &name) const |
| bool | isVectorPostprocessorDistributed (const std::string ¶m_name) const |
| bool | isVectorPostprocessorDistributed (const std::string ¶m_name) const |
| bool | isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const |
| bool | isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const |
| const Distribution & | getDistribution (const std::string &name) const |
| const T & | getDistribution (const std::string &name) const |
| const Distribution & | getDistribution (const std::string &name) const |
| const T & | getDistribution (const std::string &name) const |
| const Distribution & | getDistributionByName (const DistributionName &name) const |
| const T & | getDistributionByName (const std::string &name) const |
| const Distribution & | getDistributionByName (const DistributionName &name) const |
| const T & | getDistributionByName (const std::string &name) const |
| const Parallel::Communicator & | comm () const |
| processor_id_type | n_processors () const |
| processor_id_type | processor_id () const |
| const std::string & | modelMetaDataName () const |
| Accessor for the name of the model meta data. | |
| const FileName & | getModelDataFileName () const |
| Get the associated filename. | |
| bool | hasModelData () const |
| Check if we need to load model data (if the filename parameter is used) | |
| bool | hasExplicitModelData () const |
| Check if the filename parameter is explicitly set (ignoring recover state) | |
| template<typename T , typename... Args> | |
| T & | declareModelData (const std::string &data_name, Args &&... args) |
| Declare model data for loading from file as well as restart. | |
| template<typename T , typename... Args> | |
| const T & | getModelData (const std::string &data_name, Args &&... args) const |
| Retrieve model data from the interface. | |
Static Public Member Functions | |
| static InputParameters | validParams () |
| Return the input parameters supported by this trainer. | |
| static void | callMooseError (MooseApp *const app, const InputParameters ¶ms, std::string msg, const bool with_prefix, const hit::Node *node, const bool show_trace=true) |
| static void | sort (typename std::vector< T > &vector) |
| static void | sortDFS (typename std::vector< T > &vector) |
| static void | cyclicDependencyError (CyclicDependencyException< T2 > &e, const std::string &header, NameFunc &&name_func) |
| static void | cyclicDependencyError (CyclicDependencyException< T2 > &e, const std::string &header) |
Public Attributes | |
| usingCombinedWarningSolutionWarnings | |
| const ConsoleStream | _console |
Static Public Attributes | |
| static const std::string | type_param |
| static const std::string | name_param |
| static const std::string | unique_name_param |
| static const std::string | app_param |
| static const std::string | moose_base_param |
| static const std::string | kokkos_object_param |
| static constexpr PropertyValue::id_type | default_property_id |
| static constexpr PropertyValue::id_type | zero_property_id |
| static constexpr auto | SYSTEM |
| static constexpr auto | NAME |
Protected Member Functions | |
| void | computeEpisodeRewardStatistics () |
| Compute the average episodic reward statistics for the latest samples. | |
| void | resetData () |
| Reset the stored rollout data after an update. | |
| virtual void | addPostprocessorDependencyHelper (const PostprocessorName &name) const override |
| virtual void | addVectorPostprocessorDependencyHelper (const VectorPostprocessorName &name) const override |
| virtual void | addUserObjectDependencyHelper (const UserObjectBase &uo) const override |
| void | addReporterDependencyHelper (const ReporterName &reporter_name) override |
| void | flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const |
| InvalidSolutionID | registerInvalidSolutionInternal (const std::string &message, const bool warning) const |
| const ReporterContextBase & | getReporterContextBaseByName (const ReporterName &reporter_name) const |
| const ReporterName & | getReporterName (const std::string ¶m_name) const |
| T & | declareRestartableData (const std::string &data_name, Args &&... args) |
| ManagedValue< T > | declareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args) |
| const T & | getRestartableData (const std::string &data_name) const |
| T & | declareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args) |
| T & | declareRecoverableData (const std::string &data_name, Args &&... args) |
| T & | declareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args) |
| T & | declareRestartableDataWithObjectNameWithContext (const std::string &data_name, const std::string &object_name, void *context, Args &&... args) |
| std::string | restartableName (const std::string &data_name) const |
| const T & | getMeshProperty (const std::string &data_name, const std::string &prefix) |
| const T & | getMeshProperty (const std::string &data_name) |
| bool | hasMeshProperty (const std::string &data_name, const std::string &prefix) const |
| bool | hasMeshProperty (const std::string &data_name, const std::string &prefix) const |
| bool | hasMeshProperty (const std::string &data_name) const |
| bool | hasMeshProperty (const std::string &data_name) const |
| std::string | meshPropertyName (const std::string &data_name) const |
| PerfID | registerTimedSection (const std::string §ion_name, const unsigned int level) const |
| PerfID | registerTimedSection (const std::string §ion_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const |
| std::string | timedSectionName (const std::string §ion_name) const |
| bool | isCoupledScalar (const std::string &var_name, unsigned int i=0) const |
| unsigned int | coupledScalarComponents (const std::string &var_name) const |
| unsigned int | coupledScalar (const std::string &var_name, unsigned int comp=0) const |
| libMesh::Order | coupledScalarOrder (const std::string &var_name, unsigned int comp=0) const |
| const VariableValue & | coupledScalarValue (const std::string &var_name, unsigned int comp=0) const |
| const ADVariableValue & | adCoupledScalarValue (const std::string &var_name, unsigned int comp=0) const |
| const GenericVariableValue< is_ad > & | coupledGenericScalarValue (const std::string &var_name, unsigned int comp=0) const |
| const GenericVariableValue< false > & | coupledGenericScalarValue (const std::string &var_name, const unsigned int comp) const |
| const GenericVariableValue< true > & | coupledGenericScalarValue (const std::string &var_name, const unsigned int comp) const |
| const VariableValue & | coupledVectorTagScalarValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const |
| const VariableValue & | coupledMatrixTagScalarValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const |
| const VariableValue & | coupledScalarValueOld (const std::string &var_name, unsigned int comp=0) const |
| const VariableValue & | coupledScalarValueOlder (const std::string &var_name, unsigned int comp=0) const |
| const VariableValue & | coupledScalarDot (const std::string &var_name, unsigned int comp=0) const |
| const ADVariableValue & | adCoupledScalarDot (const std::string &var_name, unsigned int comp=0) const |
| const VariableValue & | coupledScalarDotDot (const std::string &var_name, unsigned int comp=0) const |
| const VariableValue & | coupledScalarDotOld (const std::string &var_name, unsigned int comp=0) const |
| const VariableValue & | coupledScalarDotDotOld (const std::string &var_name, unsigned int comp=0) const |
| const VariableValue & | coupledScalarDotDu (const std::string &var_name, unsigned int comp=0) const |
| const VariableValue & | coupledScalarDotDotDu (const std::string &var_name, unsigned int comp=0) const |
| Moose::Kokkos::VariableValue | kokkosCoupledVectorTagScalarValueByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const |
| Moose::Kokkos::VariableValue | kokkosCoupledVectorTagScalarValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const |
| Moose::Kokkos::VariableValue | kokkosCoupledScalarValue (const std::string &var_name, unsigned int comp=0) const |
| Moose::Kokkos::VariableValue | kokkosCoupledScalarValueOld (const std::string &var_name, unsigned int comp=0) const |
| Moose::Kokkos::VariableValue | kokkosCoupledScalarValueOlder (const std::string &var_name, unsigned int comp=0) const |
| Moose::Kokkos::VariableValue | kokkosCoupledScalarDot (const std::string &var_name, unsigned int comp=0) const |
| Moose::Kokkos::Scalar< const Real > | kokkosCoupledScalarDotDu (const std::string &var_name, unsigned int comp=0) const |
| const MooseVariableScalar * | getScalarVar (const std::string &var_name, unsigned int comp) const |
| virtual void | checkMaterialProperty (const std::string &name, const unsigned int state) |
| virtual void | getKokkosMaterialPropertyHook (const std::string &, const unsigned int) |
| void | markMatPropRequested (const std::string &) |
| MaterialPropertyName | getMaterialPropertyName (const std::string &name) const |
| void | checkExecutionStage () |
| const T & | getReporterValue (const std::string ¶m_name, const std::size_t time_index=0) |
| const T & | getReporterValue (const std::string ¶m_name, ReporterMode mode, const std::size_t time_index=0) |
| const T & | getReporterValue (const std::string ¶m_name, const std::size_t time_index=0) |
| const T & | getReporterValue (const std::string ¶m_name, ReporterMode mode, const std::size_t time_index=0) |
| const T & | getReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0) |
| const T & | getReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0) |
| const T & | getReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0) |
| const T & | getReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0) |
| bool | hasReporterValue (const std::string ¶m_name) const |
| bool | hasReporterValue (const std::string ¶m_name) const |
| bool | hasReporterValue (const std::string ¶m_name) const |
| bool | hasReporterValue (const std::string ¶m_name) const |
| bool | hasReporterValueByName (const ReporterName &reporter_name) const |
| bool | hasReporterValueByName (const ReporterName &reporter_name) const |
| bool | hasReporterValueByName (const ReporterName &reporter_name) const |
| bool | hasReporterValueByName (const ReporterName &reporter_name) const |
| const GenericMaterialProperty< T, is_ad > * | defaultGenericMaterialProperty (const std::string &name) |
| const GenericMaterialProperty< T, is_ad > * | defaultGenericMaterialProperty (const std::string &name) |
| const MaterialProperty< T > * | defaultMaterialProperty (const std::string &name) |
| const MaterialProperty< T > * | defaultMaterialProperty (const std::string &name) |
| const ADMaterialProperty< T > * | defaultADMaterialProperty (const std::string &name) |
| const ADMaterialProperty< T > * | defaultADMaterialProperty (const std::string &name) |
Static Protected Member Functions | |
| static std::string | meshPropertyName (const std::string &data_name, const std::string &prefix) |
Protected Attributes | |
| const std::vector< ReporterName > | _state_names |
| Observation reporter names. | |
| std::vector< const std::vector< std::vector< Real > > * > | _state_value_pointers |
| Pointers to the current values of the observations We can have multiple observations, multiple samples, multiple timesteps. | |
| const std::vector< Real > | _state_shift_factors |
| Shifting constants for the observations. | |
| const std::vector< Real > | _state_scaling_factors |
| Scaling constants for the observations. | |
| const std::vector< ReporterName > | _action_names |
| Control reporter names. | |
| const std::vector< Real > | _action_scaling_factors |
| Multiplicative action scaling embedded in the actor outputs. | |
| std::vector< const std::vector< std::vector< Real > > * > | _action_value_pointers |
| Pointers to the current values of the control signals We can have multiple control signals, multiple samples, multiple timesteps. | |
| const std::vector< ReporterName > | _log_probability_names |
| Log probability reporter names. | |
| std::vector< const std::vector< std::vector< Real > > * > | _log_probability_value_pointers |
| Pointers to the current values of the control log probabilities We can have multiple control signals, multiple samples, multiple timesteps. | |
| const ReporterName | _reward_name |
| Reward reporter name. | |
| const std::vector< std::vector< Real > > * | _reward_value_pointer |
| Pointer to the current values of the reward We can have multiple samples, multiple timesteps. | |
| const unsigned int | _input_timesteps |
| Number of timesteps to fetch from the reporters to be the input of then eural nets. | |
| unsigned int | _num_inputs |
| Number of inputs for the control and critic neural nets. | |
| unsigned int | _num_outputs |
| Number of outputs for the control neural network. | |
| const unsigned int | _num_epochs |
| Number of epochs for the training of the emulator. | |
| const std::vector< unsigned int > | _num_critic_neurons_per_layer |
| Number of neurons within the hidden layers in the critic neural net. | |
| const Real | _critic_learning_rate |
| The learning rate for the optimization algorithm for the critic. | |
| const std::vector< unsigned int > | _num_control_neurons_per_layer |
| Number of neurons within the hidden layers in the control neural net. | |
| const Real | _control_learning_rate |
| The learning rate for the optimization algorithm for the control. | |
| const unsigned int | _update_frequency |
| Number of transients to run and collect data from before updating the controller neural net. | |
| const Real | _clip_param |
| The clip parameter used while clamping the advantage value. | |
| const Real | _decay_factor |
| Decaying factor that is used when calculating the return from the reward. | |
| const Real | _lambda_factor |
| GAE lambda factor used while estimating advantages and returns. | |
| const std::string | _filename_base |
| Name of the pytorch output file. | |
| const bool | _read_from_file |
| Switch indicating if an already existing neural net should be read from a file or not. | |
| const bool | _shift_outputs |
| Currently, the controls are executed after the user objects at initial in moose. | |
| const bool | _average_reward_over_timestep_window |
| Average rewards over each reporter timestep window instead of sampling one boundary value. | |
| Real | _average_episode_reward |
| Storage for the current average episode reward. | |
| Real | _std_episode_reward |
| Storage for the current episode reward standard deviation. | |
| std::vector< Real > | _sample_average_episode_reward |
| Per-sample mean episodic rewards over the latest update window. | |
| std::vector< Real > | _sample_std_episode_reward |
| Per-sample episodic reward standard deviations over the latest update window. | |
| const bool | _standardize_advantage |
| Switch to enable the standardization of the advantages. | |
| const unsigned int | _loss_print_frequency |
| The frequency the loss should be printed. | |
| const unsigned int | _seed |
| Base seed for stochastic optimizers and policy sampling. | |
| std::vector< Real > | _min_values |
| Optional lower bounds for each control signal. | |
| std::vector< Real > | _max_values |
| Optional upper bounds for each control signal. | |
| std::shared_ptr< Moose::LibtorchActorNeuralNet > | _control_nn |
| Pointer to the control (or actor) neural net object. | |
| std::shared_ptr< Moose::LibtorchArtificialNeuralNet > | _critic_nn |
| Pointer to the critic neural net object. | |
| Real | _highest_reward |
| Best average episode reward seen so far while training. | |
| Real | _entropy_coeff |
| Entropy bonus coefficient used in the PPO actor loss. | |
| std::unique_ptr< torch::optim::Adam > | _actor_optimizer |
| Adam optimizer used to update the actor network. | |
| std::unique_ptr< torch::optim::Adam > | _critic_optimizer |
| Adam optimizer used to update the critic network. | |
| const Moose::CoordinateSystemType & | _coord_sys |
| const THREAD_ID | _tid |
| SubProblem & | _subproblem |
| FEProblemBase & | _fe_problem |
| SystemBase & | _sys |
| Assembly & | _assembly |
| const bool | _duplicate_initial_execution |
| std::set< std::string > | _depend_uo |
| const bool & | _enabled |
| MooseApp & | _app |
| Factory & | _factory |
| ActionFactory & | _action_factory |
| const std::string & | _type |
| const std::string & | _name |
| const InputParameters & | _pars |
| const ExecFlagEnum & | _execute_enum |
| const ExecFlagType & | _current_execute_flag |
| MooseApp & | _restartable_app |
| const std::string | _restartable_system_name |
| const THREAD_ID | _restartable_tid |
| const bool | _restartable_read_only |
| FEProblemBase & | _mci_feproblem |
| FEProblemBase & | _mdi_feproblem |
| MooseApp & | _pg_moose_app |
| const std::string | _prefix |
| FEProblemBase & | _sc_fe_problem |
| const THREAD_ID | _sc_tid |
| const Real & | _real_zero |
| const VariableValue & | _scalar_zero |
| const Point & | _point_zero |
| const InputParameters & | _mi_params |
| const std::string | _mi_name |
| const MooseObjectName | _mi_moose_object_name |
| FEProblemBase & | _mi_feproblem |
| SubProblem & | _mi_subproblem |
| const THREAD_ID | _mi_tid |
| const bool | _is_kokkos_object |
| const Moose::MaterialDataType | _material_data_type |
| MaterialData & | _material_data |
| bool | _stateful_allowed |
| bool | _get_material_property_called |
| std::vector< std::unique_ptr< PropertyValue > > | _default_properties |
| std::unordered_set< unsigned int > | _material_property_dependencies |
| const MaterialPropertyName | _get_suffix |
| const bool | _use_interpolated_state |
| const InputParameters & | _ti_params |
| FEProblemBase & | _ti_feproblem |
| bool | _is_implicit |
| Real & | _t |
| const Real & | _t_old |
| int & | _t_step |
| Real & | _dt |
| Real & | _dt_old |
| bool | _is_transient |
| const Parallel::Communicator & | _communicator |
Static Protected Attributes | |
| static const std::string | _interpolated_old |
| static const std::string | _interpolated_older |
Private Member Functions | |
| void | getReporterPointers (const std::vector< ReporterName > &reporter_names, std::vector< const std::vector< std::vector< Real > > * > &pointer_storage) |
| Resolve reporter names into cached pointer storage. | |
| bool | collectTrajectoriesFromReporters () |
| Pull trajectories out of the reporters and append them to the trajectory buffer. | |
| const Moose::FunctionBase * | getKokkosFunctionByNameHelper (const FunctionName &name) const |
| const UserObjectBase & | getUserObjectFromFEProblem (const UserObjectName &object_name, const THREAD_ID tid=0) const |
| const T & | castUserObject (const UserObjectBase &uo_base, const std::string ¶m_name="") const |
| void | mooseObjectError (const std::string ¶m_name, std::stringstream &oss) const |
| const std::string & | userObjectType (const UserObjectBase &uo) const |
| const std::string & | userObjectName (const UserObjectBase &uo) const |
| const PostprocessorName & | getPostprocessorNameInternal (const std::string ¶m_name, const unsigned int index, const bool allow_default_value=true) const |
| bool | isDefaultPostprocessorValueByName (const PostprocessorName &name) const |
| PostprocessorValue | getDefaultPostprocessorValueByName (const PostprocessorName &name) const |
| void | checkParam (const std::string ¶m_name, const unsigned int index=std::numeric_limits< unsigned int >::max()) const |
| bool | postprocessorsAdded () const |
| const VectorPostprocessorValue & | getVectorPostprocessorByNameHelper (const VectorPostprocessorName &name, const std::string &vector_name, bool broadcast, std::size_t t_index) const |
| const VectorPostprocessorContext< VectorPostprocessorValue > & | getVectorPostprocessorContextByNameHelper (const VectorPostprocessorName &name, const std::string &vector_name) const |
| bool | vectorPostprocessorsAdded () const |
| bool | reportersAdded () const |
| void | possiblyCheckHasReporter (const ReporterName &reporter_name, const std::string ¶m_name="") const |
| RestartableDataValue & | registerRestartableDataOnApp (std::unique_ptr< RestartableDataValue > data, THREAD_ID tid) const |
| void | registerRestartableNameWithFilterOnApp (const std::string &name, Moose::RESTARTABLE_FILTER filter) |
| RestartableData< T > & | declareRestartableDataHelper (const std::string &data_name, void *context, Args &&... args) const |
| virtual std::string | meshPropertyPrefix (const std::string &data_name) const |
| const RestartableDataValue & | getMeshPropertyInternal (const std::string &data_name, const std::string &prefix) const |
| void | mooseErrorInternal (Args &&... args) const |
| const VariableValue * | getDefaultValue (const std::string &var_name) const |
| const ADVariableValue * | getADDefaultValue (const std::string &var_name) const |
| void | checkVar (const std::string &var_name) const |
| void | validateExecutionerType (const std::string &name, const std::string &fn_name) const |
| Moose::Kokkos::Variable | kokkosCoupledVectorTagScalarVariable (const std::string &var_name, const std::string &tag_name, unsigned int comp) const |
| Moose::MaterialDataType | getMaterialDataType (const std::set< BoundaryID > &boundary_ids) const |
| unsigned int | getMaxQps () const |
| void | addConsumedPropertyName (const MooseObjectName &obj_name, const std::string &prop_name) |
| const PostprocessorValue & | getPostprocessorValueInternal (const std::string ¶m_name, unsigned int index, std::size_t t_index) const |
| const PostprocessorValue & | getPostprocessorValueInternal (const std::string ¶m_name, unsigned int index, std::size_t t_index) const |
| const PostprocessorValue & | getPostprocessorValueByNameInternal (const PostprocessorName &name, std::size_t t_index) const |
| const PostprocessorValue & | getPostprocessorValueByNameInternal (const PostprocessorName &name, std::size_t t_index) const |
| void | possiblyCheckHasVectorPostprocessor (const std::string ¶m_name, const std::string &vector_name) const |
| void | possiblyCheckHasVectorPostprocessor (const std::string ¶m_name, const std::string &vector_name) const |
| void | possiblyCheckHasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const |
| void | possiblyCheckHasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const |
Static Private Member Functions | |
| static const hit::Node * | getHitNode (const InputParameters ¶ms) |
| static std::string | messagePrefix (const InputParameters ¶ms, const bool hit_prefix) |
Fixed-horizon actor-critic trainer that collects trajectories from MOOSE reporters and runs a PPO update on top of reusable RL-core components (observation history, trajectory buffer, mini-batch sampler, value estimator, and PPO loss).
Definition at line 31 of file LibtorchDRLControlTrainer.h.
| LibtorchDRLControlTrainer::LibtorchDRLControlTrainer | ( | const InputParameters & | parameters | ) |
Build the PPO-based DRL trainer.
| parameters | Input parameters for the trainer. |
Definition at line 142 of file LibtorchDRLControlTrainer.C.
|
inline |
Return the current average episodic reward.
Definition at line 54 of file LibtorchDRLControlTrainer.h.
Referenced by DRLRewardReporter::execute().
|
private |
Pull trajectories out of the reporters and append them to the trajectory buffer.
Definition at line 416 of file LibtorchDRLControlTrainer.C.
Referenced by execute().
|
protected |
Compute the average episodic reward statistics for the latest samples.
Definition at line 331 of file LibtorchDRLControlTrainer.C.
Referenced by execute().
|
inline |
Return the current actor network.
Definition at line 79 of file LibtorchDRLControlTrainer.h.
Referenced by LibtorchNeuralNetControlTransfer::execute(), SamplerDRLControlTransfer::execute(), and SamplerDRLControlTransfer::executeToMultiapp().
|
inherited |
Declare model data for loading from file as well as restart.
Definition at line 76 of file RestartableModelInterface.h.
|
overridevirtual |
Pull fresh rollout data from the reporters and trigger training when ready.
Implements GeneralUserObject.
Definition at line 298 of file LibtorchDRLControlTrainer.C.
|
inlinevirtualinherited |
Implements GeneralUserObject.
Reimplemented in SurrogateTrainer, and PODReducedBasisTrainer.
Definition at line 39 of file SurrogateTrainer.h.
|
inherited |
Retrieve model data from the interface.
Definition at line 83 of file RestartableModelInterface.h.
|
inherited |
Get the associated filename.
Definition at line 33 of file RestartableModelInterface.C.
|
private |
Resolve reporter names into cached pointer storage.
| reporter_names | Reporter names to look up. |
| pointer_storage | Output vector that receives the reporter pointers. |
Definition at line 428 of file LibtorchDRLControlTrainer.C.
Referenced by LibtorchDRLControlTrainer().
|
inherited |
Check if the filename parameter is explicitly set (ignoring recover state)
Definition at line 39 of file RestartableModelInterface.C.
Referenced by RestartableModelInterface::hasModelData().
|
inherited |
Check if we need to load model data (if the filename parameter is used)
Definition at line 45 of file RestartableModelInterface.C.
|
inlinevirtualinherited |
Implements GeneralUserObject.
Reimplemented in ActiveLearningGaussianProcess, SurrogateTrainer, and PODReducedBasisTrainer.
Definition at line 38 of file SurrogateTrainer.h.
|
inline |
Return the number of observation time levels stacked into the network inputs.
Definition at line 94 of file LibtorchDRLControlTrainer.h.
Referenced by SamplerDRLControlTransfer::getDRLControl().
|
inlineinherited |
Accessor for the name of the model meta data.
Definition at line 47 of file RestartableModelInterface.h.
Referenced by MappingOutput::output(), and SurrogateTrainerOutput::output().
|
inline |
Return the number of control signals produced by the actor.
Definition at line 104 of file LibtorchDRLControlTrainer.h.
Referenced by SamplerDRLControlTransfer::getDRLControl().
|
inline |
Return the number of observation reporters read at each time level.
Definition at line 99 of file LibtorchDRLControlTrainer.h.
Referenced by SamplerDRLControlTransfer::getDRLControl().
|
protected |
Reset the stored rollout data after an update.
Definition at line 409 of file LibtorchDRLControlTrainer.C.
Referenced by execute().
|
inline |
Return per-sample mean episodic rewards from the latest update window.
Definition at line 63 of file LibtorchDRLControlTrainer.h.
Referenced by DRLRewardReporter::execute().
|
inline |
Return per-sample episodic reward standard deviations from the latest update window.
Definition at line 68 of file LibtorchDRLControlTrainer.h.
Referenced by DRLRewardReporter::execute().
|
inline |
Return the trainer seed used for sampling and shuffling.
Definition at line 84 of file LibtorchDRLControlTrainer.h.
Referenced by SamplerDRLControlTransfer::executeToMultiapp().
|
inline |
Return the current episodic reward standard deviation.
Definition at line 58 of file LibtorchDRLControlTrainer.h.
Referenced by DRLRewardReporter::execute().
|
inlinefinalvirtualinherited |
Reimplemented from GeneralUserObject.
Definition at line 40 of file SurrogateTrainer.h.
|
inline |
Return the number of raw reporter entries per training transition.
Definition at line 89 of file LibtorchDRLControlTrainer.h.
Referenced by SamplerDRLControlTransfer::getDRLControl().
| void LibtorchDRLControlTrainer::trainController | ( | const LibtorchRLTrajectoryBuffer::TensorBatch & | batch | ) |
Run the PPO update on a flattened on-policy batch.
| batch | Flattened trajectory batch to train on. |
Definition at line 341 of file LibtorchDRLControlTrainer.C.
Referenced by execute().
|
static |
Return the input parameters supported by this trainer.
Definition at line 18 of file LibtorchDRLControlTrainer.C.
|
protected |
Control reporter names.
Definition at line 131 of file LibtorchDRLControlTrainer.h.
Referenced by LibtorchDRLControlTrainer(), and numberOfControlSignals().
|
protected |
Multiplicative action scaling embedded in the actor outputs.
Definition at line 134 of file LibtorchDRLControlTrainer.h.
Referenced by LibtorchDRLControlTrainer().
|
protected |
Pointers to the current values of the control signals We can have multiple control signals, multiple samples, multiple timesteps.
Definition at line 138 of file LibtorchDRLControlTrainer.h.
Referenced by collectTrajectoriesFromReporters(), and LibtorchDRLControlTrainer().
|
protected |
Adam optimizer used to update the actor network.
Definition at line 239 of file LibtorchDRLControlTrainer.h.
Referenced by LibtorchDRLControlTrainer(), and trainController().
|
protected |
Storage for the current average episode reward.
Definition at line 205 of file LibtorchDRLControlTrainer.h.
Referenced by averageEpisodeReward(), computeEpisodeRewardStatistics(), and execute().
|
protected |
Average rewards over each reporter timestep window instead of sampling one boundary value.
Definition at line 202 of file LibtorchDRLControlTrainer.h.
|
protected |
The clip parameter used while clamping the advantage value.
Definition at line 181 of file LibtorchDRLControlTrainer.h.
|
protected |
The learning rate for the optimization algorithm for the control.
Definition at line 175 of file LibtorchDRLControlTrainer.h.
Referenced by LibtorchDRLControlTrainer().
|
protected |
Pointer to the control (or actor) neural net object.
Definition at line 229 of file LibtorchDRLControlTrainer.h.
Referenced by controlNeuralNet(), execute(), LibtorchDRLControlTrainer(), and trainController().
|
protected |
The learning rate for the optimization algorithm for the critic.
Definition at line 169 of file LibtorchDRLControlTrainer.h.
Referenced by LibtorchDRLControlTrainer().
|
protected |
Pointer to the critic neural net object.
Definition at line 231 of file LibtorchDRLControlTrainer.h.
Referenced by execute(), LibtorchDRLControlTrainer(), and trainController().
|
protected |
Adam optimizer used to update the critic network.
Definition at line 241 of file LibtorchDRLControlTrainer.h.
Referenced by LibtorchDRLControlTrainer(), and trainController().
|
protected |
Decaying factor that is used when calculating the return from the reward.
Definition at line 184 of file LibtorchDRLControlTrainer.h.
|
protected |
Entropy bonus coefficient used in the PPO actor loss.
Definition at line 236 of file LibtorchDRLControlTrainer.h.
|
protected |
Name of the pytorch output file.
This is used for loading and storing already existing data
Definition at line 190 of file LibtorchDRLControlTrainer.h.
Referenced by LibtorchDRLControlTrainer().
|
protected |
Best average episode reward seen so far while training.
Definition at line 234 of file LibtorchDRLControlTrainer.h.
Referenced by execute(), and trainController().
|
protected |
Number of timesteps to fetch from the reporters to be the input of then eural nets.
Definition at line 155 of file LibtorchDRLControlTrainer.h.
Referenced by inputTimesteps(), and LibtorchDRLControlTrainer().
|
protected |
GAE lambda factor used while estimating advantages and returns.
Definition at line 186 of file LibtorchDRLControlTrainer.h.
|
protected |
Log probability reporter names.
Definition at line 141 of file LibtorchDRLControlTrainer.h.
Referenced by LibtorchDRLControlTrainer().
|
protected |
Pointers to the current values of the control log probabilities We can have multiple control signals, multiple samples, multiple timesteps.
Definition at line 145 of file LibtorchDRLControlTrainer.h.
Referenced by collectTrajectoriesFromReporters(), and LibtorchDRLControlTrainer().
|
protected |
The frequency the loss should be printed.
Definition at line 218 of file LibtorchDRLControlTrainer.h.
Referenced by trainController().
|
protected |
Optional upper bounds for each control signal.
Definition at line 226 of file LibtorchDRLControlTrainer.h.
Referenced by LibtorchDRLControlTrainer().
|
protected |
Optional lower bounds for each control signal.
Definition at line 224 of file LibtorchDRLControlTrainer.h.
Referenced by LibtorchDRLControlTrainer().
|
privateinherited |
The model meta data name.
This is used to store the restartable data within the RestartableDataMap.
Definition at line 64 of file RestartableModelInterface.h.
Referenced by RestartableModelInterface::modelMetaDataName(), and RestartableModelInterface::RestartableModelInterface().
|
privateinherited |
Reference to the MooseObject that uses this interface.
Definition at line 60 of file RestartableModelInterface.h.
Referenced by RestartableModelInterface::getModelDataFileName(), RestartableModelInterface::hasExplicitModelData(), RestartableModelInterface::hasModelData(), and RestartableModelInterface::RestartableModelInterface().
|
privateinherited |
Member for interfacing with the framework's restartable system.
We need this because we would like to have the capability to handle the model data separately from the other data members used for checkpointing.
Definition at line 71 of file RestartableModelInterface.h.
Referenced by RestartableModelInterface::declareModelData(), and RestartableModelInterface::getModelData().
|
protected |
Number of neurons within the hidden layers in the control neural net.
Definition at line 172 of file LibtorchDRLControlTrainer.h.
Referenced by LibtorchDRLControlTrainer().
|
protected |
Number of neurons within the hidden layers in the critic neural net.
Definition at line 166 of file LibtorchDRLControlTrainer.h.
Referenced by LibtorchDRLControlTrainer().
|
protected |
Number of epochs for the training of the emulator.
Definition at line 163 of file LibtorchDRLControlTrainer.h.
Referenced by trainController().
|
protected |
Number of inputs for the control and critic neural nets.
Definition at line 158 of file LibtorchDRLControlTrainer.h.
Referenced by LibtorchDRLControlTrainer().
|
protected |
Number of outputs for the control neural network.
Definition at line 160 of file LibtorchDRLControlTrainer.h.
Referenced by LibtorchDRLControlTrainer().
|
private |
PPO loss helper for the actor and critic updates.
Definition at line 270 of file LibtorchDRLControlTrainer.h.
Referenced by trainController().
|
protected |
Switch indicating if an already existing neural net should be read from a file or not.
This can be used to load existing torch files (from previous MOOSE runs for retraining and further manipulation)
Definition at line 195 of file LibtorchDRLControlTrainer.h.
Referenced by LibtorchDRLControlTrainer().
|
protected |
Reward reporter name.
Definition at line 148 of file LibtorchDRLControlTrainer.h.
|
protected |
Pointer to the current values of the reward We can have multiple samples, multiple timesteps.
Definition at line 152 of file LibtorchDRLControlTrainer.h.
Referenced by collectTrajectoriesFromReporters().
|
protected |
Per-sample mean episodic rewards over the latest update window.
Definition at line 210 of file LibtorchDRLControlTrainer.h.
Referenced by computeEpisodeRewardStatistics(), and sampleAverageEpsiodeRewards().
|
protected |
Per-sample episodic reward standard deviations over the latest update window.
Definition at line 212 of file LibtorchDRLControlTrainer.h.
Referenced by computeEpisodeRewardStatistics(), and sampleStdEpsiodeRewards().
|
private |
Mini-batch sampler used to split flattened rollout data for PPO updates.
Definition at line 266 of file LibtorchDRLControlTrainer.h.
Referenced by trainController().
|
protected |
Base seed for stochastic optimizers and policy sampling.
Definition at line 221 of file LibtorchDRLControlTrainer.h.
Referenced by LibtorchDRLControlTrainer(), seed(), and trainController().
|
protected |
Currently, the controls are executed after the user objects at initial in moose.
So using a shift can realign the corresponding input-output values while reading the reporters
Definition at line 200 of file LibtorchDRLControlTrainer.h.
|
protected |
Switch to enable the standardization of the advantages.
Definition at line 215 of file LibtorchDRLControlTrainer.h.
Referenced by trainController().
|
protected |
Observation reporter names.
Definition at line 118 of file LibtorchDRLControlTrainer.h.
Referenced by LibtorchDRLControlTrainer(), and numberOfObservations().
|
protected |
Scaling constants for the observations.
Definition at line 128 of file LibtorchDRLControlTrainer.h.
Referenced by LibtorchDRLControlTrainer().
|
protected |
Shifting constants for the observations.
Definition at line 125 of file LibtorchDRLControlTrainer.h.
Referenced by LibtorchDRLControlTrainer().
|
protected |
Pointers to the current values of the observations We can have multiple observations, multiple samples, multiple timesteps.
Definition at line 122 of file LibtorchDRLControlTrainer.h.
Referenced by collectTrajectoriesFromReporters(), and LibtorchDRLControlTrainer().
|
protected |
Storage for the current episode reward standard deviation.
Definition at line 207 of file LibtorchDRLControlTrainer.h.
Referenced by computeEpisodeRewardStatistics(), execute(), and stdEpisodeReward().
|
private |
Builds rollout trajectories from the raw reporter sequences.
Definition at line 262 of file LibtorchDRLControlTrainer.h.
Referenced by collectTrajectoriesFromReporters().
|
private |
Accumulated on-policy rollout data waiting to be flattened and trained on.
Definition at line 264 of file LibtorchDRLControlTrainer.h.
Referenced by collectTrajectoriesFromReporters(), computeEpisodeRewardStatistics(), execute(), and resetData().
|
private |
Counter for number of transient simulations that have been run before updating the controller.
Definition at line 259 of file LibtorchDRLControlTrainer.h.
Referenced by execute(), and resetData().
|
protected |
Number of transients to run and collect data from before updating the controller neural net.
Definition at line 178 of file LibtorchDRLControlTrainer.h.
Referenced by resetData().
|
private |
Helper that builds value targets and advantages from collected trajectories.
Definition at line 268 of file LibtorchDRLControlTrainer.h.
Referenced by execute().