ML for Materials Science · Week 9 · Lecture 9

Neural Networks

From one neuron to deep networks: why every layer needs a bend, how backpropagation computes every gradient, and how to train without overfitting.
Undergraduate course · 16 weeks
Recap of lectures 1–7 · after the midterm

The classical toolkit, and what it left open

1

Learning and baselines: minimize the training loss, judge on held-out data, and always beat the mean.

2

Linear models and ridge: \(\hat{\mathbf y} = X\mathbf w\); adding \(\lambda\lVert\mathbf w\rVert^2\) to the loss shrinks the weights and tames overfitting.

3

Descriptors we design: fraction-weighted mean, deviation and range of elemental properties; structure fingerprints.

4–5

Gaussian processes, trees and forests: flexible models with error bars or averaging; strong on small data.

6–7

Honest validation and unsupervised learning: grouped splits, baselines, PCA and clustering.

What it left open

Every model so far had either a fixed form (a line, a kernel) or worked on features we designed. Can a model learn its own features from raw input, given enough data?

\[ \hat y = \mathbf w^{\mathsf T}\mathbf x \quad\longrightarrow\quad \hat y = \mathbf w_2^{\mathsf T}\,g\!\left(W_1\mathbf x + \mathbf b_1\right) + b_2 \]

left: a linear model of our features · right: a linear model of learned features

This week

Neural networks, backpropagation by hand, training and regularization, PyTorch. Team project teams are formed this week.

Why questions · answered at the end

Four puzzles for today

WHY 1

Why does a stack of ten linear layers have no more power than a single one?

WHY 2

A network that reads only element fractions predicts formation energies well. Why does a random forest on hand-made descriptors still win on a few hundred compounds?

WHY 3

A network can have far more weights than training points. Why does it not always overfit, and how do we stop it when it does?

WHY 4

Why must the weights start as small random numbers, and not all at zero?

From lecture 5 to today

One neuron: a weighted sum and a bend

1
Weighted sum: \(z = \mathbf w^{\mathsf T}\mathbf x + w_0\)
Exactly the linear model of lecture 2.
2
Activation: \(a = g(z)\). With the sigmoid \(g = \sigma\), one neuron is logistic regression.
Lecture 5: the output becomes a probability p.
3
Perceptron (Rosenblatt, 1958): g = step function, learning rule \(\mathbf w \leftarrow \mathbf w + \eta\,(y - \hat y)\,\mathbf x\)
The weights change only when a prediction is wrong.
x₁ x₂ x₃ w₁w₂w₃ Σ + w₀ z g ŷ

What one neuron can learn

One straight boundary, \(\mathbf w^{\mathsf T}\mathbf x + w_0 = 0\). Anything that needs a bent or broken boundary is out of reach.

Mark I Perceptron, figure from its operator's manual
Mark I Perceptron (about 1960), Figure 2 of its operator's manual.
J. C. Hay, A. E. Murray, public domain
Math primer · the chain rule

Derivatives through a chain of functions

