RNNs and Sequence Modeling for Time-Series Geoscience Data

Chapter 15, Recurrent Networks for Sequential Data

Learning objectives

  • Write the Elman cell's update and say what its hidden state carries from one sample to the next down a well
  • Explain backpropagation through time on windows of the logs, and why a window of one sample trains no memory
  • Score a recurrent cell leave one well out and set it beside models with no memory
  • Wipe a cell's memory at a bed boundary and read how long it lasts, and why

A Cell That Reads Down the Well

A recurrent network reads a sequence one step at a time and carries a hidden state from each step to the next, so what it says at a step can depend on every step before it. Down a well the steps are the samples, and the hidden state carries what the cell read above. An Elman cell trained by backpropagation through time on windows of the Ogbon field's logs, held out one well at a time, calls 0.989 of the nine wells' samples right with no memory at all, and 0.985, 0.989 and 0.976 trained on windows of 2 ft, 8 ft and 32 ft; logistic regression on the same logs calls 0.986 and kNN with 15 neighbours 0.976. Memory down depth buys nothing for pay: pay is decided by the rock at the sample, and its logs already see it. What memory does shows at a bed boundary. Wiped there, the state of the cell trained on 32 ft windows comes back to the remembering cell's within 1 ft below the top of the tight limestone, and only 20.5 ft below the base of pay in the main sand, where the logs change slowly.

Rnn Memory Down DepthInteractive figure, enable JavaScript to interact.

The Data

The data are the book's own learning set: Ogbon-1, the Petrophysics book's well, and eight hypothetical appraisal wells of the book's field, each 1201 samples every 0.5 ft, 10809 in all, logged by Ogbon-1's own build and the book's own tool model, all synthetic. The class is pay, the Petrophysics book's net-pay rule on the generator's truth. The cell reads gamma ray, density, neutron, sonic and log10 RT, standardized on the eight training wells of each fold, and calls pay or not at every sample. The cells are precomputed in the book's RNN table: thirty-six cells, each sixty passes over eight wells, take minutes in node. On the page the cell trained without Ogbon-1 reads it forward, with the kernel's own forward pass.

The Elman Cell

At each sample tt the cell reads the standardized logs xtx_t and its own state from the sample above, ht=tanh⁑(Wxxt+Whhtβˆ’1+b)h_t = \tanh(W_x x_t + W_h h_{t-1} + b) with h0=0h_0 = 0 at the top of the well, and calls pay through a softmax, pt=softmax⁑(Wyht+c)p_t = \operatorname{softmax}(W_y h_t + c). The same weights serve every depth. With 4 hidden units and 5 logs the cell has 50 numbers: 20 in WxW_x, 16 in the recurrent WhW_h, 4 in bb, 8 in WyW_y and 2 in cc. The recurrent weights are the memory: with Wh=0W_h = 0 the cell reads every sample afresh, a small network of one hidden layer.

Backpropagation Through Time

Training cuts each training well from its top into consecutive windows and lowers the mean cross-entropy over a window, reading it from a zero state. The gradient is backpropagation through time: the cell is unrolled over the window, and the error at each sample flows back through WhW_h to the samples above it, each step back multiplied by Wh⊀W_h^{\top} and the tanh's slope, 1βˆ’h21 - h^2, so it shrinks with distance. It reaches no further than the window's top, so the window bounds the memory a cell can learn, and a window of one sample never trains WhW_h at all: the book starts it at zero and the cell has no memory. Each cell takes 60 passes at a rate of 0.1, one step a window: with 32 ft windows the eight training wells give 152 windows a pass, with one sample 9608.

Held Out, One Well at a Time

Held out one well at a time, no window does better than none: 0.989 with one sample, 0.985 with 2 ft, 0.989 with 8 ft, 0.976 with 32 ft. The longest window misses less pay, 3.5 ft of the nine wells' pay against 17.5 ft with no memory, and calls far more false pay, 127.5 ft against 42.0 ft. Most of it is Ogbon-8's, the well wholly in the water leg: called 0.999 right with no memory and 0.873 with the longest window, 76.5 ft called pay that is not, all of it in its tight limestone, which is mostly pay in each of the other eight wells. A longer memory learns more of what the training wells share, and a well down the dip does not share it.

Memory Across a Bed Boundary

To see what the cell remembers, wipe its state at a boundary: read on from a zero state, and compare it with the cell that kept its memory. Below a sharp boundary the new bed's logs overwrite the state within a foot or two: with 32 ft windows, 1 ft below the top of the upper oil sand, 1 ft below the top of the tight limestone and 2 ft below its base, and no call changes. At the base of pay in the main sand oil goes to water inside one sand, the logs change slowly, and the memory lasts: 4 ft for the cell trained on 2 ft windows, 12.5 ft for 8 ft windows and 20.5 ft for 32 ft windows, where 2 of its calls change on the way. Memory lasts where nothing new arrives to overwrite it, and a cell learns to keep it as long as its windows let it.

Gated Cells

The gradient that shrinks with every step back is why an Elman cell learns short memories. Gated cells, the LSTM and the GRU, add gates that let the input decide when the state is kept and when it is overwritten, which carries memory further. The book's kernel holds the Elman cell alone, and on these wells the lesson would not change: memory of the beds above is not what calls pay.

What Comes Next

Section 15.2, the Chapter 15 quiz, asks what the cell remembers and why it does not help pay. Chapter 16 turns from calling pay to compressing the logs: the auto-encoder.

This page is prerendered for SEO and accessibility. The interactive widgets above hydrate on JavaScript load.