Thanks to their ease of implementation, multilayer perceptrons (MLPs) have become ubiquitous in deep learning applications. The graph underlying an MLP is indeed multipartite, i.e. each layer of neurons only connects to neurons belonging to the adjacent layer. In contrast, in vivo brain connectomes at the level of individual synapses suggest that biological neuronal networks are characterized by scale-free degree distributions or exponentially truncated power law strength distributions, hinting at potentially novel avenues for the exploitation of evolution-derived neuronal networks. In this paper, we present ``4Ward'', a method and Python library capable of generating flexible and efficient neural networks (NNs) from arbitrarily complex directed acyclic graphs. 4Ward is inspired by layering algorithms drawn from the graph drawing discipline to implement efficient forward passes, and provides significant time gains in computational experiments with various Erd\H{o}s-R\'enyi graphs. 4Ward not only overcomes the sequential nature of the learning matrix method, by parallelizing the computation of activations, but also addresses the scalability issues encountered in the current state-of-the-art and provides the designer with freedom to customize weight initialization and activation functions. Our algorithm can be of aid for any investigator seeking to exploit complex topologies in a NN design framework at the microscale.
翻译:由于实现简便,多层感知机(MLPs)在深度学习应用中已无处不在。MLP的底层图结构本质上是多部的,即每个神经元层仅与相邻层神经元相连。然而,在突触级别上,活体脑连接组研究表明,生物神经网络的特征为无标度度分布或指数截断幂律强度分布,这暗示着可能存在从进化衍生的神经网络中挖掘潜力的新途径。本文提出"4Ward"——一种能从任意复杂有向无环图生成灵活高效神经网络(NNs)的方法及Python库。4Ward受图绘制学科中的分层算法启发,实现了高效的前向传播,并在多种Erdős–Rényi图的计算实验中展现出显著的时间增益。该方法不仅通过并行化激活计算克服了学习矩阵方法的序列化局限,还解决了当前前沿技术中的可扩展性问题,并为设计者提供了自定义权重初始化与激活函数的自由度。本算法可为任何在微观尺度神经网络设计框架中探索复杂拓扑结构的研究者提供支持。