c18 · E3

Open: Getting Gradients From a Computer

c18.E3.1E3 · open

Section 18.1 says that automatic differentiation is exact for the code that ran, not for the function the programmer meant, and that at a corner the code still returns a number. Section 18.4 adds a second failure: a stored value that changes after it was saved makes the gradient wrong with no error and no warning. The field has no settled convention for what a differentiating system should report when the code has a local slope but the mathematical function has no derivative. Candidates include the slope of the branch that ran, a fixed value such as 0, a NaN, and an error that stops the run.

Take a position on this question: what should a library return at such a point, and how should a user detect a gradient that is silently wrong?

In your answer: name at least two candidate conventions and the case that separates them; propose a test that would expose a mismatch between the code and the function; say what pattern of results would change your mind; state one confound; and connect your proposal to the chapter's two claims, that the derivative is exact for the code and that a recomputed block must repeat its first run.

Rubric. Tick each criterion your answer meets, then save the self-assessment. The platform does not grade it.

Other tiers

E1 Practise · E2 Derive

Every hint opened, solution viewed and answer checked is recorded in this browser only. See Progress to export or delete it.