Samstag, 24. März 2018

Cost Function For Free

Machine learning is based on hard mathematical stochastic groundwork and the the success of Deep Learning is based on the progress to understand this math and to use it rigorously.

Classification, regression clustering ... they all work with graphs, graphfunctions and the mathematical evaluation of  relations of vectors and matrices. The human brain, even a human child can draw a line between two different class of points. It has no idea of differential equations.
We can assume that the theoretical comlexities are done by the brain and the consciousness deals only with the results of this hard preliminary work. But I am not happy about this premise. I can not understand why and how we should create a mathematical function that generates a graph that fits to several dots. I have a presentment of the advantages of doing so in mathematical and technical respect. But what if there is a different paradigm the brain uses to find patterns.

To help thinking about such an alternative I suggest to see the dots as physical objects. We could implement my method in an 2D physics engine like 2dBox. The advantage of such an engine is that it provides collision and treats all points more or less synchronously. Now I let all points grow: 
The points/circle grow when a circle hits another circle of the same colour.
But it stops growing, when it collides with one of a different colour:
 Now I save the collision points and connect them with a green line:
To see the result better I let the circles shrink a little:
The bigger circles had a late contact with a circle of another colour which is a nice information on top. By shrinking to the original size we have this result:

Computational Cost

The 2dEngine has hard work to pretend that the circles are rigid objects and that there is no digital supervison of every pixel there is. To let the circle grow is easy, just change the radius.  To find or "experience" the collision points needs Pythagoras and vector addition. Computer science uses complex mathematical equations to describe the computational cost (in polynomial time?) of an given solution and I can say little or nothing if my method leads to some  savings.
The gain is a better natural approach. Every point/circle has its place and conquers its adjacent space by growing. If it collides with a circle of same colour it still grows and merges. If it collides with a circel of the other colour it stops growing and remembers the collisionpoint. So we have a kind of object orientated approach. Every circle does what it does on its own responsibilty and the interaction of all objects leads to the result.
Here are some of these results:
S-Form


Outlier


spiral filling

 Resume

I am not claiming that this method corresponds perfect to the human method of thinking but the possibilities of this approach are not even scratched. It would be interesting to build sensors that rely on similar methods of perception. This kind of perception handling relies on embodied structures and uses given data rather to perform than to compute them. I have a lot of ideas of building a perception framework based on graphless regression . It is a nice method of data presentation too. If you are interested in the code, I can provide a C# implementation but if you do it in 2d Physics by yourself and find new relations to exploit I would like to hear from you.