#include <simple_dqn.hpp>
|
| SimpleDQN () |
| Default constructor.
|
|
| SimpleDQN (const int inputDim, const int h1, const int h2, const int outputDim, const bool isNoisy=false, InitType init=InitType(), OutputLayerType outputLayer=OutputLayerType()) |
| Construct an instance of SimpleDQN class. More...
|
|
| SimpleDQN (NetworkType &network, const bool isNoisy=false) |
| Construct an instance of SimpleDQN class from a pre-constructed network. More...
|
|
void | Predict (const arma::mat state, arma::mat &actionValue) |
| Predict the responses to a given set of predictors. More...
|
|
void | Forward (const arma::mat state, arma::mat &target) |
| Perform the forward pass of the states in real batch mode. More...
|
|
void | ResetParameters () |
| Resets the parameters of the network.
|
|
void | ResetNoise () |
| Resets noise of the network, if the network is of type noisy.
|
|
const arma::mat & | Parameters () const |
| Return the Parameters.
|
|
arma::mat & | Parameters () |
| Modify the Parameters.
|
|
void | Backward (const arma::mat state, arma::mat &target, arma::mat &gradient) |
| Perform the backward pass of the state in real batch mode. More...
|
|
template<typename OutputLayerType = MeanSquaredError<>, typename InitType = GaussianInitialization, typename NetworkType = FFN<OutputLayerType, InitType>>
class mlpack::rl::SimpleDQN< OutputLayerType, InitType, NetworkType >
- Template Parameters
-
OutputLayerType | The output layer type of the network. |
InitType | The initialization type used for the network. |
NetworkType | The type of network used for simple dqn. |
◆ SimpleDQN() [1/2]
template<typename OutputLayerType = MeanSquaredError<>, typename InitType = GaussianInitialization, typename NetworkType = FFN<OutputLayerType, InitType>>
mlpack::rl::SimpleDQN< OutputLayerType, InitType, NetworkType >::SimpleDQN |
( |
const int |
inputDim, |
|
|
const int |
h1, |
|
|
const int |
h2, |
|
|
const int |
outputDim, |
|
|
const bool |
isNoisy = false , |
|
|
InitType |
init = InitType() , |
|
|
OutputLayerType |
outputLayer = OutputLayerType() |
|
) |
| |
|
inline |
Construct an instance of SimpleDQN class.
- Parameters
-
inputDim | Number of inputs. |
h1 | Number of neurons in hiddenlayer-1. |
h2 | Number of neurons in hiddenlayer-2. |
outputDim | Number of neurons in output layer. |
isNoisy | Specifies whether the network needs to be of type noisy. |
init | Specifies the initialization rule for the network. |
outputLayer | Specifies the output layer type for network. |
◆ SimpleDQN() [2/2]
template<typename OutputLayerType = MeanSquaredError<>, typename InitType = GaussianInitialization, typename NetworkType = FFN<OutputLayerType, InitType>>
Construct an instance of SimpleDQN class from a pre-constructed network.
- Parameters
-
network | The network to be used by SimpleDQN class. |
isNoisy | Specifies whether the network needs to be of type noisy. |
◆ Backward()
template<typename OutputLayerType = MeanSquaredError<>, typename InitType = GaussianInitialization, typename NetworkType = FFN<OutputLayerType, InitType>>
void mlpack::rl::SimpleDQN< OutputLayerType, InitType, NetworkType >::Backward |
( |
const arma::mat |
state, |
|
|
arma::mat & |
target, |
|
|
arma::mat & |
gradient |
|
) |
| |
|
inline |
Perform the backward pass of the state in real batch mode.
- Parameters
-
state | The input state. |
target | The training target. |
gradient | The gradient. |
◆ Forward()
template<typename OutputLayerType = MeanSquaredError<>, typename InitType = GaussianInitialization, typename NetworkType = FFN<OutputLayerType, InitType>>
void mlpack::rl::SimpleDQN< OutputLayerType, InitType, NetworkType >::Forward |
( |
const arma::mat |
state, |
|
|
arma::mat & |
target |
|
) |
| |
|
inline |
Perform the forward pass of the states in real batch mode.
- Parameters
-
state | The input state. |
target | The predicted target. |
◆ Predict()
template<typename OutputLayerType = MeanSquaredError<>, typename InitType = GaussianInitialization, typename NetworkType = FFN<OutputLayerType, InitType>>
void mlpack::rl::SimpleDQN< OutputLayerType, InitType, NetworkType >::Predict |
( |
const arma::mat |
state, |
|
|
arma::mat & |
actionValue |
|
) |
| |
|
inline |
Predict the responses to a given set of predictors.
The responses will reflect the output of the given output layer as returned by the output layer function.
If you want to pass in a parameter and discard the original parameter object, be sure to use std::move to avoid unnecessary copy.
- Parameters
-
state | Input state. |
actionValue | Matrix to put output action values of states input. |
The documentation for this class was generated from the following file: