|
bitsim
Model, simulate, estimate and control robots in C++
|
The EpsilonGreedyPolicy class. More...
#include <epsilon_greedy_policy.h>
Public Types | |
| typedef uint_t | output_type |
| The type returned when calling this->operator(). | |
Public Member Functions | |
| 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. | |
| 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 |
| 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 | |
| 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. | |
Static Public Attributes | |
| static constexpr real_t | MIN_EPS = 0.01 |
| static constexpr real_t | MAX_EPS = 1.0 |
| static constexpr real_t | EPSILON_DECAY_FACTOR = 0.01 |
The EpsilonGreedyPolicy class.
The type returned when calling this->operator().
Constructor. Creates an epsilon-greedy tabular policy.
|
inlineexplicit |
Constructor. Creates an epsilon-greedy tabular policy.
|
inlineexplicit |
Constructor Creates an epsilon greedy policy with an epsilon decay strategy.
|
inlinenoexcept |
Returns the decay option.
|
inlinenoexcept |
Returns the value of the epsilon.
| output_type bitrl::rl::policies::EpsilonGreedyPolicy::get_action | ( | const MatType & | q_map, |
| uint_t | state_idx ) |
get_action. Given a
| EpsilonGreedyPolicy::output_type bitrl::rl::policies::EpsilonGreedyPolicy::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
|
noexcept |
any actions the policy should perform on the given episode index
| output_type bitrl::rl::policies::EpsilonGreedyPolicy::operator() | ( | const MapType & | q_map, |
| uint_t | state ) const |
operator() Select action for the given state
| output_type bitrl::rl::policies::EpsilonGreedyPolicy::operator() | ( | const torch_tensor_t & | vec, |
| torch_tensor_value_type< float_t > | ) const |
| output_type bitrl::rl::policies::EpsilonGreedyPolicy::operator() | ( | const torch_tensor_t & | vec, |
| torch_tensor_value_type< int_t > | ) const |
| output_type bitrl::rl::policies::EpsilonGreedyPolicy::operator() | ( | const torch_tensor_t & | vec, |
| torch_tensor_value_type< lint_t > | ) const |
| output_type bitrl::rl::policies::EpsilonGreedyPolicy::operator() | ( | const torch_tensor_t & | vec, |
| torch_tensor_value_type< real_t > | ) const |
| EpsilonGreedyPolicy::output_type bitrl::rl::policies::EpsilonGreedyPolicy::operator() | ( | const VecType & | vec | ) | const |
Get an action i.e. index from the given values.
|
inlinenoexcept |
Reset the policy.
Set the epsilon value.
| eps |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |