bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
a2c_config.h
Go to the documentation of this file.
1#ifndef A2C_CONFIG_H
2#define A2C_CONFIG_H
3
5//#include "bitsim/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
42
48
53
57 bool clip_policy_grad{false};
58
62 bool clip_critic_grad{false};
63
68
73
78
83
88
93
97 DeviceType device_type{DeviceType::CPU};
98
102 std::string save_model_path{""};
103
109 std::ostream &print(std::ostream &out) const;
110
114 void load_from_json(const std::string &filename);
115};
116
117inline std::ostream &operator<<(std::ostream &out, const A2CConfig &opts)
118{
119 return opts.print(out);
120}
121
122} // namespace pg
123} // namespace algos
124} // namespace rl
125} // namespace bitrl
126
127#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 A2CConfig struct. Configuration for A2CSolver class.
Definition a2c_config.h:26
real_t beta
Coefficient for accounting for entropy contribution.
Definition a2c_config.h:41
bool normalize_advantages
Definition a2c_config.h:92
real_t max_grad_norm_critic
The value to clip the gradient for the actor.
Definition a2c_config.h:72
void load_from_json(const std::string &filename)
Load the configuration from the given json file.
uint_t buffer_size
Definition a2c_config.h:87
uint_t n_episodes
Number of training episodes.
Definition a2c_config.h:77
real_t policy_loss_weight
policy_loss_weight. How much weight to give on the policy loss when forming the global loss
Definition a2c_config.h:47
std::ostream & print(std::ostream &out) const
print
bool clip_policy_grad
Flag indicating whether to clip the policy grad.
Definition a2c_config.h:57
real_t value_loss_weight
Definition a2c_config.h:52
real_t max_grad_norm_policy
The value to clip the gradient for the policy.
Definition a2c_config.h:67
real_t lambda
GAE lambda.
Definition a2c_config.h:36
DeviceType device_type
Definition a2c_config.h:97
std::string save_model_path
Definition a2c_config.h:102
bool clip_critic_grad
Flag indicating whether to clip the critic grad.
Definition a2c_config.h:62
uint_t max_itrs_per_episode
Number of iterations per episode.
Definition a2c_config.h:82
real_t gamma
Discount factor.
Definition a2c_config.h:31