bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
rl_example_12 Namespace Reference

Classes

class  QNetImpl
class  Gridworld
class  RLSerialAgentTrainer
struct  RLSerialTrainerConfig
 The RLSerialTrainerConfig struct. Configuration struct for the serial RL agent trainer. More...
class  EpsilonGreedyPolicy
 The EpsilonGreedyPolicy class. More...
class  CSVWriter
 The CSVWriter class. Handles writing into CSV file format. More...
class  ExperienceBuffer
 The ExperienceBuffer class. A buffer based on boost::circular_buffer to accumulate items of type ExperienceType. see for example the A2C algorithm in A2C.h and rl_example_15. More...

Typedefs

typedef Gridworld< 4 > env_type
typedef env_type::state_type state_type
typedef env_type::time_step_type time_step_type
typedef std::tuple< std::vector< float_t >, uint_t, float_t, std::vector< float_t >, uint_t > experience_tuple_type
typedef bitrl::utils::ExperienceBuffer< experience_tuple_type > experience_buffer_type
using float_t
 float
using real_t
 real_t
typedef torch::Tensor torch_tensor_t
 torch_tensor_t
using uint_t
 uint_t
using float_t
 float
using int_t
 integer type
using real_t
 real_t
typedef torch::Tensor torch_tensor_t
 torch_tensor_t
using uint_t
 uint_t

Functions

 TORCH_MODULE (QNet)
std::vector< float_t > flattened_observation (const state_type &state)
template<typename T, uint_t index>
std::vector< T > get (const std::vector< experience_tuple_type > &experience)

Variables

const std::string EXPERIMENT_ID = "3"
constexpr uint_t l1 = 64
constexpr uint_t l2 = 150
constexpr uint_t l3 = 100
constexpr uint_t l4 = 4
constexpr uint_t SEED = 42
constexpr uint_t TOTAL_EPOCHS = 1000
constexpr uint_t TOTAL_ITRS_PER_EPOCH = 50
constexpr real_t GAMMA = 0.9
constexpr real_t EPSILON = 1.0
constexpr real_t LEARNING_RATE = 1.0e-3
constexpr uint_t BATCH_SIZE = 200
constexpr uint_t EXPERIENCE_BUFFER_SIZE = 1000

Detailed Description

Use DQN on Gridworld

Typedef Documentation

◆ env_type

◆ experience_buffer_type

◆ experience_tuple_type

typedef std::tuple<std::vector<float_t>, uint_t, float_t, std::vector<float_t>, uint_t> rl_example_12::experience_tuple_type

◆ float_t [1/2]

float

◆ float_t [2/2]

float

◆ int_t

integer type

◆ real_t [1/2]

◆ real_t [2/2]

◆ state_type

◆ time_step_type

◆ torch_tensor_t [1/2]

typedef torch::Tensor bitrl::torch_tensor_t

◆ torch_tensor_t [2/2]

typedef torch::Tensor bitrl::torch_tensor_t

◆ uint_t [1/2]

◆ uint_t [2/2]

Function Documentation

◆ flattened_observation()

std::vector< float_t > rl_example_12::flattened_observation ( const state_type & state)

◆ get()

template<typename T, uint_t index>
std::vector< T > rl_example_12::get ( const std::vector< experience_tuple_type > & experience)

◆ TORCH_MODULE()

rl_example_12::TORCH_MODULE ( QNet )

Variable Documentation

◆ BATCH_SIZE

uint_t rl_example_12::BATCH_SIZE = 200
constexpr

◆ EPSILON

real_t rl_example_12::EPSILON = 1.0
constexpr

◆ EXPERIENCE_BUFFER_SIZE

uint_t rl_example_12::EXPERIENCE_BUFFER_SIZE = 1000
constexpr

◆ EXPERIMENT_ID

const std::string rl_example_12::EXPERIMENT_ID = "3"

◆ GAMMA

real_t rl_example_12::GAMMA = 0.9
constexpr

◆ l1

uint_t rl_example_12::l1 = 64
constexpr

◆ l2

uint_t rl_example_12::l2 = 150
constexpr

◆ l3

uint_t rl_example_12::l3 = 100
constexpr

◆ l4

uint_t rl_example_12::l4 = 4
constexpr

◆ LEARNING_RATE

real_t rl_example_12::LEARNING_RATE = 1.0e-3
constexpr

◆ SEED

uint_t rl_example_12::SEED = 42
constexpr

◆ TOTAL_EPOCHS

uint_t rl_example_12::TOTAL_EPOCHS = 1000
constexpr

◆ TOTAL_ITRS_PER_EPOCH

uint_t rl_example_12::TOTAL_ITRS_PER_EPOCH = 50
constexpr