Skip to content

Commit e91f8d1

Browse files
committed
remove exercise to reader
1 parent 12c5502 commit e91f8d1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

docs/src/design/changing_the_primal.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ end
335335
</details>
336336
```
337337

338+
We should think about how we might want to make future changes to this code.[^6]
338339
(NB: there is actually a further optimization that can be made to the logistic sigmoid, to avoid remembering two things and just remember one.
339340
As an exercise to the reader, consider how the code would need to be changed and where.)
340341

@@ -416,7 +417,7 @@ See the [code for this in ChainRules.jl](https://github.com/JuliaDiff/ChainRules
416417
Note that this is distinct from simply element-wise application of the function to the matrix's elements.
417418
The [Matrix Exponential](https://en.wikipedia.org/wiki/Matrix_exponential) `exp(::Matrix)` is a particularly important matrix function.
418419

419-
Al-Mohy and Higham (2009)[^6], published a method for computing the pullback of `exp(::Matrix)`.
420+
Al-Mohy and Higham (2009)[^7], published a method for computing the pullback of `exp(::Matrix)`.
420421
It is pretty complex and very cool.
421422
To quote its abstract (emphasis mine):
422423

@@ -501,4 +502,8 @@ Being able to change the primal computation is practically essential for a high
501502
Those are separate functions called at very different times.
502503
This is something [opaque closures](https://github.com/JuliaLang/julia/pull/37849) should help solve.
503504

504-
[^6]: [Al-Mohy, Awad H. and Higham, Nicholas J. (2009) _Computing the Fréchet Derivative of the Matrix Exponential, with an application to Condition Number Estimation_. SIAM Journal On Matrix Analysis and Applications., 30 (4). pp. 1639-1657. ISSN 1095-7162](http://eprints.maths.manchester.ac.uk/1218/)
505+
[^6]:
506+
One change we might consider is to have logistic sigmoid to only remember one thing.
507+
Rather than remembering `y` and `ex` to use in the pullback, we could compute `y / (1 + ex)` during the augmented primal, and just remember that.
508+
509+
[^7]: [Al-Mohy, Awad H. and Higham, Nicholas J. (2009) _Computing the Fréchet Derivative of the Matrix Exponential, with an application to Condition Number Estimation_. SIAM Journal On Matrix Analysis and Applications., 30 (4). pp. 1639-1657. ISSN 1095-7162](http://eprints.maths.manchester.ac.uk/1218/)

0 commit comments

Comments
 (0)