mentat-collective / emmy

The Emmy Computer Algebra System.
https://emmy.mentat.org
GNU General Public License v3.0
392 stars 22 forks source link

Reverse-mode AD implementation #154

Closed sritchie closed 9 months ago

sritchie commented 10 months ago

This implementation of reverse-mode AD is modeled after the approach described in the dysvunctional language docs. The current version:

From the CHANGELOG:

What we're missing:

codecov[bot] commented 10 months ago

Codecov Report

Attention: 18 lines in your changes are missing coverage. Please review.

Comparison is base (e674ac5) 87.57% compared to head (c1c4a86) 87.73%.

:exclamation: Current head c1c4a86 differs from pull request most recent head eb3905b. Consider uploading reports for the commit eb3905b to get more accurate results

Files Patch % Lines
src/emmy/tape.cljc 94.91% 6 Missing and 9 partials :warning:
src/emmy/differential.cljc 94.82% 0 Missing and 3 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #154 +/- ## ========================================== + Coverage 87.57% 87.73% +0.16% ========================================== Files 99 100 +1 Lines 15672 15975 +303 Branches 845 851 +6 ========================================== + Hits 13725 14016 +291 - Misses 1102 1108 +6 - Partials 845 851 +6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

littleredcomputer commented 10 months ago

Having read this twice I think it's a beautifully compact implementation of the idea. I'm eager to try to understand how it works by printing out the tape structure before the reverse process.