The aim of this project is to provide a tool for visualizing common ML concepts such as its layers. Right now, it only has a sketch of a page, with no useful visualization.
The results are expected to show something similar to these:
Computation in MLPs: hidden units
Depending on what you want to try it can be either executed by double clicking the index.html file or in the latest cases by running the server.py file in the terminal and accessing the url shown in a browser.
Since we are using Python for the backend and JavaScript for the frontend we are going to need them to communicate in some way. It is done in two main steps:
First of all, a server is run which is waiting endlessly for a call to be made. More technically it is waiting for a "GET" method to be called in order to execute a function. The call is handle by a handler.
This part is run by a python script.
Now, we need a way to create that request mentioned above. There is a jQuery library called AJAX which is going to do the work.
This part is executed inside the JavaScript program.
In the folder Example3 there is a simple page with just a button. By pressing it a http request to the address localhost:8888 is made. At the same time, the script http_request.py is running in the background and printing something when the button is called. To run this example, first execute the python script in the console and then open index.html in a browser.
The main problem with doing it as mentioned above is that the request is being made multiple times, and we still don't know the reason for it nor how to correct it. So, the second approach relies in using a python library prepared to handle everything: Flask. Several links explaining how to send JSON data from one file to the other are written down at the reference.
It is the same as Example3 except that is called Example4 and it works properly. The execution here is different. First, you execute the python program from terminal: server.py, then open a browser and access the url given in terminal, it should be http://127.0.0.1:5000/. Now, when pressing the button, the function do_something is executed only once.
The first sketch are visualized through P5.js, a library of JavaScript. It is no more than a square where anything can be implemented. We will also work with python to make the calculations and export some premade visualizations.
For the 3D rendering we will be using a library of P5 called P3D. A quick preview is made on this video.
There is a thing called mpld3 who claims to be an easy way to translate matplotlib code to javascript. However, we are still learning to use it.

