This class defines the interface of a recurrent link ChainerRL can handle.
In most casese, you can just use ChainerRL’s existing containers like
chainerrl.links.StatelessRecurrentBranched to define a recurrent
link. You can use Chainer’s recurrent links such as L.NStepLSTM inside the
To write your own recurrent link, you need to implement the interface.
This method sequentially applies layers as chainer.Sequential does.
x (list) – Input sequences. Each sequence should be a variable whose
first axis corresponds to time or a tuple of such variables.
recurrent_state (object) – Batched recurrent state. If set to None,
it is initialized.
output_mode (str) – If set to ‘concat’, the output value is
concatenated into a single large batch, which can be suitable
for loss computation. If set to ‘split’, the output value is
a list of output sequences.
Output sequences. See the description of the output_mode
hidden_sizes (list of ints) – Sizes of hidden channels.
normalize_input (bool) – If set to True, Batch Normalization is applied
normalize_output (bool) – If set to True, Batch Normalization is applied
nonlinearity (callable) – Nonlinearity between layers. It must accept a
Variable as an argument and return a Variable with the same shape.
Nonlinearities with learnable parameters such as PReLU are not
last_wscale (float) – Scale of weight initialization of the last layer.
class chainerrl.links.NIPSDQNHead(n_input_channels=4, n_output_channels=256, activation=<function relu>, bias=0.1)[source]¶
DQN’s head (NIPS workshop version)
class chainerrl.links.NatureDQNHead(n_input_channels=4, n_output_channels=512, activation=<function relu>, bias=0.1)[source]¶
Sequential callable Link that consists of other Links.
Stateless recurrent parallel link.
This is a recurrent analog to chainerrl.links.Branched. It bundles
multiple links that implements StatelessRecurrent.
*links – Child links. Each link should be recurrent and callable.
ChainList that auutomatically handles recurrent states.
This link extends chainer.ChainList by adding the recurrent_children
property that returns all the recurrent child links and implementing
recurrent state manimulation methods required for the StatelessRecurrent
A recurrent state for this link is defined as a tuple of recurrent states
of child recurrent links.
Sequential model that can contain stateless recurrent links.
This link a stateless recurrent analog to chainer.Sequential. It supports
the stateless recurrent interface by automatically detecting recurrent
links and handles recurrent states properly.
For non-recurrent layers (non-link callables or non-recurrent callable
links), this link automatically concatenates the input to the layers
for efficient computation.