bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
reinforce_config.h
Go to the documentation of this file.
1#ifndef REINFORCE_CONFIG_H
2#define REINFORCE_CONFIG_H
3
7
8#include <ostream>
9#include <string>
10
11namespace bitrl
12{
13namespace rl
14{
15namespace algos
16{
17namespace pg
18{
19
24{
25 NONE = -1,
27 MEAN = 1,
29};
30
94
95inline std::ostream &operator<<(std::ostream &out, ReinforceConfig opts) { return opts.print(out); }
96
97} // namespace pg
98} // namespace algos
99} // namespace rl
100} // namespace bitrl
101
102#endif
Definition a2c.h:37
std::ostream & operator<<(std::ostream &out, const A2CConfig &opts)
Definition a2c_config.h:117
BaselineEnumType
Enumeration of the baseline types supported.
Definition reinforce_config.h:24
@ STANDARDIZE
Definition reinforce_config.h:28
@ MEAN
Definition reinforce_config.h:27
@ CONSTANT
Definition reinforce_config.h:26
@ NONE
Definition reinforce_config.h:25
Definition dp_algo_base.h:15
Definition dummy_agent.h:9
TrainEnumType
Enumeration of train type.
Definition train_enum_type.h:17
@ BATCH
Definition train_enum_type.h:19
Various utilities used when working with RL problems.
Definition bitrl_log.h:25
const real_t TOLERANCE
Tolerance used around the library.
Definition bitsim_consts.h:26
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 ReinforceOpts struct. Holds various configuration options for the Reinforce algorithm.
Definition reinforce_config.h:37
std::ostream & print(std::ostream &out) const
print
real_t gamma
The discount factor.
Definition reinforce_config.h:69
BaselineEnumType baseline_type
The baseline to use.
Definition reinforce_config.h:48
bool normalize_rewards
Definition reinforce_config.h:38
real_t baseline_constant
The constant to use when baseline_type = BaselineEnumType::CONSTANT.
Definition reinforce_config.h:74
void load_from_json(const std::string &filename)
Load the configuration from the given json file.
DeviceType device_type
The device type that PyTorch calculations take place.
Definition reinforce_config.h:53
bitrl::utils::TrainEnumType train_type
How to train the algorithm.
Definition reinforce_config.h:43
uint_t n_episodes
The number of episodes.
Definition reinforce_config.h:58
real_t eps
Small constant to use as tolerance Used when baseline_type = BaselineEnumType::STANDARDIZE.
Definition reinforce_config.h:80
uint_t max_itrs_per_episode
Max number of iterations per episode.
Definition reinforce_config.h:64