13 #ifndef MLPACK_METHODS_RL_Q_LEARNING_HPP 14 #define MLPACK_METHODS_RL_Q_LEARNING_HPP 52 typename EnvironmentType,
56 typename ReplayType = RandomReplay<EnvironmentType>
83 ReplayType replayMethod,
84 UpdaterType updater = UpdaterType(),
85 EnvironmentType environment = EnvironmentType());
117 const EnvironmentType&
Environment()
const {
return environment; }
125 const NetworkType&
Network()
const {
return learningNetwork; }
127 NetworkType&
Network() {
return learningNetwork; }
135 arma::Col<size_t> BestAction(
const arma::mat& actionValues);
141 NetworkType learningNetwork;
144 NetworkType targetNetwork;
148 #if ENS_VERSION_MAJOR >= 2 149 typename UpdaterType::template Policy<arma::mat, arma::mat>* updatePolicy;
156 ReplayType replayMethod;
159 EnvironmentType environment;
175 #include "q_learning_impl.hpp" NetworkType & Network()
Modify the learning network.
typename EnvironmentType::Action ActionType
Convenient typedef for action.
QLearning(TrainingConfig config, NetworkType network, PolicyType policy, ReplayType replayMethod, UpdaterType updater=UpdaterType(), EnvironmentType environment=EnvironmentType())
Create the QLearning object with given settings.
bool & Deterministic()
Modify the training mode / test mode indicator.
The core includes that mlpack expects; standard C++ includes and Armadillo.
double Episode()
Execute an episode.
EnvironmentType & Environment()
Modify the environment in which the agent is.
typename EnvironmentType::State StateType
Convenient typedef for state.
const EnvironmentType & Environment() const
Get the environment in which the agent is.
const NetworkType & Network() const
Return the learning network.
const bool & Deterministic() const
Get the indicator of training mode / test mode.
const size_t & TotalSteps() const
Implementation of various Q-Learning algorithms, such as DQN, double DQN.
StateType & State()
Modify the state of the agent.
~QLearning()
Clean memory.
const StateType & State() const
Get the state of the agent.
double Step()
Execute a step in an episode.