1
Chain rule: \(y = f(u),\ u = g(x)\ \Rightarrow\ \dfrac{dy}{dx} = \dfrac{dy}{du}\,\dfrac{du}{dx}\)
Multiply the local slopes along the chain.
2
Several paths: if L depends on θ through u and through v, \[ \frac{\partial L}{\partial \theta} = \frac{\partial L}{\partial u}\frac{\partial u}{\partial \theta} + \frac{\partial L}{\partial v}\frac{\partial v}{\partial \theta} \]
Add the contributions of all paths from θ to L.
3
Sigmoid: \(\sigma(z) = \dfrac{1}{1+e^{-z}}\ \Rightarrow\ \sigma'(z) = \dfrac{e^{-z}}{(1+e^{-z})^2} = \sigma(z)\,\big(1-\sigma(z)\big)\)
Write \(e^{-z}/(1+e^{-z}) = 1 - \sigma\); the slope is largest at z = 0.
4
ReLU: \(g(z) = \max(0, z)\ \Rightarrow\ g'(z) = 1\) if \(z > 0\), else \(0\)
It passes the gradient unchanged, or blocks it.

Numbers to check

\(\sigma(0) = 0.5 \Rightarrow \sigma'(0) = 0.5\times0.5 = 0.25\) (the maximum)
\(\sigma(2) = 0.881 \Rightarrow \sigma'(2) = 0.881\times0.119 = 0.105\)

\[ \underbrace{0.25\times0.25\times\cdots\times0.25}_{10\ \text{sigmoid layers}} = 0.25^{10} \approx 9.5\times10^{-7} \]

Why ReLU is the default

Through ten sigmoid layers the gradient can shrink a million-fold (the vanishing gradient), so the early layers barely learn. An active ReLU unit has slope exactly 1.

Derivation 1 · why nonlinearity is needed

Linear layers collapse into one; a bend does not

1
Two layers, no activation: \(\mathbf h = W_1\mathbf x + \mathbf b_1,\quad \hat y = \mathbf w_2^{\mathsf T}\mathbf h + b_2\)
A hidden layer that only multiplies and adds.
2
Substitute h:\[ \hat y = \underbrace{\mathbf w_2^{\mathsf T}W_1}_{\mathbf w'^{\mathsf T}}\,\mathbf x + \underbrace{\mathbf w_2^{\mathsf T}\mathbf b_1 + b_2}_{b'} = \mathbf w'^{\mathsf T}\mathbf x + b' \]
A row times a matrix is one row: again a single linear model.
3
Any depth: \(W_{10}\cdots W_2W_1 = W'\)
Ten linear layers have exactly the power of one.
4
Add a bend: \(\text{ReLU}(z) + \text{ReLU}(-z) = |z|\)
Two units already make a V shape, which no linear model can.
input z

What the model learned

Each unit with a bend is a new feature learned from data. The output is a linear model of these learned features, so the network is as flexible as its hidden layers.

The multilayer network

Layers of bends, and a problem one neuron cannot solve

1
Layer l: \(\mathbf h^{(l)} = g\big(W^{(l)}\mathbf h^{(l-1)} + \mathbf b^{(l)}\big)\), with \(\mathbf h^{(0)} = \mathbf x\); the output layer is linear.
θ denotes all the W and b together.
2
Parameters: \(\sum_l (d_{l-1} + 1)\,d_l\). Network 28 → 128 → 128 → 1:
3 712 + 16 512 + 129 = 20 353
One weight per input plus one bias, for every unit.
3
Universal approximation: one wide enough hidden layer can approximate any continuous function on a bounded region.
It says a network can; not how much data it needs.

Worked by hand · two dopants (schematic)

A wide-gap oxide conducts with a donor or an acceptor, but not with both: they compensate each other.

01 01 donor D acceptor A no straight lineseparates redfrom blue
DAh₁h₂ŷ
00000
10101
01101
11210
\[ h_1 = \text{ReLU}(D + A),\quad h_2 = \text{ReLU}(D + A - 1),\quad \hat y = h_1 - 2h_2 \]
What a ReLU network computes

A sum of hinges: the band gap of AlxGa1−xAs

no training data direct → indirect, x ≈ 0.45 Al fraction x band gap (eV) hinges (eV)

14 simulated measurements (noise 0.02 eV) for x ≤ 0.8, from the standard direct (Γ) and indirect (X) gap curves at 300 K. Network: 1 → 2 → 1, ReLU.

networktrue gaphinge 1hinge 2

What the model learned

Each hidden unit is one hinge. The first kink sits at x = 0.44, next to the real crossover at 0.45. Beyond the data it just extends its last straight piece: 0.26 eV too low for AlAs. Trained on x ≤ 0.4 only, it predicts 2.9 eV at x = 0.8 (true 2.1 eV).

Try it (outside the video)

hidden units 2
—
Derivation 2 · backpropagation

Backpropagation: the chain rule, run backwards

1
Forward pass (store z and h):\[ \mathbf z = W_1\mathbf x + \mathbf b_1,\ \ \mathbf h = g(\mathbf z),\ \ \hat y = \mathbf w_2^{\mathsf T}\mathbf h + b_2,\ \ \ell = \tfrac12(\hat y - y)^2 \]
2
Output error: \(\delta = \dfrac{\partial \ell}{\partial \hat y} = \hat y - y\ \Rightarrow\ \dfrac{\partial \ell}{\partial \mathbf w_2} = \delta\,\mathbf h,\ \ \dfrac{\partial \ell}{\partial b_2} = \delta\)
Same form as the linear-model gradient: error times input.
3
Back through w₂ and g: \(\boldsymbol\delta_h = \dfrac{\partial \ell}{\partial \mathbf z} = \delta\,\mathbf w_2 \odot g'(\mathbf z)\)
Chain rule: each unit gets its share of the error, gated by its own slope (⊙ = element by element).
4
First layer: \(\dfrac{\partial \ell}{\partial W_1} = \boldsymbol\delta_h\,\mathbf x^{\mathsf T},\ \ \dfrac{\partial \ell}{\partial \mathbf b_1} = \boldsymbol\delta_h\)
Again error times input: an outer product with the shape of W₁.
x z h ŷ ℓ W₁, b₁gw₂, b₂½(ŷ−y)² δδ w₂δₕ blue: forward pass · red: backward pass

Sanity checks

Shapes: δₕ (2×1) times xᵀ (1×2) is 2×2, like W₁. Link: a sigmoid output with log loss gives δ = p − y, the logistic-regression gradient of lecture 5.

Why it is fast

One backward pass costs about as much as one forward pass, and gives the gradient of every weight at once: millions of weights for the price of two passes.

Worked problem 1 · by hand · forward pass

A 2-2-1 network: one forward pass

0.5−0.51.01.0 1.00.5 x₁ x₂ h₁ h₂ ŷ x₁ = 1.0x₂ = 0.5 b = 0b = 0.5 b₂ = 0.25 ReLUlinear

Given: two scaled features of one compound, x = (1.0, 0.5), and its scaled target y = 2.0 (illustrative numbers).
\(W_1 = \begin{bmatrix}0.5 & 1.0\\ -0.5 & 1.0\end{bmatrix},\ \mathbf b_1 = \begin{bmatrix}0\\0.5\end{bmatrix},\ \mathbf w_2 = \begin{bmatrix}1.0\\0.5\end{bmatrix},\ b_2 = 0.25\)

1
Hidden unit 1:\[ z_1 = 0.5(1.0) + 1.0(0.5) + 0 = 1.0 \Rightarrow h_1 = \text{ReLU}(1.0) = 1.0 \]
2
Hidden unit 2:\[ z_2 = -0.5(1.0) + 1.0(0.5) + 0.5 = 0.5 \Rightarrow h_2 = 0.5 \]
3
Output:\[ \hat y = 1.0(1.0) + 0.5(0.5) + 0.25 = 1.5 \]
4
Loss:\[ \ell = \tfrac12(1.5 - 2.0)^2 = 0.125 \]

Check

Both z are positive, so both units are active and the gradient will pass through both. The prediction is 0.5 too low.

Worked problem 1 · by hand · backward pass and one update

Every gradient from one error, then one step downhill

1
Output: \(\delta = \hat y - y = -0.5\ \Rightarrow\ \dfrac{\partial \ell}{\partial \mathbf w_2} = \delta\,\mathbf h = (-0.5,\ -0.25),\ \ \dfrac{\partial \ell}{\partial b_2} = -0.5\)
2
Hidden: \(\boldsymbol\delta_h = \delta\,\mathbf w_2 \odot g'(\mathbf z) = -0.5\,(1.0,\ 0.5) \odot (1,\ 1) = (-0.5,\ -0.25)\)
Both slopes are 1, because both units are active.
3
First layer:\[ \frac{\partial \ell}{\partial W_1} = \boldsymbol\delta_h\mathbf x^{\mathsf T} = \begin{bmatrix}-0.5\\-0.25\end{bmatrix}\begin{bmatrix}1.0 & 0.5\end{bmatrix} = \begin{bmatrix}-0.5 & -0.25\\ -0.25 & -0.125\end{bmatrix},\ \ \frac{\partial \ell}{\partial \mathbf b_1} = \begin{bmatrix}-0.5\\-0.25\end{bmatrix} \]
4
Update, η = 0.1: θ ← θ − η ∂ℓ/∂θ
w₂ → (1.05, 0.525), b₂ → 0.30, W₁ → [[0.55, 1.025], [−0.475, 1.0125]], b₁ → (0.05, 0.525)
beforeafter one step
prediction ŷ1.5001.760
loss ℓ0.1250.029

Sanity check · finite difference

Change W₁₁ by ±10⁻⁴ and recompute the loss:

\[ \frac{\ell(+) - \ell(-)}{2\times10^{-4}} = -0.5000 \]

the same as backpropagation.

What the model learned

All gradients are negative, so every weight increases (becomes more positive) to raise ŷ. Weights fed by x₁ = 1.0 move twice as much as those fed by x₂ = 0.5. A unit with z < 0 would get zero gradient: it is switched off for this example.

Training at scale · stochastic gradient descent, momentum, Adam

Better ways to step downhill

1
Minibatch SGD: \(\theta \leftarrow \theta - \eta\,\nabla_\theta L_B\)
\(L_B\) = average loss on a random batch of, say, 32 examples: noisy, but cheap.
2
Momentum: \(\mathbf v \leftarrow \beta\,\mathbf v + \nabla_\theta L_B,\quad \theta \leftarrow \theta - \eta\,\mathbf v\)
A running sum of past gradients: zigzags cancel, steady directions add up.
3
Adam (g = gradient):\[ \mathbf m \leftarrow \beta_1\mathbf m + (1-\beta_1)\,\mathbf g,\quad \mathbf s \leftarrow \beta_2\,\mathbf s + (1-\beta_2)\,\mathbf g^2 \]\[ \theta \leftarrow \theta - \eta\,\frac{\hat{\mathbf m}}{\sqrt{\hat{\mathbf s}} + \epsilon},\quad \hat{\mathbf m} = \frac{\mathbf m}{1-\beta_1^t},\ \hat{\mathbf s} = \frac{\mathbf s}{1-\beta_2^t} \]
Typical β₁ = 0.9, β₂ = 0.999, η = 10⁻³; the hats undo the start at zero.
weight w₁ (gentle direction) w₂ (steep)
gradient descent, η = 0.09momentum, β = 0.7, η = 0.04

Loss after 30 steps (start 18)

Gradient descent 0.028 · momentum 0.0005 · Adam (η = 0.15) 0.29. On a smooth bowl momentum wins; Adam's strength is different: it rescales each weight separately.

Worked problem 2 · by hand · one weight, three optimizers

What each optimizer does with the same gradient

gradient gstep tSGD
η = 0.01
momentum
η = 0.01, β = 0.9
Adam
η = 0.001
0.510.0050.0050.001
0.520.0050.00950.001
0.530.0050.013550.001
5010.50.50.001

Size of the downhill step taken by each optimizer, for a constant gradient.

What this means

A weight with 100 times larger gradients (g = 50) gets a 100 times larger SGD step, but the same Adam step. Adam gives every weight its own scale, which matters in deep networks, where gradients of different layers differ by orders of magnitude.

1
SGD: step = ηg = 0.01 × 0.5 = 0.005, every time.
The step is proportional to the gradient.
2
Momentum: v = 0.5 → 0.9(0.5) + 0.5 = 0.95 → 0.9(0.95) + 0.5 = 1.355; steps ηv. Limit:\[ v_\infty = \frac{g}{1-\beta} = 10g \ \Rightarrow\ \text{step} \to 0.05 \]
With a steady gradient, momentum speeds up tenfold.
3
Adam, t = 1: m = 0.1(0.5) = 0.05, s = 0.001(0.25) = 0.00025;
m̂ = 0.05/0.1 = 0.5, ŝ = 0.00025/0.001 = 0.25\[ \text{step} = 0.001 \times \frac{0.5}{\sqrt{0.25}} = 0.001 \]
m̂/√ŝ = g/|g| = 1: the step is η, whatever the size of g.
Overfitting · 1

Early stopping, and weight decay is ridge in disguise

noise level 0.05 eV training epoch (log scale) RMSE (eV)

12 simulated points of the lecture-1 InGaAs bowing curve (noise 0.05 eV), 200 validation points. Network 1 → 64 → 64 → 1: 4 353 parameters, Adam.

trainingvalidationvalidation, weight decay
1

Early stopping: keep the weights with the lowest validation error (epoch 1 155: 0.059 eV), not the last ones (0.090 eV).

2
Weight decay: \(L_{\text{reg}} = L + \lambda\lVert\theta\rVert^2\) gives\[ \theta \leftarrow \theta - \eta(\nabla_\theta L + 2\lambda\theta) = (1 - 2\eta\lambda)\,\theta - \eta\nabla_\theta L \]
Every step shrinks each weight a little. For a linear model with plain gradient descent this is ridge (lecture 2), with λ scaled by n because L is an average; biases are usually not decayed.
Overfitting · 2

Dropout, and the regularization toolbox

one training step: crossed units are dropped (p = 0.5)
1
Training: keep each hidden unit with probability 1 − p, and scale the kept ones up:\[ \tilde h = \frac{r}{1-p}\,h,\qquad r = 1 \text{ (prob. } 1-p),\ \ r = 0 \text{ (prob. } p) \]
A new random set of units is dropped at every step.
2
Expected value: \(\mathbb E[\tilde h] = (1-p)\,\dfrac{h}{1-p} + p\cdot 0 = h\)
So at test time we use all units, unscaled. Check: p = 0.5, h = 2 → 4 or 0, average 2.
methodwhat it doeslink
weight decayshrinks all weightsridge, lecture 2
early stoppingstops before memorizingvalidation set, lecture 6
dropoutno unit can rely on another; like averaging many thinned networksrandom forests, lecture 5
more data, augmentationthe best regularizer of alllecture 10

What the model learned

Regularization does not change what a network can represent. It changes which of the many functions that fit the training data it chooses: the smoother, simpler ones.

Materials example 1 · formation energy from composition alone

The ElemNet idea: let the network learn the chemistry

H 0Li 0⋮ O 0.6⋮ Fe 0.4⋮ 86 fractions 256 128 64 dense ReLU layers (learned features) ΔHf eV/atom
Periodic table of the elements
The input is one number per element of the periodic table. Offnfopt, public domain

Input

The fraction of each element: Fe₂O₃ → Fe 0.4, O 0.6, all others 0. No descriptors, no structure.

Network

Dense ReLU layers (ElemNet used 17). The example drawn, 86 → 256 → 128 → 64 → 1, has 63 489 parameters.

Result (Jha et al., 2018)

Trained on DFT formation energies from the OQMD (of order 10⁵ compounds): test MAE about 0.05 eV/atom, better than models on hand-made descriptors at that data size.

What the model learned

The first layers turn 86 fractions into learned chemical features, playing the role of our lecture-3 descriptors, but only for chemistry like the training set; anything else is extrapolation.

Materials example 2 · network or random forest?

It depends on how much data you have

training compounds N (log scale) test MAE (eV/atom, log scale)

Simulated formation energies of binary and ternary compounds of 28 elements (pair interactions plus chemistry that no descriptor encodes; noise 0.03 eV/atom). Test: 2 000 held-out compounds.

model (input)N = 100N = 4000
mean (baseline)
ridge (15 descriptors)
random forest (15 descriptors)
network (28 fractions)

What the model learned

Descriptors carry our chemical knowledge, so the forest needs few examples, but it cannot learn what they leave out. The network starts from nothing: poor on small data, best on large data.

PyTorch basics

PyTorch does backpropagation for you

import torch
x  = torch.tensor([1.0, 0.5]); y = torch.tensor(2.0)
W1 = torch.tensor([[0.5, 1.0], [-0.5, 1.0]],
                  requires_grad=True)
b1 = torch.tensor([0.0, 0.5], requires_grad=True)
w2 = torch.tensor([1.0, 0.5], requires_grad=True)
b2 = torch.tensor(0.25, requires_grad=True)
h    = torch.relu(W1 @ x + b1)
yhat = w2 @ h + b2              # 1.5
loss = 0.5 * (yhat - y) ** 2    # 0.125
loss.backward()                 # backprop
print(W1.grad)
# [[-0.50, -0.25], [-0.25, -0.125]]
net = torch.nn.Sequential(
    torch.nn.Linear(86, 256), torch.nn.ReLU(),
    torch.nn.Linear(256, 128), torch.nn.ReLU(),
    torch.nn.Linear(128, 1))
opt = torch.optim.Adam(net.parameters(),
          lr=1e-3, weight_decay=1e-5)
# with Adam, prefer optim.AdamW: true weight decay
for epoch in range(200):
    for xb, yb in loader:     # batches of 32
        opt.zero_grad()         # clear old grads
        yh = net(xb).squeeze()
        loss = ((yh - yb) ** 2).mean()
        loss.backward()         # all gradients
        opt.step()              # Adam update
Autograd records the forward pass and runs the chain rule backwards: the same numbers as worked problem 1, for any network.
Lab 9 · this week in Colab

Formation energy: network versus forest

import torch, numpy as np
from lab09_utils import load_fractions, magpie, mlp, group_split
X, y = load_fractions("formation_subset.csv")  # n x 86
# split by chemical system, not at random (lecture 6):
# polymorphs of one formula never straddle the split
tr, va, te = group_split(X, by="chemical_system",
                         sizes=(0.8, 0.1, 0.1), seed=0)
from sklearn.ensemble import RandomForestRegressor
rf = RandomForestRegressor(300, n_jobs=-1)
rf.fit(magpie(X[tr]), y[tr])
net = mlp([86, 256, 128, 1])
best = net.fit(X[tr], y[tr], X[va], y[va],
               lr=1e-3, weight_decay=1e-5,
               patience=20)        # early stopping
for model, Xte in [(rf, magpie(X[te])), (net, X[te])]:
    mae = np.abs(model.predict(Xte) - y[te]).mean()
    print(type(model).__name__, "MAE", round(mae, 3))

Exercises

  • Reproduce worked problem 1 with autograd, and check one gradient by finite differences.
  • Train with and without early stopping; plot training and validation loss per epoch.
  • Learning curves: network vs forest vs the mean, for N = 100 … 8 000. Where do they cross?
  • Remove the ReLUs and show that the network becomes linear regression.

Team project

Teams of three are formed this week. One-page proposal due in week 10.

Answers to the why questions

The four puzzles, solved

1 · Ten linear layers = one

A product of matrices is one matrix: \(W_{10}\cdots W_1 = W'\). Without a bend, depth adds no power. ReLU units make hinges, and hinges add up to any shape.

2 · Forest wins on small data

Descriptors carry chemical knowledge; the network must learn it from examples. In our simulation the forest won below about 500 compounds, the network above.

3 · Many weights, not always overfit

Training from small weights fits the smooth trend first and the noise later. Stop early (0.059 vs 0.090 eV), decay the weights, use dropout, add data.

4 · Not all zero

Identical units get identical gradients and stay identical forever: the layer acts like one unit. With all weights zero, h = 0 and w₂ = 0, so W₁ and w₂ never get a gradient: only the output bias learns, and the network predicts a constant. Random starts break the symmetry.

Check your understanding · click a card to reveal

Concept check

Q1. A network 10 → 50 → 50 → 1 has no activation functions. How many parameters does it have, and what model is it really?
550 + 2 550 + 51 = 3 151 parameters, but it is just linear regression with 11 (10 weights + intercept).
Q2. In the forward pass, a ReLU unit has z = −0.3. What gradient do its incoming weights get from this example?
Zero: g′(z) = 0 blocks the error. A unit that is negative for every example never learns ("dead ReLU").
Q3. Validation loss is lowest at epoch 40 and rises after; training loss still falls at epoch 200. Which weights do you keep?
Those from epoch 40 (early stopping). After that the network fits noise: overfitting.
Q4. Weight decay with η = 0.01 and λ = 0.5: by what factor does each weight shrink per step, before the loss gradient acts?
1 − 2ηλ = 1 − 2(0.01)(0.5) = 0.99, a 1 % shrink per step, as in ridge.
Wrap-up

Summary and next lecture

1
A neuron is a weighted sum plus a bend. Without bends, any number of layers is one linear model; with ReLU, a network is a sum of hinges.
2
Backpropagation = chain rule from the output back: δ = ŷ − y, δₕ = δ w₂ ⊙ g′(z), gradient = error × input. One backward pass gives every gradient.
3
Minibatch SGD, momentum (sums past gradients) and Adam (a separate scale for each weight).
4
Regularize: early stopping, weight decay (= ridge), dropout, more data.
5
Networks learn their own features: they lose to descriptors on small data and win on large data. Draw the learning curve.

This week

Lab 9 · project teams of three formed · Problem set 3 (weeks 9–10) due in week 11.

Next lecture · Learning from images and spectra

Convolution as a learned filter, by hand; CNNs, U-Net segmentation of micrographs, transfer learning, and 1-D networks for XRD patterns.

SEM micrograph of an intergranular crack
SEM micrograph of an intergranular crack: next week's input. KassJuanebe, CC BY-SA 4.0
References and image credits

Further reading

Reading for this week

  • C. M. Bishop, H. Bishop, Deep Learning: Foundations and Concepts, Springer (2024): chapters on single-layer and multilayer networks, gradient descent, backpropagation and regularization.
  • K. P. Murphy, Probabilistic Machine Learning: An Introduction, MIT Press (2022): chapter on neural networks for tabular data.
  • G. James, D. Witten, T. Hastie, R. Tibshirani, J. Taylor, An Introduction to Statistical Learning with Applications in Python, Springer (2023): chapter on deep learning.
  • A. Géron, Hands-On Machine Learning, 3rd ed., O'Reilly (2022): chapters on training deep networks.
  • S. Sandfeld, Materials Data Science, Springer (2024).
  • D. Jha et al., "ElemNet: Deep learning the chemistry of materials from only elemental composition," Sci. Rep. 8, 17593 (2018).
  • F. Rosenblatt, "The perceptron: a probabilistic model for information storage and organization in the brain," Psychol. Rev. 65, 386 (1958).
  • D. P. Kingma, J. Ba, "Adam: a method for stochastic optimization," ICLR (2015). N. Srivastava et al., "Dropout," J. Mach. Learn. Res. 15, 1929 (2014).
  • S. Adachi, "GaAs, AlAs, and AlxGa1−xAs: material parameters," J. Appl. Phys. 58, R1 (1985) (gap curves).

Image credits (Wikimedia Commons)

  • Mark I Perceptron, Figure 2 of the operator's manual: J. C. Hay, A. E. Murray, public domain — File page
  • Simple periodic table chart: Offnfopt, public domain — File page
  • Intergranular crack, SEM micrograph: KassJuanebe, CC BY-SA 4.0 — File page

All schematics and plots were drawn for this course. The AlGaAs, InGaAs and formation-energy data are simulated (labelled on the slides); all numbers were computed with numpy for this lecture. The 2-2-1 network numbers are illustrative.