bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
dqn_experience_replay.cpp File Reference
#include "bitrl/base/bitrl_config.h"
#include "bitrl/base/bitrl_types.h"
#include "bitrl/maths/optimization/optimizer_type.h"
#include "bitrl/maths/optimization/pytorch_optimizer_factory.h"
#include "bitrl/maths/vector_math.h"
#include "bitrl/rl/policies/epsilon_greedy_policy.h"
#include "bitrl/rl/trainers/rl_serial_agent_trainer.h"
#include "bitrl/utils/torch_adaptor.h"
#include "bitrl/base/bitrl_log.h"
#include "bitrl/envs/grid_world/grid_world_env.h"
#include "bitrl/utils/experience_buffer.h"
#include "bitsim/utils/io/csv_file_writer.h"
#include <torch/torch.h>
#include <any>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <map>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
Include dependency graph for dqn_experience_replay.cpp:

Classes

class  rl_example_12::QNetImpl
class  rl_example_12::ExperienceBuffer< ExperienceType >
 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...

Namespaces

namespace  rl_example_12

Typedefs

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

Functions

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

Variables

constexpr uint_t rl_example_12::BATCH_SIZE = 200
constexpr uint_t rl_example_12::EXPERIENCE_BUFFER_SIZE = 1000

Function Documentation

◆ main()

int main ( )