https://mooseframework.inl.gov
Loading...
Searching...
No Matches
DRLRewardReporter.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#ifdef MOOSE_LIBTORCH_ENABLED
11
12#pragma once
13
15#include "GeneralReporter.h"
17
22{
23public:
28
33
37 virtual void initialize() override {}
38
42 virtual void finalize() override {}
43
47 virtual void execute() override;
48
49protected:
52
55
57 std::vector<Real> & _sample_average_reward;
58
60 std::vector<Real> & _sample_std_reward;
61
64};
65
66#endif
Reporter which saves the reward values from a Deep Reinforcement Learning controller trainer.
std::vector< Real > & _sample_average_reward
The per-sample average reward values which will be saved.
static InputParameters validParams()
Return the input parameters supported by this reporter.
virtual void finalize() override
Finalize the reporter.
LibtorchDRLControlTrainer & _trainer
The DRL trainer which computes the reward values.
std::vector< Real > & _sample_std_reward
The per-sample reward standard deviations which will be saved.
Real & _std_reward
The standard deviation of the reward values which will be saved.
virtual void initialize() override
Initialize the reporter.
virtual void execute() override
Update the reported reward statistics.
Real & _average_reward
The reward values which will be saved.
Fixed-horizon actor-critic trainer that collects trajectories from MOOSE reporters and runs a PPO upd...
const InputParameters & parameters() const
Interface for objects that need to use samplers.