此页面由机器翻译成中文。 查看英文原版。

MathStream #013.1

DisCoPy: Monoidal Categories for Active Inference

May 20, 2025 · with Alexis Toumi

▶ Watch on YouTube ↗

Session details

Date: May 20, 2025

Series: MathStream #013.1

Guests: Alexis Toumi

Transcript

AI-generated transcript excerpt

The full transcript is available on GitHub. This excerpt is generated by automated speech recognition and may contain errors.

Hello, welcome everyone. It is May 20th, 2025. We're in ACTIMPH Math Stream number 13.1 with Alexi Toomey discussing DiscoPy, monoidal categories for active inference. This should be a very exciting and useful presentation and stream. So thank you very much for joining and looking forward to learning more. Yeah, thanks a lot. Thanks a lot for the invite. And yeah, I guess, as I was saying just a couple of minutes ago, I'm very much looking forward to this talk. And it's a bit of a challenge for me, I guess, in a sense that I'm no expert in active inference. So I'll do my best at explaining what I think active inference is about. And I also try to, yeah, convince the audience here that DiscoPy, this Python library for string diagrams, is a promising way to experiment with active inference. So I guess most of the references I'll be using for today would be this main DiscoPy paper. You can also check out the documentation on GitHub. It's quite extensive. We've got plenty of examples and notebooks to play around with. And then I'll give a small glimpse of what the DiscoPy software is used for. So this idea of QNLP, quantum natural language processing, which is what motivated the library in the first place, what I wrote my PhD thesis about. And I guess I'll give some introduction to category theory, which is the sort of mathematical foundations on which DiscoPy is built. And then I'll be using mostly this recent paper from Toh, Kleiner, and Smyth on active inference in string diagrams, where essentially they use the same mathematics that I was using for quantum NLP and apply that to active inference. And in a sense, that's where I learned all I know about active inference. So I'll be giving a summary of the sort of theoretical background. And then I'll be mostly showing some screenshots from that paper to try and show how that theory applies to active inference in particular. And then we can discuss how DiscoPy could be used to implement active inference experiments. So yeah, let's get going. So I guess the main theoretical concept in DiscoPy is a box. So like we draw these boxes a lot. And I guess I don't roast coffee every morning, but I grind coffee, I brew coffee every morning. And I guess that's something that you can understand in terms of a black box where you put a bunch of inputs like green coffee beans, electricity, roast level, start signal. It could be physical, it could be information. And these boxes are sort of abstract conceptual operations that just have a name, a designated list of inputs and outputs. So you've got two sets, the objects, so the things that are on the wires and the boxes have names too. And then you have these two maps from boxes to lists of wires. So that gives you all the processes that you can talk about in your theory. And then you can translate one theory into another using these morphisms of signatures. So first, if you have a box from X to Y, you draw it with an arrow in this way. And then if you have morphism of signature, what it means is you can translate wires of one into lists of wires in the second. And then you can translate a box in one into a box in the appropriate thing in the other. So if you have, so this should be Sigma prime, I guess it's a typo, but you translate boxes in a way that respects the inputs and outputs. And so that's very useful because if you have different kinds of processes and you want to translate between them, that concept of morphism of signature is going to be the key one. And so I guess with that, you can define the set of diagrams. So that's going to be the main, the main definition for this thought. And you start with a signature and then you define diagrams by induction, where every box is a diagram. The identity is a diagram and you draw it with just a bunch of parallel wires. The composition of a diagram from X to Y and Y to Z is also a diagram. So you can have two diagrams, you can plug them one after the other. And then the tensor of two diagrams…