DEV Community
•
2026-04-24 23:29
Chapter 5: Linear Transformation and Softmax
What You'll Build
Two helper functions that show up in nearly every layer of a neural network:
Linear takes an input vector and a weight matrix, multiplies each row of weights element-by-element with the input, and sums each row into a single output value:
input: [1, 2, 3]
weights: [[0.1, 0.2, 0.3], row 0: 0.1*1 + 0.2*2 + 0.3*3 = 1.4
[0.4, 0.5, 0.6]] row 1...