|
| RandomReplay (const size_t batchSize, const size_t capacity, const size_t nSteps=1, const size_t dimension=StateType::dimension) |
| Construct an instance of random experience replay class. More...
|
|
void | Store (StateType state, ActionType action, double reward, StateType nextState, bool isEnd, const double &discount) |
| Store the given experience. More...
|
|
void | GetNStepInfo (double &reward, StateType &nextState, bool &isEnd, const double &discount) |
| Get the reward, next state and terminal boolean for nth step. More...
|
|
void | Sample (arma::mat &sampledStates, std::vector< ActionType > &sampledActions, arma::rowvec &sampledRewards, arma::mat &sampledNextStates, arma::irowvec &isTerminal) |
| Sample some experiences. More...
|
|
const size_t & | Size () |
| Get the number of transitions in the memory. More...
|
|
void | Update (arma::mat, std::vector< ActionType >, arma::mat, arma::mat &) |
| Update the priorities of transitions and Update the gradients. More...
|
|
const size_t & | NSteps () const |
| Get the number of steps for n-step agent.
|
|
template<typename EnvironmentType>
class mlpack::rl::RandomReplay< EnvironmentType >
Implementation of random experience replay.
At each time step, interactions between the agent and the environment will be saved to a memory buffer. When necessary, we can simply sample previous experiences from the buffer to train the agent. Typically this would be a random sample and the memory will be a First-In-First-Out buffer.
For more information, see the following.
@phdthesis{lin1993reinforcement,
title = {Reinforcement learning for robots using neural networks},
author = {Lin, Long-Ji},
year = {1993},
school = {Fujitsu Laboratories Ltd}
}
- Template Parameters
-
EnvironmentType | Desired task. |