Affine Map

A linear model used in deep learning is often an affine map.

For one output score:

score = x . w + b

The dot product x . w is a weighted sum. The bias b shifts the result.

inputx = [2, 3]w = [4, -1]b = 5score = x . w + b2 x 4 + 3 x (-1) + 5 = 10
A linear model computes a score from a weighted sum plus a bias.

Suppose:

x = [2, 3]
w = [4, -1]
b = 5

Then:

score = 2 x 4 + 3 x (-1) + 5
      = 8 - 3 + 5
      = 10

The score is not yet a probability. It is a raw number produced by the model.

DL-C03-T01-001Exercise: Compute one score

Let x = [1, 4], w = [3, -2], and b = 5. Compute x . w + b.

Compute it first, then check your number.

HintUse weighted sum plus bias

Compute 1 x 3 + 4 x (-2) + 5.

SolutionWork it out

1 x 3 + 4 x (-2) + 5 = 3 - 8 + 5 = 0.

DL-C03-T01-002Exercise: Is it a probability

A model returns score 3.7. Enter 1 if this raw score is already a probability, or 0 if it is not necessarily a probability.

Compute it first, then check your number.

HintCheck the range

Probabilities must stay between 0 and 1.

SolutionWork it out

A raw score can be any real number. Since 3.7 is greater than 1, it is not a probability.