What it does
A recurrent network reads a sequence one step at a time. One or more stacked recurrent layers (LSTM or GRU) update a hidden state from the current input and the previous state, and a dense layer reads the state at every step. For generation the output is a distribution over the next event; a sample is drawn and fed back in as the next input, so the model writes a sequence of any length. For streaming detection the output is a score per frame.
Formula
ht = LSTM(xt, ht−1)p(xt+1) = softmax(W ht + b)xt+1 ~ p(xt+1) (generation feeds the sample back)Shapes and parameters
- Shapes
- Inputs [T, N, I], states [N, H] per layer, outputs [T, N, K].
- Parameters
- Each LSTM layer costs about 4H × (I + H); the head H × K + K. MelodyRNN’s two 512-unit layers and 38-way head total about 3.25 million.
- Used for
- SketchRNN drawings, MelodyRNN melodies, Silero voice activity detection, older language and speech models.
In WeightSpace
SketchRNN and MelodyRNN are edited through the biases of the dense head that reads the LSTM state: pen states for drawings, specific notes and note-off events for melodies. Because the head runs at every step, a small bias change accumulates over the whole generated sequence.
Models built as a Recurrent network
- Restore punctuation in a transcriptEdge-Punct-Casing7.4M params
- Continue a melodyMagenta MelodyRNN3.2M params
- Track motion between two framesRAFT-Small990K params
- Detect speech in a recordingSilero VAD545K params
- Remove background noiseGTCRN48K params
- Finish a cat doodleSketchRNN1.1M params
- Finish a dog doodleSketchRNN1.1M params
- Finish an owl doodleSketchRNN1.1M params
- Finish an elephant doodleSketchRNN1.1M params