rlValueFunction
Value function approximator object for reinforcement learning agents
Description
This object implements a value function approximator object that you can use as a
critic for a reinforcement learning agent. A value function maps an environment state to a
scalar value. The output represents the predicted discounted cumulative long-term reward when
the agent starts from the given state and takes the best possible action. After you create an
rlValueFunction
critic, use it to create an agent such as an rlACAgent
, rlPGAgent
, or rlPPOAgent
agent. For
an example of this workflow, see Create Actor and Critic Representations. For more information on creating
value functions, see Create Policies and Value Functions.
Creation
Syntax
Description
creates the value-function object critic
= rlValueFunction(net
,observationInfo
)critic
from the deep neural network
net
and sets the ObservationInfo
property of
critic
to the observationInfo
input argument.
The network input layers are automatically associated with the environment observation
channels according to the dimension specifications in
observationInfo
.
specifies the names of the network input layers to be associated with the environment
observation channels. The function assigns, in sequential order, each environment
observation channel specified in critic
= rlValueFunction(net
,observationInfo
,'ObservationInputNames',netObsNames
)observationInfo
to the layer
specified by the corresponding name in the string array netObsNames
.
Therefore, the network input layers, ordered as the names in
netObsNames
, must have the same data type and dimensions as the
observation channels, as ordered in observationInfo
.
creates the value function object critic
= rlValueFunction(tab
,observationInfo
)critic
with a discrete
observation space, from the table tab
, which is an
rlTable
object
containing a column array with as many elements as the number of possible observations.
The function sets the ObservationInfo
property of
critic
to the observationInfo
input argument,
which in this case must be a scalar rlFiniteSetSpec
object.
creates the value function object critic
= rlValueFunction({basisFcn
,W0
},observationInfo
)critic
using a custom basis
function as underlying approximator. The first input argument is a two-element cell array
whose first element is the handle basisFcn
to a custom basis function
and whose second element is the initial weight vector W0
. The
function sets the ObservationInfo
property of
critic
to the observationInfo
input
argument.
specifies the device used to perform computational operations on the
critic
= rlValueFunction(___,UseDevice=useDevice
)critic
object, and sets the UseDevice
property
of critic
to the useDevice
input argument. You
can use this syntax with any of the previous input-argument combinations.
Input Arguments
Properties
Object Functions
rlACAgent | Actor-critic reinforcement learning agent |
rlPGAgent | Policy gradient reinforcement learning agent |
rlPPOAgent | Proximal policy optimization reinforcement learning agent |
getValue | Obtain estimated value from a critic given environment observations and actions |