Example

Example of Untrained Concise RNN Language Model Prediction

To demonstrate the baseline behavior of a recurrent neural network (RNN) language model prior to optimization, we can invoke its predict method using randomly initialized weights. Providing a short prefix string such as 'it has' results in a repetitive and nonsensical sequence of characters, illustrating that the model lacks the linguistic representations necessary to generate coherent text:

model.predict('it has', 20, data.vocab)

Output:

'it hasoadd dd dd dd dd dd '

0

1

Updated 2026-05-14

Contributors are:

Who are from:

Tags

D2L

Dive into Deep Learning @ D2L