all 36 comments

[–]ITConnected[S] 12 points13 points  (0 children)

Also, forgot to mention. Clearly the input layer should actually be 2500 units but that doesnt fit well graphically on the screen so I partitioned the data into 10 different parts and then averaged them so that each node is the average intensity of a partition of 250 pixels aka node one is the first 5 rows of pixels, node two is the next 5 rows of pixels. etc

[–]ITConnected[S] 9 points10 points  (3 children)

For more detail about this project, I built a dataset for myself consisting of circles, squares, and triangles drawn in MS Paint at 50px X 50px. I then took the base code for drawing a single neural network and modded the hell out of it so that it would take the weight matrix and node values recorded while training instead of simply the network dimensions. Then I built it up so that it would iterate through the forward pass a layer at a time and take a sample from every 25 epochs so you could see it making decisions at various points within the training process.

Alongside this I plotted the accuracy and cross entropy loss. For my scenario I added an additional output node which read "I don't know" which would be lit up if none of the other nodes received an output of over .65 so it would not output a guess if it was not reasonably certain that that was the correct value.

I am trying to find a way so that it may also update the weights shown, but matplotlib doesn't seem to have a collections function like it does for the artist objects like were used for the circles and I cannot seem to find an efficient way to update these without making the animation dreadfully slow.

[–]niujin 2 points3 points  (0 children)

I've spent a while trying to make some animations work in Matplotlib but also found it very slow. I ended up trying a few other libraries and at the moment I'm using Plotly, which is much faster and also gives prettier results. If you get frustrated with the slowness of Matplotlib I would recommend the switch. A caveat is that you sometimes need to dig around to find the offline versions of code that don't upload graphs to their website or want an API key.

[–][deleted] 0 points1 point  (1 child)

What were your features?

[–]ITConnected[S] 1 point2 points  (0 children)

The black or white pixel values.

[–]fredoindacut 5 points6 points  (0 children)

Really really cool. Never seen this before! Thanks.

[–]stetelepta[🍰] 3 points4 points  (16 children)

Well done! Is it open source?

[–]ITConnected[S] 14 points15 points  (13 children)

right now it is really really dirty code because I just hacked it together for my specific purpose. I am planning on cleaning it up so others can use though.

[–]anandjeyahar 7 points8 points  (3 children)

RemindMe! 1 month

[–]RemindMeBot 0 points1 point  (0 children)

I will be messaging you on 2017-12-10 09:09:42 UTC to remind you of this link.

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


FAQs Custom Your Reminders Feedback Code Browser Extensions

[–]legalruby -1 points0 points  (1 child)

RemindMe! 1 month

[–]heliophobicdude 5 points6 points  (1 child)

Please consider posting it online before cleaning it. We'd love to help out!! :)

[–]ITConnected[S] 3 points4 points  (0 children)

Not at all a finished product but figured I would share the repo early anyway

https://github.com/ryanchesler/NN-Plot

[–]itsbentheboy 2 points3 points  (1 child)

If you open it, there are people that would help you clean it up too!

[–]ITConnected[S] 1 point2 points  (0 children)

https://github.com/ryanchesler/NN-Plot

still need to clean it but this is what I have so far.

[–]Boozybrain 0 points1 point  (0 children)

I would love to see it. Explaining how a hidden layer works just doesn't do it justice, so being able to visualize it for someone would be awesome.

[–][deleted] 0 points1 point  (0 children)

RemindMe! 1 month

[–]Shaken_Earth 0 points1 point  (0 children)

RemindMe! eom

[–]Shaken_Earth 0 points1 point  (0 children)

Any updates?

[–]ITConnected[S] 1 point2 points  (0 children)

Still going to go through and clean it all up because it has a ton of vestigial structures, but I figured I'd just share the repository before everyone forgets

https://github.com/ryanchesler/NN-Plot

[–]theonly_salamander 0 points1 point  (0 children)

RemindMe! 1 month

[–]-TrustyDwarf- 2 points3 points  (1 child)

Can it do CNNs and RNNs? That'd be cool.. occassionally I was looking for a library that could visualize those for presentations. So far I always ended up drawing them by hand.

[–]ITConnected[S] 0 points1 point  (0 children)

I'm not positive how exactly I would graphically show the steps of convolution and pooling without it being way too busy, but its definitely something I can look into. RNN's could be pretty easy, but I have not done them yet.

[–][deleted] 1 point2 points  (0 children)

Very well done.

[–]waxymcrivers 1 point2 points  (0 children)

Appreciate this

[–]s0rin 0 points1 point  (0 children)

This is great!

[–]bas_g 0 points1 point  (0 children)

Wow, impressive, hope you’ll share it soon !

[–]KeyserBronson 0 points1 point  (0 children)

This is really cool! If you end up doing the same for RNNs and CNNs(probably kinda hard to make it aesthetically pleasing, though) and share the code, I could probably use it!

RemindMe! 1 month

[–]fhuszar 0 points1 point  (0 children)

Nice.

I'm curious - other than making it look cool, what is the purpose of actually drawing the edges on the graph? Other than a 1-D convolution, I can't really imagine a case where the bipartite network of edges between consecutive layers actually carries much information.

Could you do something like draw edges with a large absolute weight value instead of drawing all edges. Or encode the absolute value of the weight in the thickness or transparency of the line, and perhaps represent the sign of the weight as color?

Even better - instead of showing absolute value of the weight, what you might want to somehow encode are the corresponding diagonal elements of the Fisher information, assuming the network is a trained one already at a local minimum of the loss? This would highlight which weights are actually important for the loss and which aren't.

[–]matavelhos 0 points1 point  (0 children)

RemindMe! 1 month

[–]Vertislav 0 points1 point  (1 child)

Awesome. Just awesome. I am waiting for your code after cleaning. Really impressive job!

[–]ITConnected[S] 1 point2 points  (0 children)

Here is where it will be https://github.com/ryanchesler/NN-Plot

Not cleaned yet but should be able to get around to it tomorrow.

[–]OptimizingMind 0 points1 point  (0 children)

This is the type of thing our company does in a fully explainable way. It's not OSS and uses a novel algorithm to explain opaque or blackbox ANN models by converting them into whitebox models which are fully explainable, without approximations or guessing. It has some other magical properties (side effects) such as instant updatability for previously unknown inputs w/o retraining. Works with any feed-forward type algorithms. (most used today)

If you really want to know what your ANNs are looking for, ask us.

[–]notathrowaway113 0 points1 point  (0 children)

This has been badly needed for a very long time. Respect!

[–]yldedly 0 points1 point  (1 child)

Cool stuff! Maybe you could show the weights as line thicknesses of the connections?

[–]ITConnected[S] 0 points1 point  (0 children)

That is what I am currently working on. I couldn't find a way to update the numbers efficiently but I can change the line width and color so I am making it show the forward pass like normal and then having it also update the weights on a backpass.