Dual Numbers and Automatic Differentiation

Dual Numbers and Automatic Differentiation Forward-Mode Automatic Differentiation Dual Numbers and AD Terminology Change! Binary Functions Multiple Variables, Nesting What Return Values are Allowed? Differential Implementation Term List Algebra Addition and Multiplication Differential Type Implementation Accessor Methods Constructors Differential API Differential Parts API Comparison, Control Flow Chain Rule and Lifted Functions Derivatives of Differentials Generic Method Installation Dual Numbers and Automatic Differentiation This literate essay develops an implementation of a type called Differential. A Differential is a generalization of a type called a "dual number", and the glowing, pulsing core of the SICMUtils implementation of forward-mode automatic differentiation. ...

January 11, 2021 · 34 min

Optics and the Principle of Least Time

(This is a writeup of Exercise 1.3 from Sussman and Wisdom’s "Structure and Interpretation of Classical Mechanics". See the solutions repository for more.) Law of Reflection Geometry Calculus Law of Refraction Calculus Geometry The problem explores some consequences for optics of the principle of least time. The exercise states: Fermat observed that the laws of reflection and refraction could be accounted for by the following facts: Light travels in a straight line in any particular medium with a velocity that depends upon the medium. The path taken by a ray from a source to a destination through any sequence of media is a path of least total time, compared to neighboring paths. Show that these facts imply the laws of reflection and refraction. ...

June 10, 2020 · 6 min

Half Angles from Euler's Formula

I’ve been reading the lovely Visual Complex Analysis by Tristan Needham, and the visual-style proofs he’s been throwing down have been wonderful and refreshing. I’ll write more about this book and its goals later, but I was inspired this AM to write up a proof of the half angle identities from trigonometry using some of the tools from the book. Here’s the half angle identity for cosine: This is an equation that lets you express the cosine for half of some angle in terms of the cosine of the angle itself. As you can imagine, there are double-angle, triple angle, all sorts of identities that you can sweat out next time you find yourself in a 9th grade classroom. ...

June 5, 2020 · 3 min

Basis Changes for Linear Transformations

A 1-act sketch via Apple Pencil, for your viewing pleasure. Happy to link to further references or sketch this out in more detail — let me know in the comments if this is illuminating. Check it out below, or click here for a direct image link to stare at a big version in the browser.

March 2, 2020 · 1 min

Entropy: Combinations and Permutations

In my ongoing quest to lay a more solid foundation for this new, strange life as a machine learning “researcher”, I’ve been going through various foundational concepts and ideas and trying to build up rock solid intuitions that I can lean on for years. (Why the hell didn’t I do this back in school??) Entropy is my latest obsession - thermodynamic entropy, and information entropy, and the ways in which these two things are similar. ...

January 29, 2020 · 11 min