liveBook · Manning

Teacher forcing

As explained in Graph Neural Networks in Action

Teacher forcing is a sequential-model training technique that supplies the ground-truth previous output as input when predicting the next step.

Teacher forcing trains a sequential decoder by supplying the ground-truth previous output when predicting the next timestep. With it enabled, a graph decoder uses the real graph; when disabled, it feeds back its own previous prediction. section 6.4.2

A decoder uses the technique as a controlled prediction pipeline:

  • Pass observed graph frames and sampled edges into the decoder. section 6.4.2
  • During teacher-forced steps, use the real next graph as the next input rather than the model’s previous output. section 6.4.2
  • For autonomous forecasting, set teacher_forcing=False and repeatedly use decoder predictions for future timesteps. section 6.4.2

How Graph Neural Networks in Action covers it

How deep it goes
Explains the input-switching behavior and shows its decoder implementation, but does not discuss scheduling strategies or quantitative trade-offs.
Examples
Demonstrates teacher forcing with pose-graph frames and contrasts training-time ground-truth inputs with multi-step prediction using teacher_forcing=False.
What it assumes
Assumes sequential-model and recurrent-decoder concepts, while grounding the technique in graph inputs, sampled edges, and hidden state.
What you can do after
Apply it via a PyTorch decoder’s teacher_forcing flag to train with real frames and forecast future graphs autoregressively.
How it connects
Connects teacher forcing to sequential models, RNNs, GRUs, decoders, hidden state, and future graph prediction.

Also explained in

Compare how 2 books explain teacher forcing →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Graph Neural Networks in Action. The section links point to the parts of the book it draws on.