5
$\begingroup$

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?

$\endgroup$
6
$\begingroup$

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.

| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ Hey Thomas, any idea if it is possible to modify the drawGraph function to use canvas instead of svg (performance issues) in an easy way? $\endgroup$ – MiGu3X Jun 15 '17 at 23:09
  • 1
    $\begingroup$ @MiGu3X i'm sorry, I don't know. I never really experimented with it too much $\endgroup$ – Thomas W Jun 16 '17 at 9:55
2
$\begingroup$

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.

| improve this answer | |
$\endgroup$

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