Glossary · Machine learning

Recurrent neural network

Also called RNN, GRU, LSTM, gated recurrent unit, memory

A neural network with a memory: it carries a hidden state from one step to the next, so it can use what it saw earlier.

A recurrent neural network (RNN) reads its inputs one step at a time and keeps a hidden state hh, a list of numbers it updates every step:

ht=f(ht−1,xt)h_t = f(h_{t-1}, x_t)

The output at each step depends on hth_t, so it can depend on anything seen before, not just the current input. That makes RNNs suited to sequences: speech, text, and the moves of an opponent.

Plain RNNs struggle to remember for long, because the effect of an early input fades (or blows up) as it passes through many steps. The LSTM and the simpler GRU (gated recurrent unit) add gates: small learnt switches that decide what to keep, what to forget and what to write. They are the usual choice when a robot controller needs memory.

They cost more to train than a plain MLP: steps must be processed in order, and training has to run back through time. When a short fixed window is enough, frame stacking is cheaper.

In this project

The fighter’s policy is an MLP with no memory. For blocking a single punch it gets a short stacked history of the opponent instead. A GRU is the plan for later, when reading an opponent means remembering more than the last tenth of a second: feints, combinations, rhythm and habits.

Related terms

Used in

← All terms