5

I've been working with neural networks and artificial intelligence for a while. What I'm trying to do right now is, from a genotype I have (a sum of sensors, neurons and actuators) draw how the neural network is (with recurrent/recursive connections being showed nicely, etc.)

What I have done now in javascript is this:

I know, its ugly

I have achieved this using SigmaJs, a Javascript drawing library, but I think it's still ugly, and what I'm looking for is a node drawing library that can achieve recursive connections in a nice way (right now, I'm drawing them with a red color as you can see on the image).

I have examined a lot of GitHub repositories and websites that can be helpful but aren't worth it since they aren't that nice.

Has anyone got an idea of what can I use, in javascript? If not, in any other language, how can I achieve what I want?

nbro
  • 39,006
  • 12
  • 98
  • 176
MiGu3X
  • 53
  • 3

2 Answers2

6

I'm the developer of Neataptic, a Javascript neural network library. I don't know if it is exactly what you're looking for, but it has a built-in graph creator using D3 and webcola.

Basically, each connection gets an arrow. It also supports self-connections and gates.

There are some examples of images:

Play around yourself here.

nbro
  • 39,006
  • 12
  • 98
  • 176
Thomas Wagenaar
  • 1,187
  • 8
  • 11
2

You might have come across the Tensorflow Playground which has a wonderful visualization of the network connections and the neuron weights.

Their code is available in GitHub (here), and the code seems fairly simple. It is coded in typescript but that can be easily transpiled to pure JavaScript.

Alpha
  • 458
  • 3
  • 12