The EpsilonGreedyPolicy class.
More...
#include <epsilon_greedy_policy.h>
|
| | EpsilonGreedyPolicy (real_t eps) |
| | Constructor. Creates an epsilon-greedy tabular policy.
|
| | EpsilonGreedyPolicy (real_t eps, uint_t seed) |
| | Constructor. Creates an epsilon-greedy tabular policy.
|
| | EpsilonGreedyPolicy (real_t eps, uint_t seed, EpsilonDecayOption decay_op, real_t min_eps=MIN_EPS, real_t max_eps=MAX_EPS, real_t epsilon_decay=EPSILON_DECAY_FACTOR) |
| | Constructor Creates an epsilon greedy policy with an epsilon decay strategy.
|
| template<typename MapType> |
| output_type | operator() (const MapType &q_map, uint_t state) const |
| | operator() Select action for the given state
|
| template<typename VecType> |
| output_type | operator() (const VecType &vec) const |
| | Get an action i.e. index from the given values.
|
| template<typename MatType> |
| output_type | get_action (const MatType &q_map, uint_t state_idx) |
| | get_action. Given a
|
| template<typename VecTp> |
| output_type | get_action (const VecTp &q_map) |
| | get_action. Given a vector always returns the position of the maximum occuring element. If the given vector is empty returns CubeAIConsts::invalid_size_type
|
| output_type | operator() (const torch_tensor_t &vec, torch_tensor_value_type< real_t >) const |
| output_type | operator() (const torch_tensor_t &vec, torch_tensor_value_type< float_t >) const |
| output_type | operator() (const torch_tensor_t &vec, torch_tensor_value_type< int_t >) const |
| output_type | operator() (const torch_tensor_t &vec, torch_tensor_value_type< lint_t >) const |
| void | on_episode (uint_t episode_idx) noexcept |
| | any actions the policy should perform on the given episode index
|
| void | reset () noexcept |
| | Reset the policy.
|
| real_t | eps_value () const noexcept |
| | Returns the value of the epsilon.
|
| void | set_eps_value (real_t eps) |
| | Set the epsilon value.
|
| EpsilonDecayOption | decay_option () const noexcept |
| | Returns the decay option.
|
◆ output_type
The type returned when calling this->operator().
◆ EpsilonGreedyPolicy() [1/3]
| bitrl::rl::policies::EpsilonGreedyPolicy::EpsilonGreedyPolicy |
( |
real_t | eps | ) |
|
|
inline |
Constructor. Creates an epsilon-greedy tabular policy.
◆ EpsilonGreedyPolicy() [2/3]
| bitrl::rl::policies::EpsilonGreedyPolicy::EpsilonGreedyPolicy |
( |
real_t | eps, |
|
|
uint_t | seed ) |
|
inlineexplicit |
Constructor. Creates an epsilon-greedy tabular policy.
◆ EpsilonGreedyPolicy() [3/3]
Constructor Creates an epsilon greedy policy with an epsilon decay strategy.
◆ decay_option()
Returns the decay option.
◆ eps_value()
| real_t bitrl::rl::policies::EpsilonGreedyPolicy::eps_value |
( |
| ) |
const |
|
inlinenoexcept |
Returns the value of the epsilon.
◆ get_action() [1/2]
template<typename MatType>
| output_type bitrl::rl::policies::EpsilonGreedyPolicy::get_action |
( |
const MatType & | q_map, |
|
|
uint_t | state_idx ) |
◆ get_action() [2/2]
get_action. Given a vector always returns the position of the maximum occuring element. If the given vector is empty returns CubeAIConsts::invalid_size_type
◆ on_episode()
| void bitrl::rl::policies::EpsilonGreedyPolicy::on_episode |
( |
uint_t | episode_idx | ) |
|
|
noexcept |
any actions the policy should perform on the given episode index
◆ operator()() [1/6]
template<typename MapType>
| output_type bitrl::rl::policies::EpsilonGreedyPolicy::operator() |
( |
const MapType & | q_map, |
|
|
uint_t | state ) const |
operator() Select action for the given state
◆ operator()() [2/6]
◆ operator()() [3/6]
◆ operator()() [4/6]
◆ operator()() [5/6]
◆ operator()() [6/6]
template<typename VecType>
Get an action i.e. index from the given values.
◆ reset()
| void bitrl::rl::policies::EpsilonGreedyPolicy::reset |
( |
| ) |
|
|
inlinenoexcept |
◆ set_eps_value()
| void bitrl::rl::policies::EpsilonGreedyPolicy::set_eps_value |
( |
real_t | eps | ) |
|
Set the epsilon value.
- Parameters
-
◆ EPSILON_DECAY_FACTOR
| real_t bitrl::rl::policies::EpsilonGreedyPolicy::EPSILON_DECAY_FACTOR = 0.01 |
|
staticconstexpr |
◆ MAX_EPS
| real_t bitrl::rl::policies::EpsilonGreedyPolicy::MAX_EPS = 1.0 |
|
staticconstexpr |
◆ MIN_EPS
| real_t bitrl::rl::policies::EpsilonGreedyPolicy::MIN_EPS = 0.01 |
|
staticconstexpr |
The documentation for this class was generated from the following file: