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

Classes

class  PolicyNetImpl
class  CartPole
 The CartPole class Interface for CartPole environment. More...
class  TorchCategorical
class  RESTRLEnvClient
 Utility class to facilitate HTTP requests between the environments REST API and C++ drivers. More...
class  RLSerialAgentTrainer
struct  RLSerialTrainerConfig
 The RLSerialTrainerConfig struct. Configuration struct for the serial RL agent trainer. More...
struct  ReinforceConfig
 The ReinforceOpts struct. Holds various configuration options for the Reinforce algorithm. More...
class  ReinforceSolver
 The ReinforceSolver class. The ReinforceSolver trains a policy represented by the PolicyTp template parameter on the environment represented by the EnvType parameter. More...

Typedefs

typedef CartPole env_type
typedef PolicyNet policy_type
typedef ReinforceSolver< env_type, PolicyNet > solver_type
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
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

Enumerations

enum class  DeviceType
 Enumeration of various device types. More...
enum class  DeviceType
 Enumeration of various device types. More...
enum class  BaselineEnumType
 Enumeration of the baseline types supported. More...

Functions

 TORCH_MODULE (PolicyNet)

Variables

const std::string SERVER_URL = "http://0.0.0.0:8001/api"
const std::string EXPERIMENT_ID = "2"
const std::string POLICY = "policy.csv"
const uint_t L1 = 4
const uint_t L2 = 128
const uint_t L3 = 2
const real_t LEARNING_RATE = 0.01

Detailed Description

This example illustrates how to use the REINFORCE algorithm on the CartPole environment from Gymnasium

Typedef Documentation

◆ env_type

◆ float_t [1/2]

float

◆ float_t [2/2]

float

◆ int_t [1/2]

integer type

◆ int_t [2/2]

integer type

◆ policy_type

typedef PolicyNet rl_example_13::policy_type

◆ real_t [1/2]

◆ real_t [2/2]

◆ solver_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]

Enumeration Type Documentation

◆ BaselineEnumType

Enumeration of the baseline types supported.

◆ DeviceType [1/2]

enum class bitsim::DeviceType
strong

Enumeration of various device types.

◆ DeviceType [2/2]

enum class bitsim::DeviceType
strong

Enumeration of various device types.

Function Documentation

◆ TORCH_MODULE()

rl_example_13::TORCH_MODULE ( PolicyNet )

Variable Documentation

◆ EXPERIMENT_ID

const std::string rl_example_13::EXPERIMENT_ID = "2"

◆ L1

const uint_t rl_example_13::L1 = 4

◆ L2

const uint_t rl_example_13::L2 = 128

◆ L3

const uint_t rl_example_13::L3 = 2

◆ LEARNING_RATE

const real_t rl_example_13::LEARNING_RATE = 0.01

◆ POLICY

const std::string rl_example_13::POLICY = "policy.csv"

◆ SERVER_URL

const std::string rl_example_13::SERVER_URL = "http://0.0.0.0:8001/api"