liveBook · Manning

Architecture priors

As explained in Deep Learning with Python, Third Edition

An inductive bias about which model structures are likely to work well for a task before training on data.

Architecture priors are assumptions about which model structures fit a task. Choosing a structure that matches the data can make generalization possible; choosing a poor fit can leave a model unable to beat even a trivial baseline. section 5.3.2 section 6.2.3

Use architecture choice as an early modeling decision:

  • Inspect the task and data modality before selecting a model. section 5.3.2
  • Compare alternatives such as densely connected networks, ConvNets, recurrent neural networks, Transformers, or non-deep-learning methods. section 6.2.3
  • Start with a small model and test whether it beats a simple baseline. section 6.2.3
  • Research prior art for architectures and feature-engineering techniques that fit the problem. section 6.2.3

A temporal convolution can encode the wrong assumption

For hourly temperature forecasting, a 1D ConvNet can scan 24-hour windows and reuse representations across days. It performs poorly, however, because weather does not consistently satisfy translation invariance: morning, evening, and night have different properties. Pooling also discards important order information, while the recent past matters more than data from several days earlier. section 13.2.4

Table 6.1 Which loss, last-layer activation, and metrics to use for different tasks

Task

Last-layer activation

Loss function

Metrics

Binary classification

Sigmoid

Binary crossentropy

Binary accuracy, ROC AUC

Multiclass, single-label classification

Softmax

Categorical crossentropy

Categorical accuracy, top-k categorical accuracy, ROC AUC

Multiclass, multi-label classification

Sigmoid

Binary crossentropy

Binary accuracy, ROC AUC

Regression

None

Mean squared error

Mean absolute error

Use the task-to-activation, loss, and metric table alongside architecture selection; it supplies practical starting templates for common problem types. section 6.2.3

How Deep Learning with Python, Third Edition covers it

How deep it goes
Explains architecture choice through task assumptions and a failed temporal ConvNet, but stops short of surveying architectures in detail.
Examples
Uses shuffled-label MNIST, temperature forecasting, densely connected networks, and a 1D ConvNet as concrete comparisons.
What you can do after
Evaluate candidate architectures against task assumptions and a simple baseline before investing in training configuration.
How it connects
Connects architecture priors to generalization, feature engineering, baselines, translation invariance, and recurrent neural networks.

Also explained in

Compare how 2 books explain architecture priors →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with Python, Third Edition. The section links point to the parts of the book it draws on.