Value Networks

Value Networks in RLzoo

class rlzoo.common.value_networks.ValueNetwork(state_space, hidden_dim_list, w_init=<tensorflow.python.ops.init_ops_v2.GlorotNormal object>, activation=<function relu>, output_activation=None, trainable=True, name=None)[source]
__call__(states, *args, **kwargs)[source]

Forward input tensors through this network by calling.

inputs : Tensor or list of Tensors, numpy.ndarray of list of numpy.ndarray
Inputs for network forwarding
is_train : boolean
Network’s mode for this time forwarding. If ‘is_train’ == True, this network is set as training mode. If ‘is_train’ == False, this network is set as evaluation mode
kwargs :
For other keyword-only arguments.
__init__(state_space, hidden_dim_list, w_init=<tensorflow.python.ops.init_ops_v2.GlorotNormal object>, activation=<function relu>, output_activation=None, trainable=True, name=None)[source]

Value network with multiple fully-connected layers or convolutional layers (according to state shape)

Parameters:
  • state_space – (gym.spaces) space of the state from gym environments
  • hidden_dim_list – (list[int]) a list of dimensions of hidden layers
  • w_init – (callable) weights initialization
  • activation – (callable) activation function
  • output_activation – (callable or None) output activation function
  • trainable – (bool) set training and evaluation mode
__module__ = 'rlzoo.common.value_networks'
state_shape
state_space
class rlzoo.common.value_networks.MlpQNetwork(state_shape, action_shape, hidden_dim_list, w_init=<tensorflow.python.ops.init_ops_v2.GlorotNormal object>, activation=<function relu>, output_activation=None, trainable=True)[source]
__init__(state_shape, action_shape, hidden_dim_list, w_init=<tensorflow.python.ops.init_ops_v2.GlorotNormal object>, activation=<function relu>, output_activation=None, trainable=True)[source]

Q-value network with multiple fully-connected layers

Inputs: (state tensor, action tensor)

Parameters:
  • state_shape – (tuple[int]) shape of the state, for example, (state_dim, ) for single-dimensional state
  • action_shape – (tuple[int]) shape of the action, for example, (action_dim, ) for single-dimensional action
  • hidden_dim_list – (list[int]) a list of dimensions of hidden layers
  • w_init – (callable) weights initialization
  • activation – (callable) activation function
  • output_activation – (callable or None) output activation function
  • trainable – (bool) set training and evaluation mode
__module__ = 'rlzoo.common.value_networks'
class rlzoo.common.value_networks.QNetwork(state_space, action_space, hidden_dim_list, w_init=<tensorflow.python.ops.init_ops_v2.GlorotNormal object>, activation=<function relu>, output_activation=None, trainable=True, name=None, state_only=False, dueling=False)[source]
__call__(inputs, *args, **kwargs)[source]

Forward input tensors through this network by calling.

inputs : Tensor or list of Tensors, numpy.ndarray of list of numpy.ndarray
Inputs for network forwarding
is_train : boolean
Network’s mode for this time forwarding. If ‘is_train’ == True, this network is set as training mode. If ‘is_train’ == False, this network is set as evaluation mode
kwargs :
For other keyword-only arguments.
__init__(state_space, action_space, hidden_dim_list, w_init=<tensorflow.python.ops.init_ops_v2.GlorotNormal object>, activation=<function relu>, output_activation=None, trainable=True, name=None, state_only=False, dueling=False)[source]

Q-value network with multiple fully-connected layers or convolutional layers (according to state shape)

Parameters:
  • state_space – (gym.spaces) space of the state from gym environments
  • action_space – (gym.spaces) space of the action from gym environments
  • hidden_dim_list – (list[int]) a list of dimensions of hidden layers
  • w_init – (callable) weights initialization
  • activation – (callable) activation function
  • output_activation – (callable or None) output activation function
  • trainable – (bool) set training and evaluation mode
  • name – (str) name the model
  • state_only – (bool) only input state or not, available in discrete action space
  • dueling – (bool) whether use the dueling output or not, available in discrete action space
__module__ = 'rlzoo.common.value_networks'
action_shape
action_space
state_shape
state_space