liveBook · Manning

SimpleRNN layer

As explained in Deep Learning with R, Third Edition

A SimpleRNN layer is a Keras recurrent layer that computes sequence representations using basic recurrent state updates.

A SimpleRNN layer processes batches of sequences by updating recurrent state across timesteps. It accepts inputs shaped as (batch_size, timesteps, input_features). section 13.3.2

A SimpleRNN with full sequence output

num_features <- 14 steps <- 120 inputs <- keras_input(shape = c(steps, num_features)) outputs <- inputs |> layer_simple_rnn(16, return_sequences = TRUE)

SimpleRNN is a basic recurrent baseline, but it rarely handles long-term dependencies effectively because of the vanishing-gradient problem. LSTM and GRU layers provide alternatives. section 13.3.2

How Deep Learning with R, Third Edition covers it

How deep it goes
Defines input and output shapes, variable-length handling, stacking, and long-term-dependency limitations without deriving recurrent internals.
Examples
Demonstrates variable-length inputs, final-step output, full-sequence output, and stacked SimpleRNN layers in R/Keras.
What it assumes
Assumes sequence inputs and feature dimensions while establishing recurrent-layer input and output shapes explicitly.
What you can do after
Operate/configure SimpleRNN layers for fixed- or variable-length sequences and choose appropriate output modes.
How it connects
Connects recurrent layers with sequence length, output representations, LSTM, GRU, and the vanishing-gradient problem.

Also explained in

Compare how 2 books explain SimpleRNN layer →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with R, Third Edition. The section links point to the parts of the book it draws on.