Works

Active

DisCoPy Open Source Work

applied category theorysoftware implementationopen source
DisCoPy string diagram
WebsiteGithubDocs

DisCoPy was one of the first projects in which my mathematical interests came in contact with software. I was drawn to it because string diagrams make abstract categorical structure executable, and they are abundant in applied category theory. I first encountered them in my research on categorical deep learning. What initially led me to DisCoPy was an interest in software that could compile neural network model (for example, models written in PyTorch) into formal string diagram representations, and potentially translate between the two.

Contributing to the library taught me that implementing mathematics involves a lot more than just translating a definition into code. There's usually a lot of complications in between. It requires deciding how to represent a mathematical object computationally, which intermediate representations and data structures to use, how to manage complexity, and how to ensure that the computational semantics faithfully mirrors the mathematical structure.

The Category of Parametric Maps in DisCoPy

I implemented the original foundation for discopy.para, bringing the para construction (Para(C)\mathrm{Para}(\mathcal C)) into DisCoPy. A parametric map separates a computation’s ordinary input from its parameter space. This captures, for example, a neural network layer together with its weights. My implementation defined how these parametric maps compose sequentially and in parallel, how parameters are routed using swaps, and how a map can be reparameterised.

The implementation was subsequently refactored, extended across DisCoPy’s hierarchy of categorical structures, and merged through a separate pull request, which explicitly built upon my original contribution.