Build()
build() is a Keras method that creates a layer’s or model’s state, including weights, after the input shape is known.
Deep Learning with Python, Third Edition
A Keras model method that creates weights for a model when given an input shape before the model is first called.
- How it is used
- Configures layers and models before their first data call when input shapes are known.
- How deep it goes
- Explains shape-dependent weight creation and custom-layer structure, but does not develop broader Keras lifecycle internals.
- Examples
- Uses a custom SimpleDense layer, a two-layer Sequential model, explicit input shapes, weight listings, and summary output.
- What you can do after
- Operate/configure Keras models, create weights from input shapes, and inspect architectures with summary().
Read how Deep Learning with Python, Third Edition explains build() →
Deep Learning with R, Third Edition
The Keras build method creates a layer's state after receiving the shape of its input.
- How it is used
- Creates shape-dependent layer state before call() performs the forward computation.
- How deep it goes
- Explains lazy construction, input-shape-dependent weights, explicit model building, and summary inspection without descending into weight initialization internals.
- Examples
- Uses a custom SimpleDense layer, a (2, 784) input tensor, and Sequential models with explicit or automatic building.
- What you can do after
- Builds custom Keras layers and debugs model weights, output shapes, and summaries before training.
Read how Deep Learning with R, Third Edition explains build() →
What to know first
- convolutional layerA convolutional layer is a neural-network layer that applies shared learned filters to local regions of structured input to produce feature representations.
Related concepts
- automatic shape inferenceused by · Automatic shape inference is the process of determining a layer's input and output shapes from the shapes of tensors supplied to it.
- Sequential modelused by · A sequential model is a neural-network model comprising a linear, ordered stack of layers through which data flows from input to output.
- call()equivalent to · call() is the Keras method that defines the forward computation a layer or model performs on its inputs.
- __call__() methodequivalent to · __call__() is a Python special method that defines the behavior of an object when invoked with function-call syntax.
Questions about build()
What is build()?
build() is a Keras method that creates a layer’s or model’s state, including weights, after the input shape is known.
Which Manning books explain build()?
Deep Learning with Python, Third Edition and Deep Learning with R, Third Edition.
What should I know before learning build()?
Manning books that teach build() usually introduce convolutional layer first.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

