1#ifndef REINFORCE_LOSS_H
2#define REINFORCE_LOSS_H
4#include "bitrl/base/bitrl_config.h"
28 const std::vector<torch_tensor_t> &log_probs);
std::vector< real_t > compute_baseline_with_mean(const std::vector< real_t > &rewards)
Compute the baseline using the mean value of the provided rewards.
std::vector< real_t > compute_baseline_with_standardization(const std::vector< real_t > &rewards, real_t eps=bitsim::consts::TOLERANCE)
Compute the baseline using standarization also known as whitening.
std::vector< torch_tensor_t > compute_loss_item(const std::vector< real_t > &rewards, const std::vector< torch_tensor_t > &log_probs)
compute_loss_item. Compute the product -rewards[i] * log_probs[i]
std::vector< real_t > compute_baseline_with_constant(const std::vector< real_t > &rewards, real_t constant)
Compute the baseline using a user-defined constant value from the given rewards.
Definition dp_algo_base.h:15
Definition dummy_agent.h:9
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
double real_t
real_t
Definition bitsim_types.h:20