k_rnn {keras}R Documentation

Iterates over the time dimension of a tensor

Description

Iterates over the time dimension of a tensor

Usage

k_rnn(
  step_function,
  inputs,
  initial_states,
  go_backwards = FALSE,
  mask = NULL,
  constants = NULL,
  unroll = FALSE,
  input_length = NULL
)

Arguments

step_function

RNN step function.

inputs

Tensor with shape (samples, ...) (no time dimension), representing input for the batch of samples at a certain time step.

initial_states

Tensor with shape (samples, output_dim) (no time dimension), containing the initial values for the states used in the step function.

go_backwards

Logical If TRUE, do the iteration over the time dimension in reverse order and return the reversed sequence.

mask

Binary tensor with shape (samples, time, 1), with a zero for every element that is masked.

constants

A list of constant values passed at each step.

unroll

Whether to unroll the RNN or to use a symbolic loop (while_loop or scan depending on backend).

input_length

Not relevant in the TensorFlow implementation. Must be specified if using unrolling with Theano.

Value

A list with:

Keras Backend

This function is part of a set of Keras backend functions that enable lower level access to the core operations of the backend tensor engine (e.g. TensorFlow, CNTK, Theano, etc.).

You can see a list of all available backend functions here: https://tensorflow.rstudio.com/reference/keras/index.html#backend.


[Package keras version 2.15.0 Index]