Principle:LaurentMazare Tch rs Sequential Model Definition
| Knowledge Sources | |
|---|---|
| Domains | Deep_Learning, Model_Architecture |
| Last Updated | 2026-02-08 14:00 GMT |
Overview
Pattern for composing neural network layers into a linear chain where the output of each layer feeds directly into the next.
Description
A Sequential model is a container that chains together a list of neural network layers in order. During a forward pass, the input tensor is passed through each layer sequentially, with each layer's output becoming the next layer's input. This is the simplest form of neural network composition, suitable for architectures without skip connections or branching. The Sequential pattern supports both training-unaware (Module) and training-aware (ModuleT) layers via separate container types.
Usage
Use this principle when building feedforward neural networks where data flows linearly through layers. Suitable for simple classifiers, feature extractors, and encoder/decoder stacks without skip connections.
Theoretical Basis
Sequential Forward Pass:
input → Layer_1 → Layer_2 → ... → Layer_N → output
output = f_N(f_{N-1}(...f_2(f_1(input))...))
The Sequential pattern uses a builder interface for layer composition:
- add(): Appends a Module layer
- add_fn(): Appends a closure-based transformation (e.g., activation functions)
- add_fn_t(): Appends a closure-based transformation with training flag