mardi 7 janvier 2020

Optimization strategies for calculations from randomly connected nodes

I have a collection of nodes which are randomly connected by weights in a feed-forward fashion. Currently, I iteratively check each node in order by a float value that determines which nodes need to be evaluated before which other nodes.

This is achieved by assigning a 0.0 value to input nodes and a 1.0 value to output nodes, and averaging between the two ends of a connection for a newly generated node in the middle. For example, a node directly between an input and output is going to have a value of 0.5 and a connection between that node and another output is going to be at 0.75, and connections are not allowed between nodes with the same value. (which also prevents a node from connecting to itself)

I keep a list of all the nodes and sort them by this value and then I can know that I am not calculating their values out of order.

I am reaching a bottleneck in this setup though. Looping through every node one-by-one to calculate the various incoming values is probably not ideal. I'm trying to work my head through a way to use numpy arrays at a higher level so I can do the multiplication or other operations along an entire vector or matrix instead but the free-flow nature of the random connections makes this difficult for me to work out.

Are there any patterns or already-known solutions out there that can help me? Part of my problem is I'm not entirely sure what terms to use to search this kind of problem.

Aucun commentaire:

Enregistrer un commentaire