|
bitsim
Model, simulate, estimate and control robots in C++
|
The ReinforceSolver class. The ReinforceSolver trains a policy represented by the PolicyTp template parameter on the environment represented by the EnvType parameter. More...
#include <reinforce.h>


Public Types | |
| typedef EnvType | env_type |
| typedef PolicyType | policy_type |
| typedef env_type::state_type | state_type |
| typedef env_type::action_type | action_type |
| typedef ReinforceMonitor< action_type, state_type >::experience_buffer_type | experience_buffer_type |
| Public Types inherited from bitrl::rl::algos::RLSolverBase< EnvType > | |
| typedef EnvType | env_type |
Public Member Functions | |
| ReinforceSolver (ReinforceConfig opts, policy_type &policy, std::unique_ptr< torch::optim::Optimizer > &policy_optimizer) | |
| ReinforceSolver. Constructor. | |
| virtual void | actions_before_training_begins (env_type &) |
| actions_before_training_begins. Execute any actions the algorithm needs before starting the iterations | |
| virtual void | actions_after_training_ends (env_type &) |
| actions_after_training_ends. Actions to execute after the training iterations have finisehd | |
| virtual void | actions_before_episode_begins (env_type &, uint_t) |
| actions_before_training_episode | |
| virtual void | actions_after_episode_ends (env_type &, uint_t, const EpisodeInfo &) |
| actions_after_training_episode | |
| virtual EpisodeInfo | on_training_episode (env_type &, uint_t) |
| on_episode Do one on_episode of the algorithm | |
| ReinforceMonitor< action_type, state_type > & | get_monitor () |
| Read-write access to the monitor object. | |
| Public Member Functions inherited from bitrl::rl::algos::RLSolverBase< EnvType > | |
| virtual | ~RLSolverBase ()=default |
| Destructor. | |
| virtual void | actions_after_episode_ends (env_type &, uint_t, const EpisodeInfo &) |
| actions_after_training_episode | |
Additional Inherited Members | |
| Protected Member Functions inherited from bitrl::rl::algos::RLSolverBase< EnvType > | |
| RLSolverBase ()=default | |
| Constructor. | |
The ReinforceSolver class. The ReinforceSolver trains a policy represented by the PolicyTp template parameter on the environment represented by the EnvType parameter.
The PolicyType should expose an act method with the following signature
std::tuple[ActioType, torch::Tensor> act(StateType)
| typedef env_type::action_type bitrl::rl::algos::pg::ReinforceSolver< EnvType, PolicyType >::action_type |
| typedef EnvType bitrl::rl::algos::pg::ReinforceSolver< EnvType, PolicyType >::env_type |
| typedef ReinforceMonitor<action_type,state_type>::experience_buffer_type bitrl::rl::algos::pg::ReinforceSolver< EnvType, PolicyType >::experience_buffer_type |
| typedef PolicyType bitrl::rl::algos::pg::ReinforceSolver< EnvType, PolicyType >::policy_type |
| typedef env_type::state_type bitrl::rl::algos::pg::ReinforceSolver< EnvType, PolicyType >::state_type |
| bitrl::rl::algos::pg::ReinforceSolver< EnvType, PolicyType >::ReinforceSolver | ( | ReinforceConfig | opts, |
| policy_type & | policy, | ||
| std::unique_ptr< torch::optim::Optimizer > & | policy_optimizer ) |
ReinforceSolver. Constructor.
|
inlinevirtual |
actions_after_training_episode
|
inlinevirtual |
actions_after_training_ends. Actions to execute after the training iterations have finisehd
Implements bitrl::rl::algos::RLSolverBase< EnvType >.
|
inlinevirtual |
actions_before_training_episode
Reimplemented from bitrl::rl::algos::RLSolverBase< EnvType >.
|
virtual |
actions_before_training_begins. Execute any actions the algorithm needs before starting the iterations
Implements bitrl::rl::algos::RLSolverBase< EnvType >.
|
inline |
Read-write access to the monitor object.
|
virtual |
on_episode Do one on_episode of the algorithm
Implements bitrl::rl::algos::RLSolverBase< EnvType >.