k_rnn: Iterates over the time dimension of a tensor

Description Usage Arguments Value Keras Backend

View source: R/backend.R

Description

Iterates over the time dimension of a tensor

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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://keras.rstudio.com/articles/backend.html#backend-functions.


dfalbel/keras documentation built on Nov. 27, 2019, 8:16 p.m.