May 2018
Beginner
490 pages
13h 16m
English
The RNN, based on a vanilla algorithm, starts by reading the stream of characters. It first opens input.txt, the reference text, as follows:
# data I/Odata = open('input.txt', 'r').read() # should be simple plain text filechars = list(set(data))data_size, vocab_size = len(data), len(chars)print ('data has %d characters, %d unique.' % (data_size, vocab_size))char_to_ix = { ch:i for i,ch in enumerate(chars) }ix_to_char = { i:ch for i,ch in enumerate(chars) }
The RNN has hidden layers connected to the visible input and a learning rate, learning_rate, as shown in the following snippet:
# graph structurehidden_size = 100 # hidden layer sizelearning_rate = 1e-1
Then the specific parameter of an RNN is added—the length of ...
Read now
Unlock full access