# Rackpropagator - automatic differentiation in Racket

**URL:** <https://racket.discourse.group/t/rackpropagator-automatic-differentiation-in-racket/844>\
**Category:** Show & Tell\
**Created:** [April 2, 2022, 4:23pm UTC](https://racket.discourse.group/t/rackpropagator-automatic-differentiation-in-racket/844 "2022-04-02T16:23:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![OliverS](https://avatars.discourse-cdn.com/v4/letter/o/8edcca/32.png) [@OliverS](https://racket.discourse.group/u/OliverS)\
**Post date:** [April 2, 2022, 4:23pm UTC](https://racket.discourse.group/t/rackpropagator-automatic-differentiation-in-racket/844/1 "2022-04-02T16:23:29Z")

</div>

I've been working on an [automatic differentiation](https://en.wikipedia.org/wiki/Automatic_differentiation) library recently and thought I'd share the current work-in-progress. I've had fun writing it and have learned a lot about the Racket macro system in the process!

- [Rackpropagator on GitHub](https://github.com/ots22/rackpropagator)
- [docs](https://ots22.github.io/rackpropagator/)
- `raco pkg install rackpropagator`

It provides so-called 'reverse mode' AD, implemented as syntax transformation. A function definition (written in a subset of Racket) can be macro-transfomed into a function that also computes its gradient. See the docs for some examples and references.

The output it produces can be quite inefficient at the moment, along with a few other limitations. I'm currently thinking about how to improve this.

Also, the build on the package server seems to be failing, although I'm not sure why.

---

<div class="post-metadata">

**Author:** ![dannypsnl](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/dannypsnl/32/917_2.png) [@dannypsnl](https://racket.discourse.group/u/dannypsnl)\
**Post date:** [April 2, 2022, 4:44pm UTC](https://racket.discourse.group/t/rackpropagator-automatic-differentiation-in-racket/844/2 "2022-04-02T16:44:08Z")

</div>

seems like not package's problem:

```scheme
raco setup: making: <pkgs>/rackpropagator-lib/rackpropagator
raco setup: in <pkgs>/rackpropagator-lib/rackpropagator
Killed

```
