5
$\begingroup$

I'm trying to implement a feedforward neural network using a graph. The thing is: I haven't found any example in which is used a graph data structure. So far the examples I've found used arrays.

Can anyone please point me in the direction of some literature on the topic or some tutorial?

$\endgroup$
  • $\begingroup$ huh? how do you make a NN out of arrays? $\endgroup$ – vzn Aug 9 '14 at 17:32
  • 1
    $\begingroup$ @vzn They used arrays as a mean to represent matrices. $\endgroup$ – m-oliv Aug 10 '14 at 20:25
6
$\begingroup$

Many implementations you can find out in the web are done on matrices (MATLAB for instance) since it provides a compact notation. Haykin's textbook on neural networks takes this approach. Matrices also provide a simple translation to hardware design (FPGA, ASIC, etc.). They are also more often implemented on the FPU.

If you implement a neural network in an object oriented manner, you are effectively doing what your question asks: implementing a neural network on a graph. Your neurons are then objects that have relations with each others. There are a few books that take that approach. One I can think of is an undergrad level book by Renard called Réseaux de neurones (sorry, only in French).

$\endgroup$
  • $\begingroup$ good answer, but if anyone knows any english books I would love to hear about them! $\endgroup$ – Joe S Mar 4 at 21:50
4
$\begingroup$

You should use a directed graph since information passes in one way when running the network and in the other when training. Your data structure should support enumerating all incoming and all outgoing edges for each node, as well as enumerating nodes by their depth. Any data structure supporting these operations can be used to implement neural networks. Take it as an exercise.

$\endgroup$
2
$\begingroup$

I believe what you are looking for is a Graph Convolutional Network (GCN), though I'm sure you've long since found your answer.

https://tkipf.github.io/graph-convolutional-networks/

https://towardsdatascience.com/how-to-do-deep-learning-on-graphs-with-graph-convolutional-networks-7d2250723780

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.