bitrl & cuberl Documentation
Simulation engine for reinforcement learning agents
Loading...
Searching...
No Matches
reinforce_loss.h
Go to the documentation of this file.
1#ifndef REINFORCE_LOSS_H
2#define REINFORCE_LOSS_H
3
4#include "cuberl/base/cubeai_config.h"
5
6#ifdef USE_PYTORCH
7
10
11#include <vector>
12
13namespace cuberl {
14namespace rl {
15namespace algos {
16namespace pg {
17
18 //using namespace bitrl::consts;
19
23std::vector<torch_tensor_t>
24compute_loss_item(const std::vector<real_t>& rewards,
25 const std::vector<torch_tensor_t>& log_probs);
26
31std::vector<real_t>
32compute_baseline_with_constant(const std::vector<real_t>& rewards,
33 real_t constant);
34
35
40std::vector<real_t>
41compute_baseline_with_mean(const std::vector<real_t>& rewards);
42
47std::vector<real_t>
48compute_baseline_with_standardization(const std::vector<real_t>& rewards,
50
51}
52}
53}
54}
55
56
57#endif
58#endif
const real_t TOLERANCE
Tolerance used around the library.
Definition bitrl_consts.h:31
double real_t
real_t
Definition bitrl_types.h:23
Various utilities used when working with RL problems.
Definition cuberl_types.h:16