We give parallel algorithms for string diagrams represented as structured cospans of ACSets. Specifically, we give linear (sequential) and logarithmic (parallel) time algorithms for composition, tensor product, construction of diagrams from arbitrary $\Sigma$-terms, and application of functors to diagrams. Our datastructure can represent morphisms of both the free symmetric monoidal category over an arbitrary signature as well as those with a chosen Special Frobenius structure. We show how this additional (hypergraph) structure can be used to map diagrams to diagrams of optics. This leads to a case study in which we define an algorithm for efficiently computing symbolic representations of gradient-based learners based on reverse derivatives. The work we present here is intended to be useful as a general purpose datastructure. Implementation requires only integer arrays and well-known algorithms, and is data-parallel by constuction. We therefore expect it to be applicable to a wide variety of settings, including embedded and parallel hardware and low-level languages.
翻译:我们提出了以 ACSets 结构余余子图表示的字符串图案的并行算法。我们分别给出了构成、张量积、从任意 $\Sigma$ - 术语构建图案以及将函数子套用于图案的线性(顺序)和对数(并行)时间算法。我们的数据结构可以表示上任意签名的自由对称幺半范畴以及具有选定的 Special Frobenius 结构的态射。我们展示了如何使用此附加(超图)结构将图案映射到光学图案。这导致了一个案例研究,在其中定义了一种用于有效计算基于反向导数的学习器的符号表示的算法。我们在这里介绍的工作旨在作为一种通用数据结构。实现仅需要整数数组和众所周知的算法,并且由于构造,数据并行。因此,我们预计它适用于各种设置,包括嵌入式和并行硬件以及低级语言。