SimpleDQN< OutputLayerType, InitType, NetworkType > Class Template Reference

Public Member Functions

 SimpleDQN ()
 Default constructor. More...

 
 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 Backward (const arma::mat state, arma::mat &target, arma::mat &gradient)
 Perform the backward pass of the state in real batch mode. More...

 
void Forward (const arma::mat state, arma::mat &target)
 Perform the forward pass of the states in real batch mode. More...

 
const arma::mat & Parameters () const
 Return the Parameters. More...

 
arma::mat & Parameters ()
 Modify the Parameters. More...

 
void Predict (const arma::mat state, arma::mat &actionValue)
 Predict the responses to a given set of predictors. More...

 
void ResetNoise ()
 Resets noise of the network, if the network is of type noisy. More...

 
void ResetParameters ()
 Resets the parameters of the network. More...

 

Detailed Description


template<typename OutputLayerType = MeanSquaredError<>, typename InitType = GaussianInitialization, typename NetworkType = FFN<OutputLayerType, InitType>>
class mlpack::rl::SimpleDQN< OutputLayerType, InitType, NetworkType >

Template Parameters
OutputLayerTypeThe output layer type of the network.
InitTypeThe initialization type used for the network.
NetworkTypeThe type of network used for simple dqn.

Definition at line 36 of file simple_dqn.hpp.

Constructor & Destructor Documentation

◆ SimpleDQN() [1/3]

SimpleDQN ( )
inline

Default constructor.

Definition at line 42 of file simple_dqn.hpp.

◆ SimpleDQN() [2/3]

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
inputDimNumber of inputs.
h1Number of neurons in hiddenlayer-1.
h2Number of neurons in hiddenlayer-2.
outputDimNumber of neurons in output layer.
isNoisySpecifies whether the network needs to be of type noisy.
initSpecifies the initialization rule for the network.
outputLayerSpecifies the output layer type for network.

Definition at line 56 of file simple_dqn.hpp.

◆ SimpleDQN() [3/3]

SimpleDQN ( NetworkType &  network,
const bool  isNoisy = false 
)
inline

Construct an instance of SimpleDQN class from a pre-constructed network.

Parameters
networkThe network to be used by SimpleDQN class.
isNoisySpecifies whether the network needs to be of type noisy.

Definition at line 90 of file simple_dqn.hpp.

Member Function Documentation

◆ Backward()

void Backward ( const arma::mat  state,
arma::mat &  target,
arma::mat &  gradient 
)
inline

Perform the backward pass of the state in real batch mode.

Parameters
stateThe input state.
targetThe training target.
gradientThe gradient.

Definition at line 154 of file simple_dqn.hpp.

◆ Forward()

void Forward ( const arma::mat  state,
arma::mat &  target 
)
inline

Perform the forward pass of the states in real batch mode.

Parameters
stateThe input state.
targetThe predicted target.

Definition at line 117 of file simple_dqn.hpp.

◆ Parameters() [1/2]

const arma::mat& Parameters ( ) const
inline

Return the Parameters.

Definition at line 143 of file simple_dqn.hpp.

◆ Parameters() [2/2]

arma::mat& Parameters ( )
inline

Modify the Parameters.

Definition at line 145 of file simple_dqn.hpp.

◆ Predict()

void 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
stateInput state.
actionValueMatrix to put output action values of states input.

Definition at line 106 of file simple_dqn.hpp.

◆ ResetNoise()

void ResetNoise ( )
inline

Resets noise of the network, if the network is of type noisy.

Definition at line 133 of file simple_dqn.hpp.

◆ ResetParameters()

void ResetParameters ( )
inline

Resets the parameters of the network.

Definition at line 125 of file simple_dqn.hpp.


The documentation for this class was generated from the following file:
  • /home/jenkins-mlpack/mlpack.org/_src/mlpack-git/src/mlpack/methods/reinforcement_learning/q_networks/simple_dqn.hpp