Implementation of various Q-Learning algorithms, such as DQN, double DQN. More...
Public Types | |
| using | ActionType = typename EnvironmentType::Action |
| Convenient typedef for action. More... | |
| using | StateType = typename EnvironmentType::State |
| Convenient typedef for state. More... | |
Public Member Functions | |
| QLearning (TrainingConfig config, NetworkType network, PolicyType policy, ReplayType replayMethod, UpdaterType updater=UpdaterType(), EnvironmentType environment=EnvironmentType()) | |
| Create the QLearning object with given settings. More... | |
| ~QLearning () | |
| Clean memory. More... | |
| bool & | Deterministic () |
| Modify the training mode / test mode indicator. More... | |
| const bool & | Deterministic () const |
| Get the indicator of training mode / test mode. More... | |
| EnvironmentType & | Environment () |
| Modify the environment in which the agent is. More... | |
| const EnvironmentType & | Environment () const |
| Get the environment in which the agent is. More... | |
| double | Episode () |
| Execute an episode. More... | |
| const NetworkType & | Network () const |
| Return the learning network. More... | |
| NetworkType & | Network () |
| Modify the learning network. More... | |
| StateType & | State () |
| Modify the state of the agent. More... | |
| const StateType & | State () const |
| Get the state of the agent. More... | |
| double | Step () |
| Execute a step in an episode. More... | |
| const size_t & | TotalSteps () const |
Implementation of various Q-Learning algorithms, such as DQN, double DQN.
For more details, see the following:
| EnvironmentType | The environment of the reinforcement learning task. |
| NetworkType | The network to compute action value. |
| UpdaterType | How to apply gradients when training. |
| PolicyType | Behavior policy of the agent. |
| ReplayType | Experience replay method. |
Definition at line 58 of file q_learning.hpp.
| using ActionType = typename EnvironmentType::Action |
Convenient typedef for action.
Definition at line 65 of file q_learning.hpp.
| using StateType = typename EnvironmentType::State |
Convenient typedef for state.
Definition at line 62 of file q_learning.hpp.
| QLearning | ( | TrainingConfig | config, |
| NetworkType | network, | ||
| PolicyType | policy, | ||
| ReplayType | replayMethod, | ||
| UpdaterType | updater = UpdaterType(), |
||
| EnvironmentType | environment = EnvironmentType() |
||
| ) |
Create the QLearning object with given settings.
If you want to pass in a parameter and discard the original parameter object, be sure to use std::move to avoid unnecessary copy.
| config | Hyper-parameters for training. |
| network | The network to compute action value. |
| policy | Behavior policy of the agent. |
| replayMethod | Experience replay method. |
| updater | How to apply gradients when training. |
| environment | Reinforcement learning task. |
| ~QLearning | ( | ) |
Clean memory.
|
inline |
Modify the training mode / test mode indicator.
Definition at line 120 of file q_learning.hpp.
|
inline |
Get the indicator of training mode / test mode.
Definition at line 122 of file q_learning.hpp.
|
inline |
Modify the environment in which the agent is.
Definition at line 115 of file q_learning.hpp.
|
inline |
Get the environment in which the agent is.
Definition at line 117 of file q_learning.hpp.
| double Episode | ( | ) |
Execute an episode.
|
inline |
Return the learning network.
Definition at line 125 of file q_learning.hpp.
|
inline |
Modify the learning network.
Definition at line 127 of file q_learning.hpp.
|
inline |
Modify the state of the agent.
Definition at line 110 of file q_learning.hpp.
|
inline |
Get the state of the agent.
Definition at line 112 of file q_learning.hpp.
| double Step | ( | ) |
Execute a step in an episode.
|
inline |
Definition at line 107 of file q_learning.hpp.