bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
ppo_config.h
Go to the documentation of this file.
1#ifndef PPO_CONFIG_H
2#define PPO_CONFIG_H
3
5//#include "rlenvs/rlenvs_consts.h"
7
8#include <ostream>
9#include <string>
10
11namespace bitrl
12{
13namespace rl
14{
15namespace algos
16{
17namespace pg
18{
19
20// using namespace rlenvscpp::consts;
21
26{
27
32
37
41 bool clip_policy_grad{false};
42
46 bool clip_critic_grad{false};
47
52
57
62
67
72
74
76
81
85 DeviceType device_type{DeviceType::CPU};
86
90 std::string save_model_path{""};
91
97 std::ostream &print(std::ostream &out) const;
98
102 void load_from_json(const std::string &filename);
103};
104
105inline std::ostream &operator<<(std::ostream &out, const PPOConfig &opts)
106{
107 return opts.print(out);
108}
109
110} // namespace pg
111} // namespace algos
112} // namespace rl
113} // namespace bitrl
114
115#endif
Definition a2c.h:37
std::ostream & operator<<(std::ostream &out, const A2CConfig &opts)
Definition a2c_config.h:117
Definition dp_algo_base.h:15
Definition dummy_agent.h:9
Various utilities used when working with RL problems.
Definition bitrl_log.h:25
std::size_t uint_t
uint_t
Definition bitsim_types.h:40
double real_t
real_t
Definition bitsim_types.h:20
DeviceType
Enumeration of various device types.
Definition bitsim_types.h:186
The PPOConfig struct. Configuration for PPOSolver class.
Definition ppo_config.h:26
real_t epsilon
The epsilon factor to use.
Definition ppo_config.h:36
real_t clip_epsilon
Definition ppo_config.h:75
bool clip_policy_grad
Flag indicating whether to clip the policy grad.
Definition ppo_config.h:41
uint_t n_episodes
Number of training episodes.
Definition ppo_config.h:61
std::string save_model_path
Definition ppo_config.h:90
real_t max_grad_norm_policy
The value to clip the gradient for the policy.
Definition ppo_config.h:51
uint_t max_itrs_per_episode
Number of iterations per episode.
Definition ppo_config.h:66
real_t max_grad_norm_critic
The value to clip the gradient for the actor.
Definition ppo_config.h:56
DeviceType device_type
Definition ppo_config.h:85
bool clip_critic_grad
Flag indicating whether to clip the critic grad.
Definition ppo_config.h:46
bool normalize_advantages
Definition ppo_config.h:80
uint_t max_passes_over_batch
Definition ppo_config.h:73
std::ostream & print(std::ostream &out) const
print
uint_t buffer_size
How large the experince buffer should be.
Definition ppo_config.h:71
void load_from_json(const std::string &filename)
Load the configuration from the given json file.
real_t gamma
Discount factor.
Definition ppo_config.h:31