Skip to content

Commit a9a9664

Browse files
committed
Try a different colorization of printArtifactPretty output in README
1 parent 84b3cdf commit a9a9664

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ The vector-Jacobian product program (presented below with additional formatting)
8888

8989
```hs
9090
>>> printArtifactPretty artifact
91-
"\dret m1 ->
92-
let m3 = sin (tproject2 (tproject1 m1))
93-
m4 = tproject1 (tproject1 m1) * m3
94-
m5 = recip (tproject2 m1 * tproject2 m1 + m4 * m4)
95-
m7 = (negate (tproject2 m1) * m5) * dret + tproject2 m1 * dret
96-
in tpair
97-
(tpair (m3 * m7)
98-
(cos (tproject2 (tproject1 m1)) * (tproject1 (tproject1 m1) * m7)))
99-
((m4 * m5) * dret + m4 * dret)"
91+
\dret m1 ->
92+
let m3 = sin (tproject2 (tproject1 m1))
93+
m4 = tproject1 (tproject1 m1) * m3
94+
m5 = recip (tproject2 m1 * tproject2 m1 + m4 * m4)
95+
m7 = (negate (tproject2 m1) * m5) * dret + tproject2 m1 * dret
96+
in tpair
97+
(tpair (m3 * m7)
98+
(cos (tproject2 (tproject1 m1)) * (tproject1 (tproject1 m1) * m7)))
99+
((m4 * m5) * dret + m4 * dret)
100100
```
101101

102102
A concrete value of this symbolic reverse derivative at the same input as before can be obtained by interpreting its program in the context of the operations supplied by the horde-ad library. (Note that the output happens to be the same as `gradSumFooMatrix threeSimpleMatrices` above, which used `cgrad` on `kfromS . ssum0 . foo`; the reason is that `srepl 1.0` happens to be the reverse derivative of `kfromS . ssum0`.)

0 commit comments

Comments
 (0)