Machine Learning Fundamentals · free preview

Indexing, Broadcasting and Derivatives

Accessing an axis, combining two tensors of different shapes, and differentiating a scalar objective are the three reading skills every later module relies on.

1. Reading an axis

Reading an axis

2. Two rules of broadcasting

Two rules of broadcasting

3. Differentiating an objective

Differentiating an objective

4. What broadcasting does to shapes

Tensor a\mathbf{a} has shape (3,1)(3, 1) and tensor b\mathbf{b} has shape (1,2)(1, 2). The expression a+b\mathbf{a} + \mathbf{b} is evaluated. What is the shape of the result, and what fills its entries?

5. The derivative at the minimum

The loss ℓ(w)=12(w−5)2\ell(w) = \frac{1}{2}(w - 5)^2 has derivative ℓ′(w)=w−5\ell'(w) = w - 5. At the parameter value w=5w = 5, the derivative equals ____.

Practice this interactively

Free account · instant grading · spaced review that schedules itself.

Start this course for free